Hi all. This code section is far less active since BFBC2...
Anyway, I am back to work on the aimbot part where
xZetera left it.
Here's my contribution, MouseMove() was for fullscreen. If you're playing with the BoxESP in windowed mode, you'll need this modified version:
Code:
void MouseMove(float delta_x, float delta_y)
{
double fScreenWidth = ::GetSystemMetrics(SM_CXSCREEN)-1;
double fScreenHeight = ::GetSystemMetrics(SM_CYSCREEN)-1;
double dx = 65535.0f / fScreenWidth;
double dy = 65535.0f / fScreenHeight;
double fx = (wndpos[0] + mouse_center[0] + delta_x) * dx;
double fy = (wndpos[1] + mouse_center[1] + delta_y) * dy;
INPUT input;
memset(&input, 0, sizeof(input));
input.type = INPUT_MOUSE;
input.mi.dwFlags = MOUSEEVENTF_MOVE|MOUSEEVENTF_ABSOLUTE;
input.mi.dx = (long) fx;
input.mi.dy = (long) fy;
::SendInput(1,&input,sizeof(input));
} Where globals are declared this way:
Code:
int resolution[2];
int screencenter[2];
int mouse_center[2];
And initialized:
Code:
GetClientRect(mw2_hwnd, &client_rect);
resolution[0] = client_rect.right;
resolution[1] = client_rect.bottom;
screencenter[0] = resolution[0]/2;
screencenter[1] = resolution[1]/2;
RECT bounding_rect;
GetWindowRect(mw2_hwnd,&bounding_rect);
mouse_center[0] = (bounding_rect.right - bounding_rect.left) / 2;
mouse_center[1] = (bounding_rect.bottom - bounding_rect.top) / 2;
Stay tuned for the real aimbot part.