diff --git a/libr/cons/cons.c b/libr/cons/cons.c index 4c06714cd7..7aa64f9184 100644 --- a/libr/cons/cons.c +++ b/libr/cons/cons.c @@ -772,13 +772,12 @@ R_API void r_cons_print_clear(void) { } R_API void r_cons_fill_line(void) { - char *p, white[1024]; + char white[1024]; int cols = I->columns - 1; if (cols < 1) { return; } - p = (cols >= sizeof (white)) - ? malloc (cols + 1): white; + char *p = (cols >= sizeof (white))? malloc (cols + 1): white; if (p) { memset (p, ' ', cols); p[cols] = 0; diff --git a/shlr/bochs/src/libbochs.c b/shlr/bochs/src/libbochs.c index 8cb84700cf..209824813d 100644 --- a/shlr/bochs/src/libbochs.c +++ b/shlr/bochs/src/libbochs.c @@ -60,8 +60,13 @@ bool bochs_cmd_stop(libbochs_t * b) { }; hKernel = GetModuleHandle (TEXT ("kernel32")); FARPROC apiOffset = (FARPROC)GetProcAddress (hKernel, "GenerateConsoleCtrlEvent"); - *((DWORD *)&buffer[20]) = (DWORD *)(size_t)apiOffset; // XXX - ExitCode = RunRemoteThread_(b, (const ut8*)&buffer, 0x1Eu, 0, &ExitCode) && ExitCode; +#if sizeof(DWORD) == 4 + *((DWORD *)&buffer[20]) = (DWORD)(size_t)apiOffset; +#else +#warning this bochs shellcode is 32bit only + *((DWORD *)&buffer[20]) = 0; +#endif + ExitCode = RunRemoteThread_ (b, (const ut8*)&buffer, 0x1Eu, 0, &ExitCode) && ExitCode; return ExitCode; #else return 0;