![]() ![]() Now take those 9 bits, and reverse them also. It’s backwards twice, so once you have your revese binary stream. Now, the interesting twist to this goes back to what I said initially. But which ID is for which stat? We’ll here’s another function. Kepp in mind that although the stat id is always 9-bits, the value is not always 10 bits. Here is a function that returns the number of bits in the value for a given stat id. “xxxxxxxx xyyyyyyy yyyxxxxx xxxxyyyy yyyyyy…” where x is the 9bit stat id, and y is the value of the stat. so the binary stream is in a format like this. Once you have the reversed binary, you’ll be looking at the 9-bit stat header to find out which stat comes in the next sequence of bytes. This will be the new base for parsing out data. To make sense of it you’ve gotta first reverse the whole thing from a binary stream perspective. The 2nd issue to deal with is that except for single byte entries, the section of the file dealing with character stats is back-asswords…double time! Starting at offset 765 (0x2FD), you should see a two bytes- 0圆7 and 0圆6, this marks the header for the character stats part of the file. Now take everything after the header (not including it) all the way to the footer tag marked by the bytes 0圆9 and 0圆6 (not including the footer tag). $checksum = $checksum + ($checksum - Mod($checksum,256)) / 256Īctions speak louder than words sometimes □ $temp=Dec(Hex(Binary($byteA)))+$boolCarry Well I’m probably making it sound harder than it is… here’s the algorithm in AutoIt (assumes a byte-array $byteA with each byte of the file loaded sequentially). If the first checksum byte becomes greater than 256, it signalsfor a carry bit to be put into the second byte (and so on). Each new byte gets put into the first checksum byte, but before you do any operation on the checksum bytes, you must multiply it by 2 (each iteration). There are some references to the particular method of checksum but In my own words I’d call it a “256 Modulus-carryover”. ![]() The checksum itself is not too complicated, but keep in mind that you must NOT include the checksum bytes themselves as part of the checksum. ![]() These 4 bytes will be the checksum for the file. Starting at byte offset 12 (0x0C) there is a series of 4 bytes, ending at offset 15 (0x0F). When trying to simply do a hex-edit to the file, there’s 2 major obstacles. There’s some other documentation on it elsewhere but I’ll put what I’ve discovered here for another take on it. Did some playing around with the single player save game file format for Diablo II recently. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |