Jun 6, 2013 at 8:10 PM
I'm trying to change the escape menu function so that it only executes if a certain flag is unset but I guess it keeps ending up in infinite loops whenever I press the escape key.
That's my code so far. The first part is where the original function starts. The second part is a more or less binary pasted version of the original function plus the flag check directly before it.
Code:
CPU Disasm
Address Hex dump Command Comments
0040DD70 $ /E9 5BCE0100 JMP 0042ABD0
0040DD75 |90 NOP
0040DD76 |90 NOP
0040DD77 |90 NOP
0040DD78 |90 NOP
0040DD79 |90 NOP
0040DD7A |90 NOP
0040DD7B |90 NOP
0040DD7C |90 NOP
0040DD7D |90 NOP
0040DD7E |90 NOP
0040DD7F |90 NOP
0040DD80 |90 NOP
0040DD81 |90 NOP
0040DD82 |90 NOP
0040DD83 |90 NOP
0040DD84 |90 NOP
0040DD85 |90 NOP
0040DD86 |90 NOP
0040DD87 |90 NOP
0040DD88 |90 NOP
0040DD89 |90 NOP
0040DD8A |90 NOP
CPU Disasm
Address Hex dump Command Comments
0042ABD0 /$ \68 B80B0000 PUSH 0BB8 ; /Arg1 = 0BB8
0042ABD5 |. E8 563DFEFF CALL 0040E930 ; \Amamichi2.0040E930
0042ABDA |. 83C4 04 ADD ESP,4
0042ABDD |. 83F8 01 CMP EAX,1
0042ABE0 |. 0F84 DD000000 JE 0042ACC3
0042ABE6 |. 55 PUSH EBP
0042ABE7 |. 8BEC MOV EBP,ESP
0042ABE9 |. 83EC 10 SUB ESP,10
0042ABEC |. C745 F0 00000 MOV DWORD PTR SS:[LOCAL.4],0
0042ABF3 |. C745 F4 80000 MOV DWORD PTR SS:[LOCAL.3],80
0042ABFA |. C745 F8 D0000 MOV DWORD PTR SS:[LOCAL.2],0D0
0042AC01 |. C745 FC 90000 MOV DWORD PTR SS:[LOCAL.1],90
0042AC08 |> B8 01000000 /MOV EAX,1
0042AC0D |. 85C0 |TEST EAX,EAX
0042AC0F |. 0F84 AE000000 |JE 0042ACC3
0042AC15 |. E8 3C450000 |CALL 0042F156
0042AC1A |. 8B0D 14E24900 |MOV ECX,DWORD PTR DS:[49E214]
0042AC20 |. 81E1 00800000 |AND ECX,00008000
0042AC26 |. 74 11 |JE SHORT 0042AC39
0042AC28 |. C705 14E24900 |MOV DWORD PTR DS:[49E214],0
0042AC32 |. 33C0 |XOR EAX,EAX
0042AC34 |. E9 8C000000 |JMP 0042ACC5
0042AC39 |> 8B15 14E24900 |MOV EDX,DWORD PTR DS:[49E214]
0042AC3F |. 81E2 00040000 |AND EDX,00000400
0042AC45 |. 74 11 |JE SHORT 0042AC58
0042AC47 |. C705 14E24900 |MOV DWORD PTR DS:[49E214],0
0042AC51 |. B8 01000000 |MOV EAX,1
0042AC56 |. EB 6D |JMP SHORT 0042ACC5
0042AC58 |> A1 14E24900 |MOV EAX,DWORD PTR DS:[49E214]
0042AC5D |. 25 00080000 |AND EAX,00000800
0042AC62 |. 74 11 |JE SHORT 0042AC75
0042AC64 |. C705 14E24900 |MOV DWORD PTR DS:[49E214],0
0042AC6E |. B8 02000000 |MOV EAX,2
0042AC73 |. EB 50 |JMP SHORT 0042ACC5
0042AC75 |> 6A 00 |PUSH 0
0042AC77 |. 68 2CF94800 |PUSH OFFSET 0048F92C
0042AC7C |. E8 D5EBFFFF |CALL 00429856
0042AC81 |. 83C4 08 |ADD ESP,8
0042AC84 |. 6A 1A |PUSH 1A
0042AC86 |. 8D4D F0 |LEA ECX,[EBP-10]
0042AC89 |. 51 |PUSH ECX
0042AC8A |. 6A 70 |PUSH 70
0042AC8C |. 6A 38 |PUSH 38
0042AC8E |. 68 2CF94800 |PUSH OFFSET 0048F92C
0042AC93 |. E8 9EE5FFFF |CALL 00429236
0042AC98 |. 83C4 14 |ADD ESP,14
0042AC9B |. E8 46450000 |CALL 0042F1E6
0042ACA0 |. 8B55 08 |MOV EDX,DWORD PTR SS:[EBP+8]
0042ACA3 |. 52 |PUSH EDX ; /Arg1
0042ACA4 |. E8 0DD5FFFF |CALL 004281B6 ; \Amamichi2.004281B6
0042ACA9 |. 83C4 04 |ADD ESP,4
0042ACAC |. 85C0 |TEST EAX,EAX
0042ACAE |.^ 75 0E |JNE SHORT 0042ACBE
0042ACB0 |. C705 14E24900 |MOV DWORD PTR DS:[49E214],0
0042ACBA |. 33C0 |XOR EAX,EAX
0042ACBC |. EB 07 |JMP SHORT 0042ACC5
0042ACBE |>^ E9 45FFFFFF \JMP 0042AC08
0042ACC3 |> 33C0 XOR EAX,EAX
0042ACC5 |> 8BE5 MOV ESP,EBP
0042ACC7 |. 5D POP EBP
0042ACC8 \. C3 RETN