diff --git a/Makefile b/Makefile index ac65503..674f276 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,6 @@ BIN_BASE := core \ hook_oCSpawnManager__Archive \ hook_npcReference \ hook_recoverInvalidItem \ - hook_recoverInvalidItem2 \ hook_fastexit \ hook_CGameManager_destructor \ hook_libExit \ diff --git a/src/core.asm b/src/core.asm index 931f363..80c279e 100644 --- a/src/core.asm +++ b/src/core.asm @@ -4,13 +4,13 @@ %include "inc/engine.inc" %ifidn __OUTPUT_FORMAT__, bin - org g1g2(0x452604,0x459190,0x456D20,0x457470) + org g1g2(0x452640,0x459190,0x456D20,0x457470) %endif bits 32 ; This address space spans multiple methods of the deprecated class -; 'zCNetEventManager' starting with zCNetEventManager::_CreateNewInstance. +; 'zCNetEventManager' starting with zCNetEventManager::HandleNetMessage. ; After a long testing period any safety checks for ensuring that the ; overwritten methods are indeed never called are now omitted. diff --git a/src/exec/misc.asm b/src/exec/misc.asm index 1181525..3ef0f08 100644 --- a/src/exec/misc.asm +++ b/src/exec/misc.asm @@ -288,51 +288,6 @@ recoverInvalidItem: jmp g1g2(0x66DC47,0x69B420,0x6AFBB9,0x70D6D9) + 6 -global recoverInvalidItem2 -recoverInvalidItem2: - resetStackoffset g1g2(0x110,0x110,0x158,0x15C) - %assign var_numInvSlots -g1g2(0xB8,0xA8,0x100,0xEC) - %assign var_loopIndex -g1g2(0xE8,0xD8,0x138,0x140) - %assign var_used -g1g2(0x38,0x38,0x6C,0x70) - - mov eax, [esp+stackoffset+var_loopIndex] ; Check if first iteration (i.e. index == 0) - test eax, eax - jnz .backOriginal ; If not, jump back as original - - mov eax, [esi] ; Read as integer and store it - call [eax+0x60] ; zCArchive->ReadInt - addStack 4 - - movzx ecx, BYTE [esp+stackoffset+var_used] ; Take only the lowest byte - cmp ecx, 0x1 ; Check if boolean (i.e. low byte <= 1) - verifyStackoffset g1g2(0x110,0x110,0x158,0x15C) - 0x4 - jbe .backCorrect ; If so, continue as expected - - mov eax, [esp+stackoffset+var_used] ; Fix the misread values - mov [esp+stackoffset+var_numInvSlots], eax ; Update maximum loop iterations - - mov ecx, esi ; Read the next (correct) value from archive - lea eax, [esp+stackoffset+var_used] - push eax - mov eax, [esi] - call [eax+0x80] ; zCArchive->ReadBool - addStack 4 - verifyStackoffset g1g2(0x110,0x110,0x158,0x15C) - 0x4 - jmp .back - -.backCorrect: - mov [esp+stackoffset+var_used], ecx ; Nothing to fix, continue as expected - jmp .back - -.backOriginal: - mov eax, [esi] ; Re-write original instruction - call [eax+0x80] ; zCArchive->ReadBool - addStack 4 - -.back: - jmp g1g2(0x6A3DD9,0x6D67BB,0x6E96C1,0x748161) + 6 - - global ninja_injectInfo ninja_injectInfo: resetStackoffset ; 0xBC diff --git a/src/hook_recoverInvalidItem2.asm b/src/hook_recoverInvalidItem2.asm deleted file mode 100644 index ba268fe..0000000 --- a/src/hook_recoverInvalidItem2.asm +++ /dev/null @@ -1,19 +0,0 @@ -; Hook oCNpc::Unarchive to recover the archiver's cursor on previously invalid items - -%include "inc/macros.inc" -%include "inc/symbols.inc" - -%ifidn __OUTPUT_FORMAT__, bin - org g1g2(0x6A3DD9,0x6D67BB,0x6E96C1,0x748161) -%endif - -bits 32 - - -section .text align=1 ; Prevent auto-alignment - - jmp recoverInvalidItem2 - nop - - ; Overwrites - ; call [ebx+0x80] diff --git a/verifySize.bat b/verifySize.bat index e34024b..3803dd0 100644 --- a/verifySize.bat +++ b/verifySize.bat @@ -24,7 +24,7 @@ SET filename=%~nx1 IF NOT EXIST %filefull% ECHO File '%filefull%' not found.&& EXIT /B 1 :: Set size limits in bytes corresponding to the available address range -IF %gothic% == 1 SET SIZELIMIT=11340 +IF %gothic% == 1 SET SIZELIMIT=11280 IF %gothic% == 112 SET SIZELIMIT=12096 IF %gothic% == 130 SET SIZELIMIT=11895 IF %gothic% == 2 SET SIZELIMIT=11904