diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index 9b2cfa9..d423d5f 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -785,8 +785,8 @@ void Patch_III_Common() auto hookPoint = pattern( "83 E4 F8 89 44 24 08 C7 44 24 0C 00 00 00 00 DF 6C 24 08" ).get_one(); auto jmpPoint = get_pattern( "DD D8 E9 37 FF FF FF DD D8" ); - InjectHook( hookPoint.get( 0x21 ), CTimer::Update_SilentPatch, PATCH_CALL ); - InjectHook( hookPoint.get( 0x21 + 5 ), jmpPoint, PATCH_JUMP ); + InjectHook( hookPoint.get( 0x21 ), CTimer::Update_SilentPatch, PATCH_CALL ); + InjectHook( hookPoint.get( 0x21 + 5 ), jmpPoint, PATCH_JUMP ); } // Remove FILE_FLAG_NO_BUFFERING from CdStreams @@ -794,6 +794,16 @@ void Patch_III_Common() auto addr = get_pattern( "81 7C 24 04 00 08 00 00", 0x12 ); Patch( addr, 0xEB ); } + + // Alt+F4 + { + auto addr = pattern( "59 59 31 C0 83 C4 48 5D 5F 5E 5B C2 10 00" ).count(2); + auto dest = get_pattern( "53 55 56 FF 74 24 68 FF 15" ); + + addr.for_each_result( [&]( pattern_match match ) { + InjectHook( match.get( 2 ), dest, PATCH_JUMP ); + }); + } } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index ecfa204..6b24368 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -605,8 +605,8 @@ void Patch_VC_Common() auto hookPoint = pattern( "83 E4 F8 89 44 24 08 C7 44 24 0C 00 00 00 00 DF 6C 24 08" ).get_one(); auto jmpPoint = get_pattern( "DD D8 E9 31 FF FF FF" ); - InjectHook( hookPoint.get( 0x21 ), CTimer::Update_SilentPatch, PATCH_CALL ); - InjectHook( hookPoint.get( 0x21 + 5 ), jmpPoint, PATCH_JUMP ); + InjectHook( hookPoint.get( 0x21 ), CTimer::Update_SilentPatch, PATCH_CALL ); + InjectHook( hookPoint.get( 0x21 + 5 ), jmpPoint, PATCH_JUMP ); } // Remove FILE_FLAG_NO_BUFFERING from CdStreams @@ -614,6 +614,16 @@ void Patch_VC_Common() auto addr = get_pattern( "81 7C 24 04 00 08 00 00", 0x12 ); Patch( addr, 0xEB ); } + + // Alt+F4 + { + auto addr = pattern( "59 59 31 C0 83 C4 70 5D 5F 5E 5B C2 10 00" ).count(2); + auto dest = get_pattern( "53 55 56 FF B4 24 90 00 00 00 FF 15" ); + + addr.for_each_result( [&]( pattern_match match ) { + InjectHook( match.get( 2 ), dest, PATCH_JUMP ); + }); + } } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)