XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Nov 24, 2017 1:21 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 11:55 am 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
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:
Image

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:
        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))


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.

Image

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.


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 1:54 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2154
Location: Nexus, searching for Jim Kirk
Has thanked: 426 times
Have thanks: 1100 times
funny format. I wouldn't care for the face indices for now, as a first step I'd look for a decent point cloud.

funny enough: I changed the FVFsize in steps of 4 from 12 up to 52 (count decreased to 262 then)
and there's that square mesh part remaining in the midst:

getting the proper FVF size would be important, I'd guess for 16, but not sure.

Maybe a less complex object like a book, a box or a cup could give more insights?

Approaching the above mentioned object (as a point cloud) I've tried this H2O file :
0x0 500
Vb1
12 99
0x2FC8 150
020000
0x0 255


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 2:32 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
Yah, it's a bit weird. Considering the armors were in a very standard structure. While the weapons aren't.

So, the items available here are weapons and shields. Would a shield be considered a simple object? Unfortunately there isn't any item that is a book or resembles a book.

Let me do a quick unpack of items I think looks simple and I'll post some here :) Thank you as always!!!


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 2:49 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
Hi :)... Here are the related files.

I think the following items are simple:

======================================

objects/0.bin (broad sword)
Image
Image

======================================

objects/1.bin (long sword)
Image

======================================

I'm trying to do some experiment based on the data you shared... Hopefully can find something...


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 6:23 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2154
Location: Nexus, searching for Jim Kirk
Has thanked: 426 times
Have thanks: 1100 times
no luck so far. While the outer vertices look symmetrical the inner ones are kinda mess:


btw: number of .bins and number of textures doesn't match, can we expect 0.png to belong to 0.bin?


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 7:17 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
This one is a bit hard, I've been scratching my head on this format for half a year already. I even considered that this might be encrypted which I highly doubt because of all the float values.

As for texture. Each .bin actually contains which texture it uses. At offset 0x80 its a short but oddly repeated 4 times. Like for texture 5.png it shows, "05 00 05 00 05 00 05 00".

Another thing worth noting is that the armors had 3 LOD steps so each armor actually stored 3 objects. Maybe each of this ".bin" is actually 3 objects... hmmmm


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 9:14 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2154
Location: Nexus, searching for Jim Kirk
Has thanked: 426 times
Have thanks: 1100 times
checking a simple object like 106.bin doesn't help:

(There's many equal values, which might be an issue worth being investigated.)


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Mon May 15, 2017 11:43 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
So I decided to look at the smallest size bin file. 201.bin is only 1288 bytes.

Texture:
Image

Based on the texture it looks like its a shield, 1 of 4 possible shields.

Item Icon:
Image

Item Model:
ImageImageImageImage

Like how the texture index is weirdly repeated 4 times. I also noticed what you meant, some values are repeated 4 or 3 times.

Image

The remaining bytes on the file right after the last offset (0x88) of the texture index is 0x480 or 1152. I thought of dividing this by 4 which gives me 288. Looking at the header data for 201 which is (1 12 12) gave me the idea to further divide 288 by 12, which gives me 24.

I still have no idea what this means at this point but it seems to show a bit of a structure. But no luck:
Image


Top
 Profile  
 
 Post subject: [PC] Khan Online (Mirinae Entertainment)
PostPosted: Tue May 16, 2017 3:47 am 
Offline
VIP member
VIP member

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 921
Has thanked: 1922 times
Have thanks: 486 times
i think more info about the game could shed light on some unknowns.
if the developer has other games that have already been researched with findings maybe you could apply some of those to this one.
from what i've read in your other posts, this is a 2001 Korean MMORPG named Khan?
viewtopic.php?p=121958#p121958
or is this another game? i can find nothing about this title.
does this game go by any other names? i found a game called Kohan from 2001.
who was the developer?
do you have any web links to any kind of info about this game?

edit
http://www.hardcoregaming101.net/korea/ ... irinae.htm

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Last edited by AceWell on Wed May 17, 2017 2:18 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Tue May 16, 2017 4:07 am 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
AceWell wrote:
i think more info about the game could shed light on some unknowns.
if the developer has other games that have already been researched with findings maybe you could apply some of those to this one.
from what i've read in your other posts, this is a 2001 Korean MMORPG named Khan?
viewtopic.php?p=121958#p121958
or is this another game? i can find nothing about this title.
does this game go by any other names? i found a game called Kohan from 2001.
who was the developer?
do you have any web links to any kind of info about this game?


Yes, its exactly the same game I was talking about on that post.

The best info I can give is, this code, it reads the item file that I'm trying to unpack on this topic. The code is generated by a debugger so it's a bit messy. And it's too much for me to reverse engineer.


Last edited by majidemo on Tue May 16, 2017 8:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Unpacking Weapons and Shield Data
PostPosted: Tue May 16, 2017 7:44 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 66
Has thanked: 27 times
Have thanks: 34 times
I finally figured it out... The format is a bit tricky...

Idea on the format: Take for example a 3 vertex object and the data is 36 bytes. The vertices offset would be like:
Code:
v float1, float4, float7
v float2, float5, float8
v float3, float6, float9


Image

Unfortunately there is 128 bytes I cannot guess the structure yet. So I can't create an importer back to the original format for now. Any idea on what the rest of the bytes could be? It's all floats. It's before the texture IDs.

BIG THANK YOU TO shakotay2! AS ALWAYS! :D

EDIT: I just tried to 00 out all the 128 unknown bytes and checked the game and saw NOTHING IS WRONG. Weird, whatever they were they didn't seem to affect anything or I just didn't notice.

EDIT EDIT: I finally saw whats wrong when the 128 bytes are zeroed, the particle effects now spawn at origin. Instead of specific positions on the items.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: cocoseco, killercracker and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group