From 8a697ef1323317ec5c212997d59dd958efbc96d5 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sun, 5 Jan 2025 12:04:39 -0500 Subject: [PATCH] move FUN_0054c2e0 to inline assembly and reverse Delete__5GGameFv --- src/CMakeLists.txt | 4 +- ...ack.reassemble.0480.0054c340-0054ff80.asm} | 45 +------------------ ...54c2d6.c => Game.0480.0054c180-0054c331.c} | 26 +++++++++++ 3 files changed, 29 insertions(+), 46 deletions(-) rename src/asm/unprocessed/{runblack.reassemble.0480.0054c2e0-0054ff80.asm => runblack.reassemble.0480.0054c340-0054ff80.asm} (99%) rename src/c/{Game.0480.0054c180-0054c2d6.c => Game.0480.0054c180-0054c331.c} (83%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bb8b0cd..36f8626 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -155,8 +155,8 @@ set(SOURCES asm/unprocessed/runblack.reassemble.0472.005497f0-00549900.asm asm/unprocessed/runblack.reassemble.0476.00549900-0054a180.asm asm/unprocessed/runblack.reassemble.0479.0054a180-0054c180.asm - c/Game.0480.0054c180-0054c2d6.c - asm/unprocessed/runblack.reassemble.0480.0054c2e0-0054ff80.asm + c/Game.0480.0054c180-0054c331.c + asm/unprocessed/runblack.reassemble.0480.0054c340-0054ff80.asm asm/unprocessed/runblack.reassemble.0483.0054ff80-00551ee0.asm asm/unprocessed/runblack.reassemble.0486.00551ee0-005525e0.asm asm/unprocessed/runblack.reassemble.0490.005525e0-005529e0.asm diff --git a/src/asm/unprocessed/runblack.reassemble.0480.0054c2e0-0054ff80.asm b/src/asm/unprocessed/runblack.reassemble.0480.0054c340-0054ff80.asm similarity index 99% rename from src/asm/unprocessed/runblack.reassemble.0480.0054c2e0-0054ff80.asm rename to src/asm/unprocessed/runblack.reassemble.0480.0054c340-0054ff80.asm index 8c21105..25fe8ee 100644 --- a/src/asm/unprocessed/runblack.reassemble.0480.0054c2e0-0054ff80.asm +++ b/src/asm/unprocessed/runblack.reassemble.0480.0054c340-0054ff80.asm @@ -740,50 +740,7 @@ .globl _jmp_addr_0x0054ff09 .globl _jmp_addr_0x0054ff40 -// Snippet: asm, [0x0054c2e0, 0x0054ff60) - sub esp, 0x08 // 0x0054c2e0 83ec08 - push esi // 0x0054c2e3 56 - mov.s esi, ecx // 0x0054c2e4 8bf1 - call dword ptr [rdata_bytes + 0x1c4] // 0x0054c2e6 ff15c4918a00 - sub eax, dword ptr [data_bytes + 0x30dc24] // 0x0054c2ec 2b05243ccd00 - {disp32} mov ecx, dword ptr [data_bytes + 0x30dc28] // 0x0054c2f2 8b0d283ccd00 - {disp8} mov dword ptr [esp + 0x04], eax // 0x0054c2f8 89442404 - xor.s eax, eax // 0x0054c2fc 33c0 - {disp8} mov dword ptr [esp + 0x08], eax // 0x0054c2fe 89442408 - {disp8} fild qword ptr [esp + 0x04] // 0x0054c302 df6c2404 - {disp8} mov dword ptr [esp + 0x04], ecx // 0x0054c306 894c2404 - {disp8} mov dword ptr [esp + 0x08], eax // 0x0054c30a 89442408 - {disp32} fmul dword ptr [data_bytes + 0x30dc2c] // 0x0054c30e d80d2c3ccd00 - {disp8} fiadd dword ptr [esp + 0x04] // 0x0054c314 da442404 - call _jmp_addr_0x007a1400 // 0x0054c318 e8e3502500 - {disp32} mov dword ptr [esi + 0x00205d3c], eax // 0x0054c31d 89863c5d2000 - pop esi // 0x0054c323 5e - add esp, 0x08 // 0x0054c324 83c408 - ret // 0x0054c327 c3 - nop // 0x0054c328 90 - nop // 0x0054c329 90 - nop // 0x0054c32a 90 - nop // 0x0054c32b 90 - nop // 0x0054c32c 90 - nop // 0x0054c32d 90 - nop // 0x0054c32e 90 - nop // 0x0054c32f 90 - ret // 0x0054c330 c3 - nop // 0x0054c331 90 - nop // 0x0054c332 90 - nop // 0x0054c333 90 - nop // 0x0054c334 90 - nop // 0x0054c335 90 - nop // 0x0054c336 90 - nop // 0x0054c337 90 - nop // 0x0054c338 90 - nop // 0x0054c339 90 - nop // 0x0054c33a 90 - nop // 0x0054c33b 90 - nop // 0x0054c33c 90 - nop // 0x0054c33d 90 - nop // 0x0054c33e 90 - nop // 0x0054c33f 90 +// Snippet: asm, [0x0054c340, 0x0054ff60) _jmp_addr_0x0054c340: push esi // 0x0054c340 56 mov.s esi, ecx // 0x0054c341 8bf1 call _jmp_addr_0x0050ccc0 // 0x0054c343 e87809fcff diff --git a/src/c/Game.0480.0054c180-0054c2d6.c b/src/c/Game.0480.0054c180-0054c331.c similarity index 83% rename from src/c/Game.0480.0054c180-0054c2d6.c rename to src/c/Game.0480.0054c180-0054c331.c index 465bd24..938f140 100644 --- a/src/c/Game.0480.0054c180-0054c2d6.c +++ b/src/c/Game.0480.0054c180-0054c331.c @@ -86,3 +86,29 @@ void __fastcall StartGame__5GGameFv(struct GGame* this) { " add esp, 0x10\n" // 0x0054c2d2 83c410 ); } + +void __fastcall FUN_0054c2e0(struct GGame* this) { + __asm__( + "sub esp, 0x08\n" // 0x0054c2e0 83ec08 + "push esi\n" // 0x0054c2e3 56 + "mov.s esi, ecx\n" // 0x0054c2e4 8bf1 + "call dword ptr [rdata_bytes + 0x1c4]\n" // 0x0054c2e6 ff15c4918a00 + "sub eax, dword ptr [data_bytes + 0x30dc24]\n" // 0x0054c2ec 2b05243ccd00 + "{disp32} mov ecx, dword ptr [data_bytes + 0x30dc28]\n" // 0x0054c2f2 8b0d283ccd00 + "{disp8} mov dword ptr [esp + 0x04], eax\n" // 0x0054c2f8 89442404 + "xor.s eax, eax\n" // 0x0054c2fc 33c0 + "{disp8} mov dword ptr [esp + 0x08], eax\n" // 0x0054c2fe 89442408 + "{disp8} fild qword ptr [esp + 0x04]\n" // 0x0054c302 df6c2404 + "{disp8} mov dword ptr [esp + 0x04], ecx\n" // 0x0054c306 894c2404 + "{disp8} mov dword ptr [esp + 0x08], eax\n" // 0x0054c30a 89442408 + "{disp32} fmul dword ptr [data_bytes + 0x30dc2c]\n" // 0x0054c30e d80d2c3ccd00 + "{disp8} fiadd dword ptr [esp + 0x04]\n" // 0x0054c314 da442404 + "call _jmp_addr_0x007a1400\n" // 0x0054c318 e8e3502500 + "{disp32} mov dword ptr [esi + 0x00205d3c], eax\n" // 0x0054c31d 89863c5d2000 + "pop esi\n" // 0x0054c323 5e + "add esp, 0x08\n" // 0x0054c324 83c408 + ); +} + +void __fastcall Delete__5GGameFv(struct GGame* this) { +} \ No newline at end of file