Hi,
I have this code
Code:
#include <Windows.h>#include <iostream>#include <tlhelp32.h>#include <stdio.h>using namespace std;DWORD GetProcessId(const TCHAR* lpProcessName){ DWORD dwProcessId = 0; PROCESSENTRY32 entry; entry.dwSize = sizeof(PROCESSENTRY32); HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); if (snapshot != INVALID_HANDLE_VALUE) { if (Process32First(snapshot, &entry)) { do { if (_wcsicmp(entry.szExeFile, lpProcessName) == 0) { dwProcessId = entry.th32ProcessID; break; } } while (Process32Next(snapshot, &entry)); } CloseHandle(snapshot); } return dwProcessId;}void suspend(DWORD processId){ HANDLE hThreadSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0); THREADENTRY32 threadEntry; threadEntry.dwSize = sizeof(THREADENTRY32); if (hThreadSnapshot != INVALID_HANDLE_VALUE) { if (Thread32First(hThreadSnapshot, &threadEntry)) { do { if (threadEntry.th32OwnerProcessID == processId) { HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, FALSE, threadEntry.th32ThreadID); if (hThread) { SuspendThread(hThread); CloseHandle(hThread); } } } while (Thread32Next(hThreadSnapshot, &threadEntry)); } CloseHandle(hThreadSnapshot); }}int main(int argc, TCHAR* argv[]){ SetConsoleTitle(TEXT("Xigncode3 Bypass")); cout << "Searching for KO" << endl; DWORD dwProcessId; while (!(dwProcessId = GetProcessId(TEXT("KnightOnline.exe"))))/ Sleep(1); cout << "Weve found KO" << endl; HANDLE hProcess = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, dwProcessId); if (hProcess) { cout << "Trying to get in..." << endl; const DWORD dwLocationOfFunction = 0x429570; (This is the old Xigncode3 address, and you'll need to find the new one) BYTE FirstByte; DWORD dwOldProtection; while (!ReadProcessMemory(hProcess, (LPVOID)dwLocationOfFunction, &FirstByte, sizeof(FirstByte), NULL) || FirstByte != 0x55) { if (GetLastError() == ERROR_ACCESS_DENIED) cout << "ERROR_ACCESS_DENIED" << endl; Sleep(1); } cout << "Killing Xigncode3" << endl; const BYTE ByteToWrite = 0xC3; BOOL bSuccess = VirtualProtectEx(hProcess, (LPVOID)dwLocationOfFunction, sizeof(FirstByte), PAGE_EXECUTE_READWRITE, &dwOldProtection); if (bSuccess) bSuccess = WriteProcessMemory(hProcess, (LPVOID)dwLocationOfFunction, &ByteToWrite, sizeof(ByteToWrite), NULL); CloseHandle(hProcess); if (bSuccess) cout << "Bypassed by MPGH Riddick Haxor" << endl; } cin.get(); return 0;}
credits to Riddick, how can I find this : (LPVOID)dwLocationOfFunction and a second request how to inject any tutorial on how it is working (injection) for hacking online games.
Thank you