Results 1 to 2 of 2
  1. #1
    mw2tuber's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Location
    Canada
    Posts
    137
    Reputation
    10
    Thanks
    692

    Minimap memory hack

    Dear timiostimio or any other user, this is a hack for BF2 1.50 Using the radar.


     
    #include <Windows.h>

    typedef void( __stdcall* RenderScreen_t )( void* a, void* b, void* c );
    class CRenderer* g_pRenderer = NULL;
    RenderScreen_t pRenderScreen = NULL;
    DWORD dwRendBase = NULL;

    BOOL iWrite ( DWORD Address, void* Data, DWORD Length )
    {
    DWORD Old = 0;
    VirtualProtect( ( void* )( Address ), Length, PAGE_EXECUTE_READWRITE, &Old);
    memcpy( ( void* )Address, Data, Length );
    VirtualProtect( ( void* )( Address ), Length, Old, &Old);
    return 0;
    }

    DWORD HookVTable ( PDWORD Class, DWORD function, int index )
    {
    DWORD oldRights, newRights, oldAddress;
    if ( !IsBadReadPtr( Class, 4 ) )
    {
    DWORD* functionAddress = (DWORD*) ( (PDWORD) ( *Class + ( index * 4 ) ) );
    if ( *functionAddress != function )
    {
    if (VirtualProtectEx(GetCurrentProcess(), functionAddress, 4, PAGE_EXECUTE_READWRITE, &oldRights))
    {
    oldAddress = *functionAddress;
    *functionAddress = (DWORD) function;
    }
    VirtualProtectEx(GetCurrentProcess(), functionAddress, 4, oldRights, &newRights);
    }
    }
    return oldAddress;
    }

    void stuffon(){
    iWrite( 0x7786FF, (PBYTE)"\x90\x90", 2 );//mm1 / 1
    iWrite( 0x7787DB, (PBYTE)"\x90\x90", 2 );//mm2 / 4
    iWrite( 0x7836F9, (PBYTE)"\x90\x90", 2 );//mm3 / 8
    //iWrite( 0x468CBE, (PBYTE)"\x90\x90", 2 );//Unlocks1
    //iWrite( 0x5028C5, (PBYTE)"\x90\x90", 2 );//Unlocks2
    iWrite( 0x78B29E, (PBYTE)"\x90\x90\x90\x90\x90\x90", 6 );//tv static
    }
    void stuffoff(){
    iWrite( 0x7786FF, (PBYTE)"\x75\x0C", 2 );//mm1
    iWrite( 0x7787DB, (PBYTE)"\x75\x09", 2 );//mm2
    iWrite( 0x7836F9, (PBYTE)"\x75\x06", 2 );//mm3
    //iWrite( 0x468CBE, (PBYTE)"\x74\x07", 2 );//Unlocks1
    //iWrite( 0x5028C5, (PBYTE)"\x7C\x14", 2 );//Unlocks2
    iWrite( 0x78B29E, (PBYTE)"\x8B\x92\xA0\x00\x00\x00", 6 );//tv static
    }

    void __stdcall hkRenderScreen( void* a, void* b, void* c )
    {
    _asm pushad;
    stuffon();
    __asm{
    popad;
    push c;
    push b;
    push a;
    call pRenderScreen;
    pushad;
    }
    stuffoff();
    _asm popad;
    }

    DWORD WINAPI RendHook(LPVOID)
    {
    while(dwRendBase == 0) dwRendBase = (DWORD)GetModuleHandleA("RendDX9.dll");
    DWORD OffRend = dwRendBase+0x23D098;
    CRenderer *g_pRenderer = *(CRenderer**)OffRend;
    if(g_pRenderer)
    {
    pRenderScreen = ( RenderScreen_t )HookVTable((PDWORD)g_pRenderer,( DWORD )hkRenderScreen, 10 );
    }
    return 0;
    }

    BOOL WINAPI DllMain (HINSTANCE hModule, DWORD dwReason, LPVOID lpvReserved)
    {
    if (dwReason == DLL_PROCESS_ATTACH)
    {CreateThread(0,0,RendHook,0,0,0);}
    return -1;
    }
    500 Thanks:
    100 Posts:

    Repping Canada, Ontario >>

  2. #2
    timiostimio's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    Germany
    Posts
    442
    Reputation
    10
    Thanks
    4,780
    My Mood
    Cold
    Yooo! Thank you for sharing this code. =)



Similar Threads

  1. Source code for any d3d/memory hack
    By Ragehax in forum C++/C Programming
    Replies: 6
    Last Post: 10-01-2009, 09:10 PM
  2. Wats possible and not possible through memory hacking?
    By ClanTag in forum C++/C Programming
    Replies: 13
    Last Post: 07-13-2009, 06:48 PM
  3. where can i find memory hacking software?
    By headsup in forum General Hacking
    Replies: 4
    Last Post: 06-22-2009, 09:57 AM
  4. Memory Hacking (the ones that works/doesn't work)
    By Kuro Tenshi in forum Combat Arms Europe Hacks
    Replies: 2
    Last Post: 04-12-2009, 02:36 AM
  5. Memory Hacking Software (MHS)
    By ElmoCA in forum Combat Arms Hacks & Cheats
    Replies: 5
    Last Post: 02-04-2009, 05:56 PM

Tags for this Thread