Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <Windows.h>
- #include <iostream>
- #define num0 0x60
- #define F6 0x75
- DWORD pid = 0;
- DWORD buffer = 0;
- DWORD localHealth = 0;
- const DWORD localHealthBase = 0x01295540;
- const DWORD localHealthOffset1 = 0x24;
- const DWORD localHealthOffset2 = 0x10;
- const DWORD localHealthOffset3 = 0x500;
- const DWORD localHealthOffset4 = 0x6A0;
- const DWORD localHealthOffset5 = 0x2B0;
- -snip-
- int main()
- {
- int i = 0;
- HWND hWnd = FindWindowA(0, ("7 Days To Die"));
- GetWindowThreadProcessId(hWnd, &pid);
- HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
- std::cout << "Process ID: " << pid << std::endl; //outputs correct PID
- std::cout << localHealthBase << std::endl; //outputs correct Base Address
- ReadProcessMemory(pHandle,(void*)localHealthBase,&localHealth,sizeof(localHealth),NULL);
- //^^^I've tried with LPCVOID, LPCVOID*, and PBYTE* to no avail
- std::cout << localHealth << std::endl; //outputs 0
- -snip-
- VS Output: (Though program does compile and run properly until ReadProcessMemory)
- -snip- *correct loading*
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-timezone-l1-1-0.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l2-1-0.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-localization-l1-2-0.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-synch-l1-2-0.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-processthreads-l1-1-1.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\api-ms-win-core-file-l1-2-0.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
- '7Days.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement