#1  
Old 02-18-2017, 03:12 AM
Ceno's Avatar
Ceno Ceno is offline
Praetorian
 
Join Date: Jul 2014
Location: Mars
Posts: 8,837
Default Looking for insight into file signatures of Assets

I'm interested in generating (or, rather, copying) Asset files for mods in Grim Dawn. Now, I don't mean something like converting a .tga to a .tex; I'm referring to the files generated by the Asset Manager inside the 'Assets' tab that appear to link a textual filepath to a resource file.

In investigating the way these Asset files look, I've found them to be largely similar and predictable. However, there is one oddity in particular that I need clarification on. Consider the following outputs of a hexdump:
Code:
runfile(<REDACTED>, args='hex/eye02.tex', wdir=<REDACTED>)
00000000  41 53 54 02 e8 03 00 00  01 00 00 00 00 00 54 45  |AST...........TE|
00000010  58 02 23 00 00 00 63 6f  72 6e 74 65 78 74 75 72  |X.#...corntextur|
00000020  65 73 2f 69 74 65 6d 74  65 78 74 75 72 65 73 2f  |es/itemtextures/|
00000030  65 79 65 30 32 2e 70 73  64 01 02 00 00 00 00 14  |eye02.psd.......|
00000040  00 00 00 00 00 00 00                              |.......|
00000047

runfile(<REDACTED>, args='hex/343spark_01.tex', wdir=<REDACTED>)
00000000  41 53 54 02 e8 03 00 00  01 00 00 00 00 00 54 45  |AST...........TE|
00000010  58 02 29 00 00 00 63 6f  72 6e 74 65 78 74 75 72  |X.)...corntextur|
00000020  65 73 2f 69 74 65 6d 74  65 78 74 75 72 65 73 2f  |es/itemtextures/|
00000030  33 34 33 73 70 61 72 6b  5f 30 31 2e 74 67 61 01  |343spark_01.tga.|
00000040  02 00 00 00 00 14 00 00  00 00 00 00 00           |.............|
0000004d

runfile(<REDACTED>, args='hex/burninggaze_loop01.pfx', wdir=<REDACTED>)
00000000  41 53 54 02 f5 03 00 00  01 00 00 00 00 00 50 46  |AST...........PF|
00000010  58 01 34 00 00 00 66 78  2f 70 61 72 74 69 63 6c  |X.4...fx/particl|
00000020  65 73 79 73 74 65 6d 73  2f 73 6b 69 6c 6c 73 63  |esystems/skillsc|
00000030  6f 72 6e 2f 62 75 72 6e  69 6e 67 67 61 7a 65 5f  |orn/burninggaze_|
00000040  6c 6f 6f 70 30 31 2e 70  66 78                    |loop01.pfx|
0000004a

runfile(<REDACTED>, args='hex/equillibrium_loop01.pfx', wdir=<REDACTED>)
00000000  41 53 54 02 f5 03 00 00  01 00 00 00 00 00 50 46  |AST...........PF|
00000010  58 01 35 00 00 00 66 78  2f 70 61 72 74 69 63 6c  |X.5...fx/particl|
00000020  65 73 79 73 74 65 6d 73  2f 73 6b 69 6c 6c 73 63  |esystems/skillsc|
00000030  6f 72 6e 2f 65 71 75 69  6c 6c 69 62 72 69 75 6d  |orn/equillibrium|
00000040  5f 6c 6f 6f 70 30 31 2e  70 66 78                 |_loop01.pfx|
0000004b
0x5, 0x11, and 0x12 are three bytes that seem to differ without much rhyme or reason. My best guess is that these bytes are used to identify a particular property about the resource in question, for instance in differentiating a .tex file as a bitmap or a texture. Furthermore, it appears that .tex files are suffixed by a "00 00 00 00 14 00 00 00 00 00 00 00" but .pfx files are not.

Is there any documentation on what these bytes are and how to predict them?

Thanks.
Reply With Quote
  #2  
Old 02-18-2017, 08:54 AM
Dammitt Dammitt is offline
Praetorian
 
Join Date: Jun 2014
Posts: 413
Default

I assume it's smth like that:
4 bytes - header
1 byte - file type (code)
1 byte - file extension length (N)
2 bytes - zeroes (flags/unused?)
4 bytes (little endian) - some kind of flags I presume, always 1
2 bytes - zeroes (flags/unused?)
N bytes - file extension string
1 byte - probably a code for the following block (1 - file path, 2 - file path + data block in .tex files)
4 bytes (little endian) - file path length (M)
M bytes - file path

There's no way of telling what's at the end of .tex files, but seems like format is as follows, although it's a wild guess:
1 byte - number of data blocks?
4 bytes (little endian) - data block length? (X)
1 byte - type?
X*4 bytes - some data
__________________
www.grimtools.com
Reply With Quote
Reply

Tags
assets, bytes, modding

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Grim Dawn ©2017 Crate Entertainment, LLC.
vBulletin® 3.8.4 ©2000-2014, Jelsoft Enterprises Ltd.