Join Date: Jun 2009
Posts: 6
|
Hi,
ich habe hier mal einen kleinen Source ...
Sobald der Name des feindlichen Spielers erscheint schießt ihr automatisch. Ich habe es unter Windows XP getestet.
TEXT Code: #include <iostream> #include <windows.h> #include <Tlhelp32.h> #define ON_ENEMY 2 using namespace std; HANDLE GetGameHandle ( HWND hWindow ); DWORD GetClientBase ( HWND hWindow ); HWND GetGameHwnd (); int main() { short sCrosshair = 0; short sShoot = 1280; short sNoShoot = 1024; HWND hWindow = GetGameHwnd(); HANDLE hGame = GetGameHandle(hWindow); if (!hGame) { cout << "GetGameHandle failed" << endl; return -1; } DWORD dwClientBase = GetClientBase(hWindow); if ( dwClientBase == 0x00 ) { cout << "GetClientBase failed" << endl; return -1; } DWORD dwShoot = dwClientBase + 0x12CF5F; DWORD dwOnEnemy = dwClientBase + 0x1211F8; while ( !GetAsyncKeyState (VK_F12) & 1 ) { ReadProcessMemory ( hGame, (void*)(dwOnEnemy), &sCrosshair, sizeof(sCrosshair), NULL ); if ( sCrosshair == ON_ENEMY ) { WriteProcessMemory ( hGame, (void*)(dwShoot), &sShoot, sizeof(sShoot), NULL ); Sleep (20); WriteProcessMemory ( hGame, (void*)(dwShoot), &sNoShoot, sizeof(sNoShoot), NULL ); Sleep (420); } Sleep (10); } return 0; } HWND GetGameHwnd () { HWND hWindow = NULL; while ( !hWindow ) { hWindow = FindWindow ( NULL, "Counter-Strike" ); Sleep (500); cout << "looking for counter-strike ..." << endl; } cout << "counter-strike found" << endl; return hWindow; } HANDLE GetGameHandle ( HWND hWindow ) { HANDLE hGame = NULL; DWORD dwPid; GetWindowThreadProcessId ( hWindow, &dwPid ); hGame = OpenProcess ( PROCESS_ALL_ACCESS, false, dwPid ); if ( hGame ) return hGame; else return NULL; } DWORD GetClientBase ( HWND hWindow ) { HANDLE hSnap = NULL; MODULEENTRY32 m32; DWORD dwPid; GetWindowThreadProcessId ( hWindow, &dwPid ); m32.dwSize = sizeof (MODULEENTRY32); hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPid ); if ( hSnap == INVALID_HANDLE_VALUE ) { cout << "CreateToolhelp32Snapshot failed" << endl; CloseHandle (hSnap); return 0x00; } if ( Module32First ( hSnap, &m32 ) ) { while ( Module32Next ( hSnap, &m32 ) ) { if ( !strcmp ( m32.szModule , "client.dll" ) ) { cout << "client base found" << endl; CloseHandle (hSnap); return (DWORD)(m32.modBaseAddr); } } } else { cout << "Module32First failed" << endl; }; CloseHandle (hSnap); return 0x00; }
Vielleicht kann ja jemand was damit anfangen.
Sollte es Probleme geben, versucht es mal mit:
TEXT Code: if ( sCrosshair > 1 )
MfG
nookstar
|