I applaud the sharing of the source but ill give some points to clean up the code a bit and make it more modern:
Code:
#define MODULE_NAME L"Neuz.exe"
should be
Code:
const wchar_t module_name[] = L"Neuz.exe";
Code:
BOOLEAN bHackRunning = TRUE;
void MySleep(double d_delay);
DWORD dwMainWinThread, dwBowHackThread;
HANDLE hBowHack, hMainWin;
HMODULE g_hModule;
HWND g_hWnd;
BOOLEAN bowAlwaysStrongAttack;
bool AlreadyHooked = false;
ULONG_PTR gRWXBuf = NULL;
ULONG_PTR gSendActMsgOrig = NULL;
ULONG_PTR gStrongBowEnabled = NULL;
you are using both g and g_ prefixes while either are them are fine but why not be consistent,also if you are not using them out of the scope(cpp file) you should prefix them with "static".
Code:
hMainWin = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&MainWin, g_hModule, NULL, &dwMainWinThread);
// Bow hack thread
hBowHack = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&thBowHack, NULL, NULL, &dwBowHackThread);
calling CreateThread directly is a bad practice better use _beginthread or even much better std::thread.
Code:
WaitForSingleObject(hBowHack, INFINITE);
could be easly replaced with thread::join.
Code:
void LogErrorMessageA(const char* pszFormat, ...) {
static char s_acBuf[2048]; // this here is a caveat!
va_list args;
va_start(args, pszFormat);
vsprintf(s_acBuf, pszFormat, args);
OutputDebugStringA(s_acBuf);
va_end(args);
MessageBoxA(g_hWnd, s_acBuf, "Error", MB_ICONERROR);
}
use stream buffers no real need for va args here same with the other functions.
Code:
char sig[] = "\x5E\x85\xC0\x74\x17\x50\xA1\x00\x00\x00\x00\x8B\x88\x00\x03\x00\x00\x51\xB9";
char mask[] = "xxxxxxx????xx?xxxxx";
static const should be used here and in FindActionMoverOffset().
Code:
/*
Replace Sleep(ms) function
*/
void MySleep(double d_delay)
{
DWORD start = GetTickCount();
DWORD control = GetTickCount();
while (control < (start + d_delay)) {
control = GetTickCount();
}
}
WHY?
not sure why you would use that over Sleep but even as is it is written badly
Code:
void MySleep(const DWORD dwDelay)
{
const DWORD dwStart = GetTickCount();
DWORD dwControl = dwStart ;
while ((dwControl - dwStart) < dwDelay ) {
dwControl = GetTickCount();
}
}
The shell code itself is really not needed just use a standard _thiscall with a tiny __asm block of whatever you have to recover from the stack, then you would not need that horrific executable page code.