Results 1 to 5 of 5
  1. #1
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    114
    My Mood
    Twisted

    [HELP] Why does this fail?

    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

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky
    Probably too low addy(protected range)
    Ah we-a blaze the fyah, make it bun dem!

  3. #3
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    114
    My Mood
    Twisted
    Quote Originally Posted by Hell_Demon View Post
    Probably too low addy(protected range)
    But why doesn't Virutalquery warn me about it?

    That's not it
    With virual querry it fails on: 0x10868778, and without it doesn't fail on that address

    Am I doing something wrong?
    Last edited by schim; 07-19-2010 at 06:47 AM.

  4. #4
    inmate's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Bottrop, NRW, Germany
    Posts
    131
    Reputation
    10
    Thanks
    194
    My Mood
    Amazed
    Try:

    Code:
    if(!strcmp(buffer1, (char *)address )){
    because for few weeks i had a problem with strcmp, i have wrote it like you and everytime my windows is crashed ( bluescreen ). Maybe thats your error, too ?

    Regards

  5. #5
    schim's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My chair
    Posts
    367
    Reputation
    10
    Thanks
    114
    My Mood
    Twisted
    Quote Originally Posted by inmate View Post
    Try:

    Code:
    if(!strcmp(buffer1, (char *)address )){
    because for few weeks i had a problem with strcmp, i have wrote it like you and everytime my windows is crashed ( bluescreen ). Maybe thats your error, too ?

    Regards
    I don't think that is the problem because my code works fine without virtual querry, but I don't want to put it away since I'm planning on scanning the whole program's memory so I'll have to know if I can access the address

    But virtualquerry isn't working

Similar Threads

  1. Why does nexon fail?
    By CRUSTY in forum Combat Arms Discussions
    Replies: 23
    Last Post: 12-12-2009, 01:16 AM
  2. why does this happen !!
    By jokers in forum Combat Arms Hacks & Cheats
    Replies: 3
    Last Post: 01-17-2009, 09:34 PM
  3. [Help] What does this mean?
    By ahlun89 in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 10-23-2008, 05:22 PM
  4. Why does this site run so god damn slow?
    By shazbork in forum Flaming & Rage
    Replies: 24
    Last Post: 09-13-2008, 10:49 PM
  5. Need Help, Why Is This Detected?
    By Jammy122333 in forum Visual Basic Programming
    Replies: 10
    Last Post: 01-02-2008, 01:46 AM