Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma warning(disable:4996)
- #include <windows.h>
- #include <psapi.h>
- #include <stdio.h>
- #include <TlHelp32.h>
- #include <vector>
- #include <stdlib.h>
- #include <string>
- #include <thread>
- using namespace std;
- DWORD GetProcessByName(char* name)
- {
- DWORD pid = 0;
- HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- PROCESSENTRY32 process;
- ZeroMemory(&process, sizeof(process));
- process.dwSize = sizeof(process);
- if (Process32First(snapshot, &process))
- {
- do
- {
- if (strstr(process.szExeFile, name) != NULL)
- {
- pid = process.th32ProcessID;
- break;
- }
- } while (Process32Next(snapshot, &process));
- }
- CloseHandle(snapshot);
- if (pid != 0)
- {
- return pid;
- }
- return NULL;
- }
- int main()
- {
- __int64 hash, result;
- printf("enter Native Hash\n");
- scanf("%llx", &hash);
- INT Address = 0x00000000;
- INT i, p;
- CHAR *MemoryBuff = new CHAR[4096];
- DWORD PPID = GetProcessByName("GTA5");
- HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PPID);
- for (i = 0; i < 0x9FFF9840; i++)
- {
- ReadProcessMemory(hProcess, (LPVOID)Address, (LPVOID)MemoryBuff, 4096, NULL);
- for (p = 0; p < 4096; p++)
- {
- Address++;
- MemoryBuff++;
- if (memcmp(MemoryBuff, &hash, sizeof(hash)) ==0)
- {
- ReadProcessMemory(hProcess, (LPVOID)(Address - 0x40), &result, sizeof(result), 0);
- printf("result:%llX\n", result);
- exit(0);
- }
- }
- MemoryBuff = MemoryBuff - 4096;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment