mirror of
https://gitea.tendokyu.moe/TeamTofuShop/capnhook.git
synced 2026-09-22 22:38:12 +03:00
hook/process.c: Fix 64-bit startup hijack
Start address goes in RCX in 64-bit mode, EAX in 32-bit mode.
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@ static bool thread_match_startup(
|
||||
{
|
||||
#ifdef __amd64
|
||||
return ctx->Rip == (DWORD64) ntstart &&
|
||||
ctx->Rax == (DWORD64) exe_entry;
|
||||
ctx->Rcx == (DWORD64) exe_entry;
|
||||
#else
|
||||
return ctx->Eip == (DWORD) ntstart &&
|
||||
ctx->Eax == (DWORD) exe_entry;
|
||||
@@ -29,8 +29,8 @@ static void thread_patch_startup(
|
||||
CONTEXT *ctx)
|
||||
{
|
||||
#ifdef __amd64
|
||||
*orig_entry = (void *) ctx->Rax;
|
||||
ctx->Rax = (DWORD64) new_entry;
|
||||
*orig_entry = (void *) ctx->Rcx;
|
||||
ctx->Rcx = (DWORD64) new_entry;
|
||||
#else
|
||||
*orig_entry = (void *) ctx->Eax;
|
||||
ctx->Eax = (DWORD) new_entry;
|
||||
|
||||
Reference in New Issue
Block a user