From 25c5e1ebec962c437d9cb5be38c33dc0923757b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Fratri=C4=87?= Date: Wed, 8 May 2024 09:54:47 +0200 Subject: [PATCH] Fix MS calling conventions --- Windows/debugger.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Windows/debugger.cpp b/Windows/debugger.cpp index 50ed703..336929b 100644 --- a/Windows/debugger.cpp +++ b/Windows/debugger.cpp @@ -1075,13 +1075,13 @@ void Debugger::GetFunctionArguments(uint64_t* arguments, size_t num_args, uint64 case CALLCONV_FASTCALL: if (num_args > 0) arguments[0] = lcContext.Rcx; if (num_args > 1) arguments[1] = lcContext.Rdx; - if (num_args > 3) { + if (num_args > 2) { ReadStack((void*)(sp + child_ptr_size), arguments + 2, num_args - 2); } break; case CALLCONV_THISCALL: if (num_args > 0) arguments[0] = lcContext.Rcx; - if (num_args > 3) { + if (num_args > 1) { ReadStack((void*)(sp + child_ptr_size), arguments + 1, num_args - 1); } break; @@ -1098,13 +1098,13 @@ void Debugger::GetFunctionArguments(uint64_t* arguments, size_t num_args, uint64 case CALLCONV_FASTCALL: if (num_args > 0) arguments[0] = (uint64_t)lcContext.Ecx; if (num_args > 1) arguments[1] = (uint64_t)lcContext.Edx; - if (num_args > 3) { + if (num_args > 2) { ReadStack((void*)(sp + child_ptr_size), arguments + 2, num_args - 2); } break; case CALLCONV_THISCALL: if (num_args > 0) arguments[0] = (uint64_t)lcContext.Ecx; - if (num_args > 3) { + if (num_args > 1) { ReadStack((void*)(sp + child_ptr_size), arguments + 1, num_args - 1); } break;