Unpacking Weapons and Shield Data
Posted: Mon May 15, 2017 11:55 am
Hello,
It's been more than 6 months since I last asked about unpacking weapons but I still have the exact same problem. I still wasn't able to unpack the files because my technique always included looking for the face indices and these files doesn't have any, it seems like everything is a float.
I have extracted a segment of the files which I expect to contain a dagger that looks like this:

I have also written an analyzer that perfectly maps all data in the file to a structure, I just don't have any idea what the structure means.
This is a portion of the analyzer for a weapon. This includes comments on the functions used to read the data when I put the game under a debugger:
The code above reads one weapon. But it's weird as there are no face indices and there seems to be too much floats for simple 3D weapons.

Any idea on what this could mean? Why aren't there any face indices?
Here is the binary file for the weapon in question: DOWNLOAD.
The binary doesn't include the header data which is: (1, 194, 194)
I have no idea what 194 could mean, it could be number of faces or number of vertices...
1 can be ignored as its the same for all headers.
It's been more than 6 months since I last asked about unpacking weapons but I still have the exact same problem. I still wasn't able to unpack the files because my technique always included looking for the face indices and these files doesn't have any, it seems like everything is a float.
I have extracted a segment of the files which I expect to contain a dagger that looks like this:

I have also written an analyzer that perfectly maps all data in the file to a structure, I just don't have any idea what the structure means.
This is a portion of the analyzer for a weapon. This includes comments on the functions used to read the data when I put the game under a debugger:
Code: Select all
head = headers[m]
# sub_65CC40((void *)(v16 - 4), 1u, 4u, v5);
# sub_65CC40((void *)v16, 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 4), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 8), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 12), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 16), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 20), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 24), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 28), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 32), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 36), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 40), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 44), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 48), 1u, 4u, v5);
# sub_65CC40((void *)(v16 + 52), 1u, 4u, v5);
unk0 = unpack("<fffffffffffffff", bin.read(60))
for n in range(head[0]): # head[0] is 1
# sub_65CC40((void *)(v37 + *(_DWORD *)(v16 + 56)), 1u, 4u, v5);
# sub_65CC40((void *)(v18 + 4), 1u, 0x40u, v5);
# sub_65CC40((void *)(v18 + 76), 4u, 2u, v5);
unk1 = unpack("<i", bin.read(4))
unk2 = unpack("<ffffffffffffffff", bin.read(64))
textureIds = unpack("<hhhh", bin.read(8))
v19 = head[1] # head[1] is 194
v20 = 3 * v19
if (3 * v19) > 0:
# sub_65CC40(*(void **)(v18 + 88), 3 * v19, 4u, v5);
# sub_65CC40(*(void **)(v18 + 92), v20, 4u, v5);
# sub_65CC40(*(void **)(v18 + 96), v20, 4u, v5);
# sub_65CC40(*(void **)(v18 + 100), v20, 4u, v5);
# sub_65CC40(*(void **)(v18 + 104), v20, 4u, v5);
# sub_65CC40(*(void **)(v18 + 108), v20, 4u, v5);
bin.read(3*v19*4)
bin.read(v20*4)
bin.read(v20*4)
bin.read(v20*4)
bin.read(v20*4)
bin.read(v20*4)
v21 = head[2] # head[2] is 194
v22 = 3 * v21
if (3 * v21) > 0:
# sub_65CC40(*(void **)(v18 + 112), 3 * v21, 4u, v5);
# sub_65CC40(*(void **)(v18 + 116), v22, 4u, v5);
unk4r = "f"*(3*v21)
unk4 = unpack("<%s" % (unk4r), bin.read(3*v21*4))
unk5r = "f"*(v22)
unk5 = unpack("<%s" % (unk5r), bin.read(v22*4))

Any idea on what this could mean? Why aren't there any face indices?
Here is the binary file for the weapon in question: DOWNLOAD.
The binary doesn't include the header data which is: (1, 194, 194)
I have no idea what 194 could mean, it could be number of faces or number of vertices...
1 can be ignored as its the same for all headers.











