Ok, just a short guide on decrypting the new monster.dat distributed with the Conquer2.0 upgrade. I figure some of you might need to decrypt it to change monster sizes like we've done in the past.
This is only the decryption, so it'll need reversing to be able to make edits, any volunteers?
I'm not very good at explaining this kinda thing, but heres goes.
---
We have 3 counters.
CounterA, CounterB, CounterC
CounterA starts at zero, and it a pointer to the next byte you access from Monster.Dat
CounterB = CounterA Modulus 128. Counter B points to the next byte in the decryption key. (below)
CounterC = CounterA Modulus 8, is used for bitwise shift, explained below.
Decryption Key
Monster.Dat (beginning)
Ok, so each increment of Counter A, you increase Counters B and C.
-Get byte from location CounterA from Monster.dat (ByteA)
-Get byte from location CounterB from the decryption key (ByteB).
-XOR ByteA, ByteB
-Let ByteC = ByteA
-Bitwise Shift Left ByteA by (8 - CounterC)
-Bitwise Shift Right ByteC by CounterC
-Result = ByteA + ByteC
The decrypted file is a structured test file, much like the old monster.ini file, except it contains quite a few more variables.
I'm getting a few invalid characters in my decrypted file, but I think thats just an incorrect byte in the decryption key I need to re-check, Maybe tomorrow.
This is only the decryption, so it'll need reversing to be able to make edits, any volunteers?
I'm not very good at explaining this kinda thing, but heres goes.
---
We have 3 counters.
CounterA, CounterB, CounterC
CounterA starts at zero, and it a pointer to the next byte you access from Monster.Dat
CounterB = CounterA Modulus 128. Counter B points to the next byte in the decryption key. (below)
CounterC = CounterA Modulus 8, is used for bitwise shift, explained below.
Decryption Key
Code:
AD 6B 4F FB DD B8 0E 09 13 33 8F F5 43 09 15 88 5D 80 A3 45 2D 42 08 56 80 F8 19 C5 88 1B 3E EF 81 07 30 36 95 52 00 F7 FD 5B 5C BC 6A 26 0E B2 A3 67 C5 5D 6F DC 18 8A B5 E0 C8 85 E2 3E 45 8D 8B 43 74 85 54 17 B0 EC 10 4D 0F 0F 29 B8 E6 7D 42 80 8F BC 1C 76 69 3A B6 A5 21 86 B9 29 30 C0 12 45 A5 4F E1 AF 25 D1 92 2E 30 58 49 67 A5 D3 84 F4 89 CA FC B7 04 4F CC 6E AC 31 D4 87 07 72
Code:
F6 E5 9A B0 1B 34 9E BB 72 D5 5E 1F 93 48 C1 3C 27 4A A6 66 6B E5 44 D0 8A 4C A4 BE 5E 11 67 D6 E2 CD 89 95 46 74 0C EF F0 4F 69 B7 ED AF 54 81 C6 1D 1D F4 3C BA 55 0C BF 78 5D 36 B4 B3 0A 15 86 57 7D FE 73 DA E0 5D 64 9F B2 7C FA DE AA E7 4F 94 86 C7 3B BB 38 09 D0 6F AC 25 6A 80 A0 69 66 87 1C 6C F7 E1 3C 57 98 AA 8D CB AF 0D 7E 69 EA 3C 7D B9 0A 7A 5D C9 C6 EC 21 92 F1 2B DB 62...
-Get byte from location CounterA from Monster.dat (ByteA)
-Get byte from location CounterB from the decryption key (ByteB).
-XOR ByteA, ByteB
-Let ByteC = ByteA
-Bitwise Shift Left ByteA by (8 - CounterC)
-Bitwise Shift Right ByteC by CounterC
-Result = ByteA + ByteC
Code:
example: CounterA = 7 CounterB = CounterA Mod 128 //=0x7 CounterC = CounterA Mod 8 //=0x7 ByteA = 0xBB ByteB = 0x09 xor ByteA, ByteB // 0xBB xor 0x0E = 0xB2 ByteC = ByteA // =0xB2 shl ByteA, (8 - CounterC) // ByteA = 0x64 shr ByteC, CounterC //ByteC = 0x1 result = ByteA + ByteC // 0x64 + 0x1 = 0x65 (101 = "e")
Code:
[MonsterName] SizeAdd=%d ZoomPercent=%d MaxLife=%d Level=%d BornAction=%d BornEffect=%s BornSound=%s ActResCtrl=%d ASB=%d ADB=%d" BodyType=%d TypeID=%d AntiType=%d