Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Akari on 2007-05-15 13:17:45

Title: About KAWAI opcode.
Post by: Akari on 2007-05-15 13:17:45
Could someone post size for all subopcodes in KAWAI. I need this to finish 0.13 =)

ps: SynergyBlades - can you solve mystery on NFADE opcode? At least something.
Title: Re: About KAWAI opcode.
Post by: dziugo on 2007-05-15 13:52:41
The second byte is the length of the whole opcode.
Link (http://forums.qhimm.com/index.php?topic=5790.0).
Title: Re: About KAWAI opcode.
Post by: Akari on 2007-05-15 14:25:56
The second byte is the length of the whole opcode.
Link (http://forums.qhimm.com/index.php?topic=5790.0).

KAWAI (0D,00,00)
KAWAI (0D,01)
KAWAI (0D,02,00)
KAWAI (02,00,00,00,00,00,00,01)

This taken from Meteor. I don't see how 2nd byte can be length.
Title: Re: About KAWAI opcode.
Post by: dziugo on 2007-05-15 15:05:31
At the beginning of the KAWAI function:
Code: [Select]
0062013D  |. 33C0                 XOR EAX,EAX
0062013F  |. A0 6409CC00          MOV AL,BYTE PTR DS:[CC0964] ; current entity
00620144  |. 33C9                 XOR ECX,ECX
00620146  |. 66:8B0C45 F80CCC00   MOV CX,WORD PTR DS:[EAX*2+CC0CF8] ; current offset for that entity
0062014E  |. 8B15 E8F5CB00        MOV EDX,DWORD PTR DS:[CBF5E8]
00620154  |. 66:0FB6440A 01       MOVZX AX,BYTE PTR DS:[EDX+ECX+1] ; read the 2nd byte (first one is 0x28)
0062015A  |. 66:8945 F8           MOV WORD PTR SS:[EBP-8],AX ; here we store it
And, at the end of the function:
Code: [Select]
00620431  |> 33C0                 XOR EAX,EAX
00620433  |. A0 6409CC00          MOV AL,BYTE PTR DS:[CC0964]
00620438  |. 66:8B0C45 F80CCC00   MOV CX,WORD PTR DS:[EAX*2+CC0CF8] ; get the offset  for current entity
00620440  |. 66:034D F8           ADD CX,WORD PTR SS:[EBP-8] ; add to it previously extracted byte
00620444  |. 33D2                 XOR EDX,EDX
00620446  |. 8A15 6409CC00        MOV DL,BYTE PTR DS:[CC0964]
0062044C  |. 66:890C55 F80CCC00   MOV WORD PTR DS:[EDX*2+CC0CF8],CX ; and store it
Title: Re: About KAWAI opcode.
Post by: Synergy Blades on 2007-05-15 16:10:22
dziugo is correct. Meteor hides/recalculates the KAWAI opcode length for you.  :-)

Akari: I have my uni exams coming up in a week. I will be flat-out busy until early June-ish.
Title: Re: About KAWAI opcode.
Post by: Akari on 2007-05-15 17:41:27
dziugo is correct. Meteor hides/recalculates the KAWAI opcode length for you.  :-)

Akari: I have my uni exams coming up in a week. I will be flat-out busy until early June-ish.

Ok. I'll add length manually for now.

Good luck with your exams =)