- Joined
- Nov 27, 2019
- Messages
- 144
- Reaction score
- 180
C++:
#include <Windows.h>
#include <MinHook.h>
#include <string>
HANDLE GAME = NULL;
typedef BOOL (WINAPI*CreateProcessW)(LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION);
CreateProcessW CreateProcessW = NULL;
BOOL WINAPI CreateProcessW(LPCWSTR lpApplicationName,LPWSTR lpCommandLine,LPSECURITY_ATTRIBUTES lpProcessAttributes,LPSECURITY_ATTRIBUTES lpThreadAttributes,BOOL bInheritHandles,DWORD dwCreationFlags,LPVOID lpEnvironment,LPCWSTR lpCurrentDirectory,LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) {
BOOL CreateProcessW(lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation);
if (std::wstring(lpApplicationName).find(L"Apex") != std::wstring::npos) {
GAME = lpProcessInformation->hProcess;
for (;;) {
Sleep(1000);
}
}
return
}
DWORD WINAPI (LPVOID) {
MH_Initialize();
MH_CreateHook(CreateProcessW, (LPVOID)&CreateProcessW, (LPVOID*)CreateProcessW);
MH_EnableHook(CreateProcessW);
while (GAME == NULL) {
Sleep(250);
}
// Apex
for(;;) {
Sleep(500);
long BASE = NULL;
ReadProcessMemory(GAME, (LPCVOID)0x7ff75fb80000, &BASE, sizeof BASE, NULL);
printf("r5apex base value> %d\n", BASE);
}
}
BOOL WINAPI DllMain(HINSTANCE, DWORD REASON, LPVOID) {
if ( REASON == DLL_PROCESS_ATTACH ) {
AllocConsole();
FILE* F = NULL;
freopen_s(&F, "CONOUT$", "w", stdout);
CreateThread(NULL , NULL, NULL, NULL, NULL);
}
return TRUE;
}