[Code Help] How do we read/parse a character's name out of Spawn/Diablo/Hellfire SP and MP files? #7444
Unanswered
donotsdubba
asked this question in
Q&A
Replies: 2 comments 5 replies
-
|
even to get "just the character name" you have to decrypt the MPQ |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
This is the function that decodes the encrypted files. You'll need to roll your own SHA-1 implementation, I think, because of the note in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, my apologies if I missed seeing this being discussed elsewhere before.
I'm creating a read-only helper tool for all vanilla versions of Diablo, Diablo Spawn and Hellfire, and the only point I'm stuck at is figuring out how to extract a character/hero/player's name from a save file. Using C#, I believe I can easily read the data using some FileStream-like class and read it all as an array of bytes, then parse the exact location accordingly.
Thing is, when I used a hex editor, I saw that all the character data inside a file is "encrypted", although there is a hint at the top (header?) that it is a MPQ-format file, like many other Diablo files? In any case, I peeked and poked around both Devilution's and DevilutionX' C++ source codes, and while I think I located some of the relevant portions (MPQ file parser logic? Character data parsing logic?), I honestly could not figure out how it was actually doing all that...
Rather than reinvent the wheel, I thought I'd ask you guys who work on the code what is the simplest approach to parsing such files. All I really need is the character name, nothing more...
Incidentally, I believe I have seen somewhere before that the character name is supposed to be stored in a char array of 32 positions. Is that right?
Thank you very much for any help in advance,
Dubba
Beta Was this translation helpful? Give feedback.
All reactions