HookApi on the latest Windows Server 2019
Posted: Tue Nov 02, 2021 11:27 am
H madshi.
After a recent update on Windows 2019, the application crashes with the following call stack.
It worked perfectly for years before on all OS including Win2019. This problem appears on Win2019 only.
Note: the application tries to hook API in the same process (no hooking DLLs and drivers).
005387c9 +031 app.exe madCodeHook cmpxchg8b
0053880a +02e app.exe madCodeHook AtomicMove
0053f1de +456 app.exe madCodeHook HookLoadLibrary
0053f769 +2fd app.exe madCodeHook HookCodeX_
0053fad3 +06f app.exe madCodeHook HookCodeX
0054001c +0f8 app.exe madCodeHook HookAPI
00544262 +01e app.exe unit1 282 + 2 InstallHooks
procedure InstallHooks;
begin
madCodeHook.CollectHooks;
HookAPI('User32.dll', 'DispatchMessageA', @hookDispatchMessageA, @nextDispatchMessageA);
HookAPI('User32.dll', 'DispatchMessageW', @hookDispatchMessageW, @nextDispatchMessageW);
madCodeHook.FlushHooks;
end;
After a recent update on Windows 2019, the application crashes with the following call stack.
It worked perfectly for years before on all OS including Win2019. This problem appears on Win2019 only.
Note: the application tries to hook API in the same process (no hooking DLLs and drivers).
005387c9 +031 app.exe madCodeHook cmpxchg8b
0053880a +02e app.exe madCodeHook AtomicMove
0053f1de +456 app.exe madCodeHook HookLoadLibrary
0053f769 +2fd app.exe madCodeHook HookCodeX_
0053fad3 +06f app.exe madCodeHook HookCodeX
0054001c +0f8 app.exe madCodeHook HookAPI
00544262 +01e app.exe unit1 282 + 2 InstallHooks
procedure InstallHooks;
begin
madCodeHook.CollectHooks;
HookAPI('User32.dll', 'DispatchMessageA', @hookDispatchMessageA, @nextDispatchMessageA);
HookAPI('User32.dll', 'DispatchMessageW', @hookDispatchMessageW, @nextDispatchMessageW);
madCodeHook.FlushHooks;
end;