Results 1 to 4 of 4
  1. #1
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,321
    My Mood
    Doh

    my hack is crashin me

    idk why, its updated (as far as i know...then again, i still suck at C++)

    anyway, it ONLY crashes when i use rapid fire nothin else crashes me (so that weird beast shit isn't it haha, i'm just bored)

    anyway heres my source, yes its ugly, but cry about it

    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <d3dx9.h>
    #pragma comment( lib, "d3dx9.lib" )
    #define Rapid 0x37504115
    #define LTBase 0x378F5D78
    #define LTClient 0x378F5D90
    #define UnwrappedConsole 0x485F60
    #define DrawPrim 0x8024F8
    #define GameStatus 0x37906D28
    #define GameClientShell 0x3793B218
    #define ClientInfo 0x378F4A8C
    #define SuperBullets 0x374FE0B6
    #define Range1 0x37503699
    #define Range2 0x37503A19
    #define NameTag1 0x372DB630
    #define NameTag2 0x372DB6AD
    #define PlayerByIndex 0x37151500
    #define LocalPlayer 0x371520C0
    #define Recoil1 0x37497B00
    #define Recoil2 0x375AAA69
    #define Recoil3 0x37497B14
    #define Recoil4 0x37497B20
    #define Beast 0x3790C995
    
    typedef HRESULT ( WINAPI* oPresent ) ( LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
    oPresent pPresent;
    
    bool IsGameReadyForHook()
    {
    if( GetModuleHandleA( "d3d9.dll"     ) != NULL 
    && GetModuleHandleA( "ClientFX.fxd" ) != NULL 
    && GetModuleHandleA( "CShell.dll"   ) != NULL )
    return true;
    return false;
    }
    void Memoria( void* pvAddress, void* pvBuffer, size_t len )
    {
    if( *(BYTE*)pvAddress == *(BYTE*)pvBuffer )
    return;
    
    memcpy( ( void* )pvAddress, ( void* )pvBuffer, len );
    }
    
    bool bDataCompare(const BYTE* pData, const BYTE* bMask, const char* szMask) 
    { 
        for(;*szMask;++szMask,++pData,++bMask) 
            if(*szMask=='x' && *pData!=*bMask )  
                return false; 
        return (*szMask) == NULL; 
    } 
    
    DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask) 
    { 
        for(DWORD i=0; i < dwLen; i++) 
    if(bDataCompare( (BYTE*)( dwAddress+i ),bMask,szMask) ) 
                return (DWORD)(dwAddress+i); 
         
        return 0; 
    }
    
    // Kef... it's hard name xD
    DWORD VTable(int index)
    {
    DWORD* devicePtr = 0;
    
    DWORD hD3D9 = NULL;
    
    while(hD3D9 == NULL){
    Sleep(100);
    try
    {
    hD3D9 = (DWORD)GetModuleHandleA("d3d9.dll");}
    catch(...)
    {
    hD3D9 = NULL;
    }}
    
    DWORD addy = FindPattern(hD3D9, 0x1280000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx");
    Memoria (&devicePtr, (void*)(addy+2), 4);
    
    if(devicePtr == NULL){
    return 0;}
    
    return devicePtr[index];
    
    }
    void CPush(const char* cmd)
    {
    _asm
    {
    PUSH cmd
    MOV EAX, 0x485F60
    CALL EAX
    ADD ESP, 0x4
    }
    }
    void main() 
    {
    	
    if(GetAsyncKeyState(VK_LBUTTON) & 1 )
    {
    	Memoria((LPVOID) (Rapid), "\x90\x90", 2);
    	
    }else{
    	Memoria((LPVOID) (Rapid), "\x74\x3E", 2);
    }
    if(GetAsyncKeyState(VK_NUMPAD1) & 1 ){
    *(long*)Beast = 4; // Beast mode on
    if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    
    } else {
    if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    		*(long*)Beast = 1;
    }
    if(GetAsyncKeyState(VK_NUMPAD0) & 1){
    	*(long*)Beast = 6; // Beast mode camera fly
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    } else {
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    		*(long*)Beast = 1;
    		
    }
    if(GetAsyncKeyState(VK_NUMPAD2) & 1){
    	*(long*)Beast = 8; // Beast mode camera fly
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    } else {
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    		*(long*)Beast = 1;
    }
    if(GetAsyncKeyState(VK_NUMPAD3) & 1){
    	*(long*)Beast = 10; // Beast mode camera fly
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    } else {
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    		*(long*)Beast = 1;
    }
    if(GetAsyncKeyState(VK_NUMPAD4) & 1){
    	*(long*)Beast = 64; // Beast mode camera fly
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    } else {
    	if (GetAsyncKeyState(VK_DELETE)&1)
    			*(long*)Beast = 2;
    		*(long*)Beast = 1;
    }	
    }
    
    HRESULT WINAPI gellPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, 
       CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
    {
    _asm pushad;
    main();
    _asm popad;
    return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
    }
    
    void *DetourCreate( BYTE *src, const BYTE *dst )
    {
    int len = 5;
    
    BYTE *jmp = (BYTE*)malloc( len+5 );
    DWORD dwBack;
    VirtualProtect( src, len, PAGE_EXECUTE_READWRITE, &dwBack );
    memcpy( jmp, src, len );	
    jmp += len;
    jmp[0] = 0xE9;
    *(DWORD*)( jmp+1 ) = (DWORD)( src+len - jmp ) - 5;
    src[0] = 0xE9;
    *(DWORD*)( src+1 ) = (DWORD)( dst - src ) - 5;
    VirtualProtect( src, len, dwBack, &dwBack );
    
    return( jmp-len );
    }
    
    void Hook(void)
    {
    DWORD dwPresent  = VTable(17);
    pPresent    = (oPresent)DetourCreate(( PBYTE)dwPresent, ( PBYTE )gellPresent);
    }
    
    DWORD WINAPI dwD3D9Thread(LPVOID)
    {
    while( !IsGameReadyForHook() )
    Sleep(100);
    Hook();
    return 0;
    }
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if ( dwReason == DLL_PROCESS_ATTACH )
    {
    CreateThread(NULL, NULL, dwD3D9Thread, NULL, NULL, NULL);
    }
    return TRUE;
    }
    inb4cryingmonkeyemocon and thanks in advanced

    commando: You're probably the best non-coder coder I know LOL


  2. #2
    NOOB's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    3,863
    Reputation
    425
    Thanks
    8,598
    OBVIOUSLY RAPID FIRE IS @Crash
    Last edited by NOOB; 06-07-2011 at 09:42 PM. Reason: OBVIOUSLY RAPID FIRE IS @whit

  3. #3
    LionelMessi10's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    MPGH.NET
    Posts
    6,125
    Reputation
    114
    Thanks
    4,545
    My Mood
    Aggressive
    OBVIOUSLY RAPID FIRE IS @whit
    Last edited by LionelMessi10; 06-07-2011 at 09:34 PM.

  4. #4
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,321
    My Mood
    Doh
    obviously @freedompeace knows all

    commando: You're probably the best non-coder coder I know LOL