I'm stuck in the process of making a memory searcher
(Yes I do realize this is my 3rd thread in 2 days..., who cares?)
Code:
#include <windows.h>
MEMORY_BASIC_INFORMATION* pMBI;
int main(){
while(1){
if(GetAsyncKeyState(VK_HOME)){
DWORD* address = (DWORD *)0x00068778;
//char* buffer = "Node7Priority";
char* buffer1 = "checkhate2";
if ( VirtualQuery((void *)address, pMBI, strlen(buffer1)) == 0 ){
MessageBoxA(NULL, (LPCSTR) GetLastError(), "SCHiM - ERROR", NULL);
}
if(pMBI->Protect == PAGE_EXECUTE_READWRITE && pMBI->State == 0x10000 || 0x1000){
if( strcmp(buffer1, (char *)address ) == 0){
MessageBoxA(NULL, "Equal", "SCHiM", NULL);
MessageBoxA(NULL, (LPCSTR)address, "SCHiM", NULL);
} else {
MessageBoxA(NULL, "Not equal", "SCHiM", NULL);
MessageBoxA(NULL, (LPCSTR)address, "SCHiM", NULL);
}
} else {
MessageBoxA(NULL, "Memory is protected", "SCHiM", NULL);
}
}
Sleep(100);
}
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)main, NULL, NULL, NULL);
}
return TRUE;
}
Once I press 'home' with this injector my game disconnects
The reason I think it has something to do with the memory I'm trying to access is because I'm able to access other addresses ( 0x10868778 works flawlessly)
Does anyone spot any faults, or is my code detected?
-SCHiM