Aika Online .bin encryption-decryption
Some of the Aika .bin files are encrypted. Here are cipher tables, asm functions and C/Delphi codes for encryption and decryption those files. You can examine them all and try to find something interesting.
P.S. if it necessary I can make a small app for automatization of (de)encryption process
ItemList%.bin
UI/PI.bin
EDI - length of decryption array
Algorithm
004058CE |> /8BC1 /MOV EAX,ECX
004058D0 |. |8A99 80B43401 |MOV BL,BYTE PTR DS:[ECX+134B480] ; byte from file
004058D6 |. |99 |CDQ
004058D7 |. |F7FF |IDIV EDI
004058D9 |. |8A92 54565E00 |MOV DL,BYTE PTR DS:[EDX+5E5654] ; load byte from table
004058DF |. |02D1 |ADD DL,CL ; add counter value
004058E1 |. |2ADA |SUB BL,DL
004058E3 |. |8899 80B43401 |MOV BYTE PTR DS:[ECX+134B480],BL ; write new byte to the buffer
004058E9 |. |41 |INC ECX
004058EA |. |81F9 00405600 |CMP ECX,00564000 ; cmp with file length
004058F0 |.^7C DC JL SHORT 004058CE
cipher table
Code:
BE C6 C0 CC C5 DB 20 B8 AE BD BA C6 AE 20 C0 CE
C4 DA B5 F9 20 B7 E7 C6 BE C0 D4 B4 CF B4 D9 2E
20 B7 EA B7 E7 20 B6 F6 B6 F3 2E 2E 2E 20 C0 B8
2E 2E 2E 20 C1 A4 B8 BB 20 C1 A4 B8 BB 20 B1 CD
C2 FA B4 D9 2E 20 B1 D7 B7 A1 B5 B5 20 C7 D8 BE
DF C7 CF B4 CF 20 BE EE C2 BF 20 BC F6 20 BE F8
C1 D2 2E 2E 2E 20
SkillData%d.bin
UI/Recipe.bin
UI/ReinforceW01.bin
UI/Reinforce2.bin
UI/Reinforce3.bin
UI/Easing.bin
UI/Siege01.bin
UI/Siege02.bin
UI/BW.bin
UI/MakeItems.bin
Algorithm same as above
cipher table
Code:
C0 CC B0 C5 20 C0 D0 C1 F6 20 B8 B6 BC BC BF E4
2E 20 C0 D0 C0 B8 B8 E9 20 B3 AA BB DB BB E7 B6
F7 B5 CB B4 CF B4 D9 2E 20 C1 A6 B9 DF 20 C0 FD
B4 EB 20 C0 D0 C1 F6 B8 BB B0 ED 20 C2 F8 C7 D1
20 BB E7 B6 F7 B5 EE B7 CE 20 BB E7 BC BC BF E4
2E 20 BE C6 BC CC C1 D2 3F 20 C1 C1 C0 BA BC BC
BB F3 B8 B8 B5 EC BD C3 B4 D9 2E
UI/curse.bin
00423468 |> /8A88 300EC101 /MOV CL,BYTE PTR DS:[EAX+1C10E30]
0042346E |. |40 |INC EAX
0042346F |. |F6D1 |NOT CL
00423471 |. |8888 2F0EC101 |MOV BYTE PTR DS:[EAX+1C10E2F],CL
00423477 |. |3D 00000100 |CMP EAX,10000
0042347C |.^72 EA JB SHORT 00423468
UI/MN.bin
00420052 |> /8A88 50D8AF01 /MOV CL,BYTE PTR DS:[EAX+1AFD850]
00420058 |. |2AC8 |SUB CL,AL
0042005A |. |8888 50D8AF01 |MOV BYTE PTR DS:[EAX+1AFD850],CL
00420060 |. |40 |INC EAX
00420061 |. |3D 00000400 |CMP EAX,40000
00420066 |.^7C EA JL SHORT 00420052
C, Delphi code example
v4 = 0;
do
{
dword_134B480[v4] -= (_BYTE)v4 + byte_5E5654[v4 % (signed int)(strlen(byte_5E5654) - 1)];
v4++;
}
decryption
for j:=0 to length(Buffer) - 1 do
buffer[j] := buffer[j] - (cipherTable[j mod cipherLength] + j);
encryption
for j:=0 to length(Buffer) - 1 do
buffer[j] := buffer[j] + (cipherTable[j mod cipherLength] + j);
© Dwar
SkillData.bin + ItemList.bin structure: https://progamercity.net/game-files/...structure.html