Results 1 to 2 of 2
  1. #1
    loadgamers4's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Posts
    18
    Reputation
    10
    Thanks
    0

    Help me If baket without leaving the menu at the top

    Help me If baket without leaving the menu at the top

    code
    Code:
    #include <windows.h>
    #include <stdio.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    
    #pragma comment(lib, "d3d9.lib")
    #pragma comment(lib, "d3dx9.lib")
    
    #define PresentEngine 0x004C41AF
    DWORD retPresentEngine = ( PresentEngine + 0x5 );
    
    #define Red     D3DCOLOR_ARGB( 255, 255, 255, 000 )
    #define Green   D3DCOLOR_ARGB( 255, 000, 255, 000 )
    #define Blue    D3DCOLOR_ARGB( 255, 000, 000, 255 )
    #define Yellow  D3DCOLOR_ARGB( 255, 255, 255, 000 )
    #define Black   D3DCOLOR_ARGB( 255, 000, 000, 000 )
    
    typedef struct{
    	int index;
    	char * title;
    	int *hack;
    	int hackmaxval;
    	int hacktype;
    	DWORD HCOLOR;
    }ITEM;
    
    int hackcount;
    int selector;
    int x,y,w,h;
    DWORD COLOR;
    
    ITEM HACKITEM[99];
    char hackrval[256];
    
    int xFontOffSet = 15;
    int hackopt1;
    int MenuHeight = 10;
    int show = 0;
    int hack1, hack2, hack3;
    
    LPDIRECT3DDEVICE9 pDevice;
    LPD3DXFONT Font;
    
    VOID StartFont( LPDIRECT3DDEVICE9 pDevice )
    {
        if( Font )
        {
            Font->Release();
            Font = NULL;
        }
    
        if( !Font )
        {
            D3DXCreateFont( pDevice,
                            14,
                            0,
                            FW_BOLD,
                            1,
                            0,
                            DEFAULT_CHARSET,
                            OUT_DEFAULT_PRECIS,
                            DEFAULT_QUALITY,
                            DEFAULT_PITCH | FF_DONTCARE,
                            "Arial",
                            &Font );
        }
    }
    
    VOID WriteText(char pString[], INT x, INT y, DWORD color )
    {    
        RECT rect;
        SetRect( &rect, x, y, x, y );
        Font->DrawText( NULL, pString, -1, &rect, DT_NOCLIP | DT_LEFT, color );
    }
    
    void CreateItem(int index, char * title, int *hack, int hackmaxval,int hacktype)
    {
    	hackcount++;
    	HACKITEM[hackcount].index = index;
    	HACKITEM[hackcount].hack = hack;
    	HACKITEM[hackcount].hackmaxval = hackmaxval;
    	HACKITEM[hackcount].hacktype = hacktype;
    	WriteText(title, xFontOffSet, index*15,HACKITEM[hackcount].HCOLOR); //If you want to move the menu opts down do something like this (index*15)+20 and to move it left or right just add/subtract from font offset.
    }
    
    void RenderMenu()
    {
    	if(GetAsyncKeyState(VK_DOWN)&1) 
    			selector++;
    
    	if(GetAsyncKeyState(VK_UP)&1)
    		if(selector > 1)
    			selector--;
    
    	if (GetAsyncKeyState(VK_RIGHT)<0)
    	{
    		for(int i=0;i < (hackcount+1);i++)
    		{
               if(selector == HACKITEM[i].index)
    		   {
    			   if(*HACKITEM[i].hack < HACKITEM[i].hackmaxval)
    					*HACKITEM[i].hack += 1;
    		   }
    		}
    	}
    
    	if (GetAsyncKeyState(VK_LEFT)<0)
    	{
    		for(int i=0;i < (hackcount+1);i++)
    		{
               if(selector == HACKITEM[i].index)
    		   {
    			   *HACKITEM[i].hack = 0;
    			   Sleep(20);
    		   }
    		}
    	}
    	
    	for(int i=0;i < (hackcount+1);i++)
    	{
    		if(selector == HACKITEM[i].index)
    			HACKITEM[i].HCOLOR = Green;
    		else
    			HACKITEM[i].HCOLOR = Red;
    	}
    
    	for(int i=1; i<(hackcount+1); i++)
    	{
    		if(HACKITEM[i].hacktype == 0)
    		{
    			if(*HACKITEM[i].hack == 1)  //to move the opts down do something like this (HACKITEM[i].index*15)+20 
    				WriteText("On", xFontOffSet+100, HACKITEM[i].index*15,Yellow);
    			else 
    				WriteText("Off", xFontOffSet+100, HACKITEM[i].index*15,Red);
    		}
    	}
    
    	for(int i=1; i<(hackcount+1); i++)
    	{
    		if(HACKITEM[i].hackmaxval >1 && HACKITEM[i].hacktype == 1)
    		{
    			sprintf_s(hackrval, "%i", *HACKITEM[i].hack);
    			WriteText(hackrval, xFontOffSet+100, HACKITEM[i].index*15,Red);
    		}
    	}
    
    	if(selector < 1)
    		selector = 1;
    
    	if(selector > hackcount)
    		selector = 1;
    
    	hackcount = 0;
    }
    
    void BuildMenu(char * menuname, int x, int y, int h, int w, DWORD TITLECOL, DWORD BACKCOLOR, DWORD BORDERCOLOR, LPDIRECT3DDEVICE9 pDevice)
    {
    	if(GetAsyncKeyState(VK_INSERT)&1) show=(!show);
    	
    	if(!show) 
    	{
    		WriteText(menuname, 5, 2, TITLECOL);
    		return;
    	}
    
    	WriteText(menuname, x+10, y+2, TITLECOL);
    	
    	CreateItem(1,"Wallhack ", &hack1, 1, 0);
    	CreateItem(2,"Chams 2", &hack2, 1, 0); 
    	CreateItem(3,"FullBright 3", &hack3, 1, 0);
    
    	RenderMenu();
    }
    
    /*void MemoryHackHere()
    {
    	//load modules & continue with hacks
    
    	if(hack1)
    	{
    
    	}
    
    	//do not put sleep()
    }
    */
    
    __declspec( naked ) HRESULT WINAPI PresentMidfunction( )
    {
        static LPDIRECT3DDEVICE9 pDevice;
    
        __asm
        {
            MOV ECX, DWORD PTR DS:[EAX]
            MOV EDX, DWORD PTR DS:[ECX + 0x44]
            MOV DWORD PTR DS:[pDevice], EAX
            PUSH 0
            PUSHAD
        }
    
    	//================================================================================== font
        StartFont( pDevice );
    
    	//================================================================================== menu
    	BuildMenu("LoadGamers D3D Menu Crossfire 9/13/2012",0,0,180,200,Red,Black,Green,pDevice);
        
    	//================================================================================== hack
    	//MemoryHackHere();
    
        __asm
        {
            POPAD
            JMP retPresentEngine
        }
    }
    
    VOID *DetourCreate( BYTE *src, CONST BYTE *dst, CONST INT len )
    {
        BYTE *jmp =( BYTE * ) malloc( len + 5 );
        DWORD dwBack;
    
        VirtualProtect( src, len, PAGE_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;
        for( INT i = 5; i < len; i++ )
            src[i] = 0x90;
        VirtualProtect( src, len, dwBack, &dwBack );
    
        return( jmp - len );
    }
    
    DWORD WINAPI StartRoutine( LPVOID )
    {
        while( TRUE )
        {
            if( memcmp( ( VOID * )PresentEngine, ( VOID * )( PBYTE )"\x8B\x51", 2 ) == 0 )
            {
                Sleep( 100 );
                DetourCreate( ( PBYTE )PresentEngine, ( PBYTE )PresentMidfunction, 5 );
            }
            Sleep( 50 );
        }
     
        return 0;
    }
    
    BOOL WINAPI DllMain( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    { 
        if( dwReason == DLL_PROCESS_ATTACH )
        {
            DisableThreadLibraryCalls( hDll );
            //MessageBox( 0, "LoadGamers D3D Menu", "Crossfire", 0 );
            CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)StartRoutine, 0, 0, 0 );
        }
     
        return TRUE;
    }

  2. #2
    motie16's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    1
    My Mood
    Aggressive
    panu po gumawa ng dll tnx and more powers

Similar Threads

  1. [Help Request] Help please to find a program of textures in the game ...
    By vlad_vlad in forum Piercing Blow Help
    Replies: 0
    Last Post: 12-06-2011, 12:27 PM
  2. Edited a hack, need help with the menu
    By Rainscape in forum Combat Arms Coding Help & Discussion
    Replies: 17
    Last Post: 09-30-2011, 11:00 PM
  3. How I Leave I establish of the Transparent Menu?
    By Strikex in forum Combat Arms Coding Help & Discussion
    Replies: 3
    Last Post: 02-10-2011, 02:21 PM
  4. *Need help on 1 error on the menu :(
    By ultahackers in forum Combat Arms Coding Help & Discussion
    Replies: 10
    Last Post: 11-06-2010, 10:54 AM
  5. why the menu of the public doesnt open to me
    By rotative in forum CrossFire Help
    Replies: 3
    Last Post: 05-18-2010, 03:13 PM