$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 |