drxxmz How do I cheat?
  Reputation: 0
  Joined: 21 Jan 2025 Posts: 2
 
  | 
		
			
				 Posted: Mon Jan 27, 2025 11:09 am    Post subject: Issues with nexuiz esp... :/ | 
				       | 
			 
			
				
  | 
			 
			
				I know the last comment in under this category is mine but yall are slow as hell and i need to post this somewhere.
 
My code like the other code is formatted correctly it just doesnt work, the view matrix is somehow wrong? despite being a traditional view matrix?
 
ill pay 20usd for any solution or an explanation at this point.
 
 
 	  | Code: | 	 		  
 
#include <iostream>
 
#include <Windows.h>
 
#include <TlHelp32.h>
 
#include <iomanip>
 
#define PI 3.1415927f
 
 
struct Vector2 { float x, y; };
 
struct Vector3 { float x, y, z; };
 
struct Vector4 { float x, y, z, w; };
 
float viewMatrix[4][4];
 
 
DWORD GetProcessId(const char* processName) {
 
    HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
 
    PROCESSENTRY32 processEntry;
 
    processEntry.dwSize = sizeof(PROCESSENTRY32);
 
 
    if (Process32First(snapshot, &processEntry)) {
 
        do {
 
            if (!_stricmp(processEntry.szExeFile, processName)) {
 
                std::cout << "Process found: " << processEntry.szExeFile
 
                    << " (PID: " << processEntry.th32ProcessID << ")" << std::endl;
 
                CloseHandle(snapshot);
 
                return processEntry.th32ProcessID;
 
            }
 
        } while (Process32Next(snapshot, &processEntry));
 
    }
 
 
    std::cerr << "Process not found: " << processName << std::endl;
 
    CloseHandle(snapshot);
 
    return 0;
 
}
 
 
Vector2 WorldToScreen(const Vector3& playerPos, float viewMatrix[4][4], int screenWidth, int screenHeight) {
 
    // Calculate clip coordinates
 
    float clipX = playerPos.x * viewMatrix[0][0] +
 
        playerPos.y * viewMatrix[0][1] +
 
        playerPos.z * viewMatrix[0][2] +
 
        viewMatrix[3][0];
 
 
    float clipY = playerPos.x * viewMatrix[1][0] +
 
        playerPos.y * viewMatrix[1][1] +
 
        playerPos.z * viewMatrix[1][2] +
 
        viewMatrix[3][1];
 
 
    float clipZ = playerPos.x * viewMatrix[2][0] +
 
        playerPos.y * viewMatrix[2][1] +
 
        playerPos.z * viewMatrix[2][2] +
 
        viewMatrix[3][2];
 
 
    float clipW = 1.0f;  // Force to 1
 
 
    // Perspective division
 
    float ndcX = clipX / clipW;
 
    float ndcY = clipY / clipW;
 
 
    // Screen mapping with scaling
 
    float screenX = (ndcX * 0.5f + 0.5f) * screenWidth;
 
    float screenY = (1.0f - ndcY * 0.5f) * screenHeight;
 
 
    return { screenX, screenY };
 
}
 
 
 
void DrawESP(HDC hdc, Vector3 screenPos) {
 
    HPEN pen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
 
    HGDIOBJ oldPen = SelectObject(hdc, pen);
 
 
    Rectangle(hdc,
 
        screenPos.x - 25,
 
        screenPos.y - 25,
 
        screenPos.x + 25,
 
        screenPos.y + 25
 
    );
 
 
    SelectObject(hdc, oldPen);
 
    DeleteObject(pen);
 
}
 
 
int main() {
 
    const char* processName = "nexuiz-sdl.exe";
 
    DWORD processId = GetProcessId(processName);
 
 
    if (!processId) {
 
        std::cerr << "Failed to get process ID" << std::endl;
 
        return 1;
 
    }
 
 
    HANDLE processHandle = OpenProcess(PROCESS_VM_READ, FALSE, processId);
 
    if (!processHandle) {
 
        std::cerr << "Failed to open process. Error: " << GetLastError() << std::endl;
 
        return 1;
 
    }
 
 
    HWND gameWindow = FindWindowA(NULL, "Nexuiz");
 
    if (!gameWindow) {
 
        std::cerr << "Game window not found" << std::endl;
 
        CloseHandle(processHandle);
 
        return 1;
 
    }
 
 
    HDC gameDC = GetDC(gameWindow);
 
    if (!gameDC) {
 
        std::cerr << "Failed to get DC. Error: " << GetLastError() << std::endl;
 
        CloseHandle(processHandle);
 
        return 1;
 
    }
 
 
    DWORD viewMatrixAddress = 0xC7CA50;
 
 
    while (true) {
 
        ReadProcessMemory(processHandle, (LPVOID)0xC6A930, &viewMatrix, sizeof(viewMatrix), NULL);
 
        Vector2 ScreenPos = WorldToScreen({ 100,100,100 }, viewMatrix, 664, 1176);
 
        std::cout << ScreenPos.x << " : " << ScreenPos.y << "\n";
 
        DrawESP(gameDC, { ScreenPos.x, ScreenPos.y, 0 });
 
        Sleep(1);
 
    }
 
 
    ReleaseDC(gameWindow, gameDC);
 
    CloseHandle(processHandle);
 
 
    return 0;
 
}
 
 | 	  
 
youll need to manually fill in the view matrix address and thats it, also check it out while your at it please
 | 
			 
		  |