Farproc and pyvm is 32 bit (#20260)

This commit is contained in:
pancake 2022-06-09 17:37:06 +02:00 committed by GitHub
parent 709826488f
commit 8966c99ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
#include "libbochs.h"
static char *lpTmpBuffer; //[0x2800u];
static R_TH_LOCAL char *lpTmpBuffer = NULL;
#define SIZE_BUF 0x5800 * 2
@ -10,7 +10,7 @@ static char *lpTmpBuffer; //[0x2800u];
#ifdef _MSC_VER
#pragma comment(lib, "user32.lib")
#endif
int RunRemoteThread_(libbochs_t* b, const ut8 *lpBuffer, ut32 dwSize, int a4, ut32 *lpExitCode) {
static int RunRemoteThread_(libbochs_t* b, const ut8 *lpBuffer, ut32 dwSize, int a4, ut32 *lpExitCode) {
LPVOID pProcessMemory;
HANDLE hInjectThread = NULL;
int result = 0;
@ -60,7 +60,7 @@ bool bochs_cmd_stop(libbochs_t * b) {
};
hKernel = GetModuleHandle (TEXT ("kernel32"));
FARPROC apiOffset = (FARPROC)GetProcAddress (hKernel, "GenerateConsoleCtrlEvent");
*((DWORD *)&buffer[20]) = apiOffset;
*((DWORD *)&buffer[20]) = (DWORD)apiOffset;
ExitCode = RunRemoteThread_(b, (const ut8*)&buffer, 0x1Eu, 0, &ExitCode) && ExitCode;
return ExitCode;
#else