crimsoncantab / aok-hotkeys

Hotkey Editor for Age of Empires II
Other
25 stars 9 forks source link

Read Hotkey values from a player0.hki #51

Closed gregstein closed 6 years ago

gregstein commented 6 years ago

Hello again, (I apologize for starting the second ticket in the row) So I would like to read all hotkey values from player0.hki and have them saved into text file. I attempted that in C# but sadly I got nowhere. You also suggested me to use hotkeys.py d < player0.hki > player0.hki Which I have typed to Pycharm Terminal and the output returned an Text file. BTW, I have never touched Python before so I would appreciate if you could help me out with this one.

Thank you so much,

gregstein commented 6 years ago

Thank you! I have managed to decompress the .dat file out of .hki using offzip method.

Here is the binary file in Hex:

Binary Hotkey

Now I am wondering if you have already made pointers to those values. Looking at here https://github.com/crimsoncantab/aok-hotkeys/blob/7a1587d2489a0825a5c7c2b1e1618b79255caf96/modules/hotkeys.py#L5-L15 It seems you have done quite an impressive job there. Do they point to the binary file *.dat ?

crimsoncantab commented 6 years ago

@gregstein , they're not exactly "pointers" so much as "markers." The decompressed file is an array of 12-byte c struct objects, occasionally separated by 4-byte "headers" for each section of the hotkey list. If you look at lines 609-610, they define the struct (in python terms):

Hope that helps.

gregstein commented 6 years ago

WOW!! Thank you so much!!! This is reallly helpful! <3