Results 1 to 3 of 3
  1. #1
    iosonoperché's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    http://nrclanmw3,enjin,com
    Posts
    25
    Reputation
    10
    Thanks
    57

    [C++] GetAsyncKeyState. <DLL>

    Can anyone help me with this?
    I want to F1 you have that particular value.

    The Code :

    Code:
    #include <Windows.h>
    
    #define ADR_HP ADDRESS
    
    void WriteMemory(DWORD address, DWORD value)
    {
        DWORD dwOldProt;
        VirtualProtect((LPVOID)address, 4, PAGE_READWRITE, &dwOldProt);
        *(DWORD *)address = value;
        VirtualProtect((LPVOID)address, 4, dwOldProt, &dwOldProt);
    }
    
    int __stdcall DllMain(HMODULE hModule, DWORD  dwReasons, LPVOID lpReserved)
    {
        if(GetAsyncKeyState(VK_F1))
    	{
    		WriteMemory(ADR_HP, 0);
    	}
    }
    Last edited by Lovroman; 08-24-2014 at 01:35 AM.

  2. #2
    Fєηix's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Location
    Brαzil
    Posts
    1,124
    Reputation
    114
    Thanks
    6,645
    My Mood
    Sleepy
    Ex:

    Code:
    #include <Windows.h>
    #include <process.h>
    
    //Variables
    INT Hack[100];
    
    //Address
    #define ADR_HP 0x000000
    #define ADR_Ammo 0x000000
    
    VOID WriteMemory(DWORD Address, DWORD Value)
    {
        DWORD dwOldProt;
        VirtualProtect((LPVOID)Address, 4, PAGE_READWRITE, &dwOldProt);
        *(DWORD *)Address = Value;
        VirtualProtect((LPVOID)Address, 4, dwOldProt, &dwOldProt);
    }
    
    VOID Cheats()
    {
    
      if(GetAsyncKeyState(VK_F1)&1) Hack[0] =! Hack[0];	
      if(GetAsyncKeyState(VK_F2)&1) Hack[1] =! Hack[1];	
    
       if(Hack[0])
       {
    	   WriteMemory(ADR_HP, 100);
       }
    
       if(Hack[1])
       {
    	   WriteMemory(ADR_Ammo, 999);
       }
    
    }
    
    UINT WINAPI Main(VOID *)
    {
    	while(!(DWORD)GetModuleHandleA("GameProcess.exe"))
    		Sleep(100);
    
    	__asm
    	{
          CALL [Cheats]
    	}
    
    	return FALSE;
    }
    
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    	DisableThreadLibraryCalls(hModule);
    	if(dwReason == DLL_PROCESS_ATTACH) 
    	{
    		_beginthreadex(NULL, NULL, &Main, NULL, NULL, NULL);
    	}
    	return TRUE;
    }

  3. The Following User Says Thank You to Fєηix For This Useful Post:

    iosonoperché (08-23-2014)

  4. #3
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,719
    My Mood
    Cheerful
    Before you start writing to the memory, you will have to hook a game function or the game module(like Felix showed you in the code he posted above).

Similar Threads

  1. Replies: 8
    Last Post: 12-02-2010, 03:22 AM
  2. Morphine.dll + Injec-Tor + Tutorial
    By Papaya in forum Gunz Hacks
    Replies: 21
    Last Post: 10-20-2010, 06:07 PM
  3. .dll injector
    By EleMentX in forum Gunz General
    Replies: 31
    Last Post: 07-08-2010, 11:44 AM
  4. dll for those who cant even google :P
    By jam in forum Gunz Hacks
    Replies: 5
    Last Post: 06-07-2007, 04:32 AM
  5. DLL injection Failled
    By aynal in forum WarRock - International Hacks
    Replies: 1
    Last Post: 01-15-2006, 10:41 PM