Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine

    New D3D Tab Menu [With Code]

    hey guys i wanna present u my new tab menu

    Goto 10:45 to see the result




    Source:
    Get the detours by your own or use yours!

    main.cpp
    Code:
    #include "main.h"
    #include "includes.h"
    #include "funktionen.h"
    #include "menucore.h"
    
    cMain Main;
    cFunction Function;
    oReset pReset;
    oPresent pPresent; 
    oBeginScene pBeginScene;
    oEndScene pEndScene;
    oDrawIndexedPrimitive pDrawIndexedPrimitive;
    oSetStreamSource pSetStreamSource;
    
    
    D3DVIEWPORT9 vPort;
    HRESULT WINAPI MyPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion){
        _asm pushad;
    	pDevice->GetViewport(&vPort);
    	VPort.x = vPort.Width;
    	VPort.y = vPort.Height;
    
    
    	if(Main.pFont == NULL){
    		D3DXCreateFontA(pDevice, 14,7,FW_NORMAL, 0,0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH  | FF_DONTCARE, Font_Name, &Main.pFont);
    	}else{
    	Function.DrawString(10,10,0xFFFFFFFF,Main.pFont,"Kvn Test Menu");
    	}
    
    	GetCursorPos(&Mouse.mCur);
    	Mouse.X = Mouse.mCur.x;
    	Mouse.Y = Mouse.mCur.y;
    	if(Main.pFont != NULL){MenuMain(pDevice);}
        _asm popad;
    
        return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
    }
    
    
    HRESULT WINAPI MyReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
    {
    	_asm pushad;
    	Main.pFont->OnLostDevice();
    	Main.tFont->OnLostDevice();
    
    	HRESULT hRet = pReset(pDevice, pPresentationParameters);
    
    	if(SUCCEEDED(hRet))
    		Main.pFont->OnResetDevice();
    		Main.tFont->OnResetDevice();
    
    	_asm popad;
    
    	return pReset(pDevice, pPresentationParameters);
    }
    
    
    DWORD *FindDevice(VOID)
    {
        DWORD Base = (DWORD)LoadLibraryW(L"d3d9.dll");
    
        for(DWORD i = 0; i < 0x128000; i++ )
        {
          if ( (*(BYTE *)(Base+i+0x00))==0xC7
            && (*(BYTE *)(Base+i+0x01))==0x06
            && (*(BYTE *)(Base+i+0x06))==0x89
            && (*(BYTE *)(Base+i+0x07))==0x86
            && (*(BYTE *)(Base+i+0x0C))==0x89
            && (*(BYTE *)(Base+i+0x0D))==0x86 )
            return (DWORD *)(Base + i + 2);
        }
        return NULL;
    }
    
    DWORD WINAPI Hook(LPVOID)
    {
        while(GetModuleHandleA("d3d9.dll") == NULL)
      Sleep(100);
        DWORD * VtablePtr = FindDevice();
        DWORD* devicePtr = ***(DWORD****)VtablePtr;
        DWORD * VTable ;
        *(DWORD *)&VTable = *(DWORD *)VtablePtr;
    
     pPresent = (oPresent) (DWORD)VTable[hPresent] ;
        DetourTransactionBegin();
        DetourUpdateThread(GetCurrentThread());
        DetourAttach(&(PVOID&)pPresent, MyPresent);
        DetourTransactionCommit();
    
     pReset = (oReset) (DWORD)VTable[hReset];
        DetourTransactionBegin();
        DetourUpdateThread(GetCurrentThread());
        DetourAttach(&(PVOID&)pReset, MyReset);
        DetourTransactionCommit();
      
     return 0;
    }
    
    bool HookReady()
    {
    	if( GetModuleHandle( L"d3d9.dll" ) != NULL  )
    	   return true;
    	return false;
    }
    
    
    DWORD WINAPI dwHookThread(LPVOID)
    {
    	while(!HookReady())
    		Sleep(25);
    	CreateThread(NULL, NULL, Hook, NULL, NULL, NULL);
    	return EXIT_SUCCESS;
    }
    
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    	DisableThreadLibraryCalls(hDll);
    	if ( dwReason == 1 ){
    		InitTabs();
    		CreateThread(NULL, NULL,dwHookThread, NULL, NULL, NULL); 
    	}
    	return TRUE;
    }
    funktionen.h
    Code:
    void cFunction::DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt, ...) 
    {
    	if(!g_pFont)
    		return;
    
    	RECT FontPos = { x, y, x + 120, y + 16 };
    	char buf[1024] = {'\0'};
    	va_list va_alist;
    
    	va_start(va_alist, fmt);
    	vsprintf_s(buf, fmt, va_alist);
    	va_end(va_alist);
    
    	g_pFont->DrawTextA(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
    }
    
    void cFunction::DrawCheckBox(bool Checked, long x, long y, LPDIRECT3DDEVICE9 pDevice)
    {
    	Function.DXDrawBorderedBox((FLOAT)x,(FLOAT)y,11,11,(D3DCOLOR_ARGB(180,0,0,0)),(D3DCOLOR_ARGB(180,140,140,140)),pDevice);
    	if(Checked==true){Function.DXDrawBorderedBox((FLOAT)(x+3),(FLOAT)(y+3),5,5,(D3DCOLOR_XRGB(255,100,0)),(D3DCOLOR_XRGB(255,100,0)),pDevice);}
    }
    
    HRESULT cFunction::DXDrawBorderedBox(FLOAT x, FLOAT y, FLOAT h, FLOAT w,
    	DWORD color1, DWORD color2, LPDIRECT3DDEVICE9 pDevice)
    {
    	struct croner { D3DXVECTOR4 p; DWORD c; } cr[5];
    
            cr[0].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,1.0f); cr[0].c = color1;
    	cr[1].p = D3DXVECTOR4(x+0-0.5f,y+0-0.5f,0.0f,1.0f); cr[1].c = color1;
    	cr[2].p = D3DXVECTOR4(x+w-0.5f,y+h-0.5f,0.0f,1.0f); cr[2].c = color1;
    	cr[3].p = D3DXVECTOR4(x+w-0.5f,y+0-0.5f,0.0f,1.0f); cr[3].c = color1;
    
    	pDevice->SetTexture(0, NULL);
    	pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    	pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
    	pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, cr, sizeof(croner));
    	
            cr[0].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,1.0f); cr[0].c = color2;
    	cr[1].p = D3DXVECTOR4(x+0-0.5f,y+0-0.5f,0.0f,1.0f); cr[1].c = color2;
    	cr[2].p = D3DXVECTOR4(x+w-0.5f,y+0-0.5f,0.0f,1.0f); cr[2].c = color2;
    	cr[3].p = D3DXVECTOR4(x+w-0.5f,y+h-0.5f,0.0f,1.0f); cr[3].c = color2;
    	cr[4].p = D3DXVECTOR4(x+0-0.5f,y+h-0.5f,0.0f,1.0f); cr[4].c = color2;
    
    	pDevice->SetTexture(0, NULL);
    	pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
    	pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
    	pDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, 4, cr, sizeof(croner));
    
    	return S_OK;
    }
    
    
    char NameOfLogFile[200]="C:\\StrideLog.txt";
    
    
    void cFunction::Begin_Log(char* pMessage)
    {
    
        FILE* pfile;
    
        if((pfile = fopen(NameOfLogFile,"w")) != NULL)
        {
            fprintf(pfile,"%s\n", pMessage);
            fflush(pfile); // tastaturpuffer leeren
            fclose(pfile);
        }
    }
    
    void cFunction::Add_To_Log(char* pMessage)
    {
        FILE* pfile;
    
        if((pfile = fopen(NameOfLogFile,"a")) != NULL)
        {
            fprintf(pfile,"%s\n", pMessage);
            fflush(pfile);
            fclose(pfile);
        }
    }
    includes.h
    Code:
    #define _CRT_SECURE_NO_WARNINGS
    #pragma warning( disable: 4172 )
    #pragma warning( disable: 4700 )
    #pragma warning( disable: 4244 )
    #pragma warning( disable: 4715 )
    #pragma warning( disable: 4800 )
    #pragma warning( disable: 4101 )
    #pragma warning( disable: 4804 )
    #pragma warning( disable: 4430 )
    
    #pragma warning( disable: 4482 )
    #pragma warning( disable: 4102 )
    #pragma warning( disable: 4305 )
    #pragma warning( disable: 4099 )
    #pragma warning( disable: 4305 )
    #pragma warning( disable: 4996 )
    
    #pragma comment(lib, "d3dx9.lib")
    #pragma comment(lib, "Wininet.lib")
    #pragma comment(lib, "ws2_32")
    #pragma comment(lib, "WinInet.lib")
    #pragma comment(lib, "detours.lib")
    
    #include <windows.h>
    #include <Winuser.h>
    #include <stdio.h>
    #include <d3d9.h>
    #include <d3dx9.h>
    #include <fstream>
    #include <stdio.h>
    #include <ctime>
    #include <mmsystem.h>
    #include <wininet.h>
    #include <process.h>
    #include <conio.h>
    #include <wininet.h>
    #include <iostream>
    #include "detours.h"
    main.h
    Code:
    #include "includes.h"
    typedef HRESULT (WINAPI* oPresent)(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion);
    typedef HRESULT (WINAPI* oReset)(LPDIRECT3DDEVICE9 pDevice,D3DPRESENT_PARAMETERS* Parametri);
    typedef HRESULT (WINAPI* oBeginScene)(LPDIRECT3DDEVICE9 pDevice);
    typedef HRESULT (WINAPI* oEndScene)(LPDIRECT3DDEVICE9 pDevice);
    typedef HRESULT (WINAPI* oDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
    typedef HRESULT (WINAPI* oSetStreamSource)(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
    
    #define D3D9_Name L"d3d9.dll"
    #define Font_Name "Arial"
    #define hReset     16
    #define hPresent   17
    #define hBeginScene 41
    #define hEndScene 42
    #define hSSS 100
    #define hDIP 82
    
    #define Len_size 12
    #define _Menu
    #define _Main
    
    class cMain
    {
    public: 
    	LPD3DXFONT pFont;
    	LPD3DXFONT tFont;
    	LPDIRECT3DDEVICE9 pDevice;
    };
    
    extern class cMain Main;
    
    class cFunction
    {
    public: 
    	void DrawString(int x, int y, DWORD color, LPD3DXFONT g_pFont, const char *fmt, ...) ;
    	HRESULT DXDrawBorderedBox(FLOAT x, FLOAT y, FLOAT h, FLOAT w, DWORD color1, DWORD color2, LPDIRECT3DDEVICE9 pDevice);
    	void DrawCheckBox(bool Checked, long x, long y, LPDIRECT3DDEVICE9 pDevice);
    	void Begin_Log(char* pMessage);
    	void Add_To_Log(char* pMessage);
    };
    
    class cMouse
    {
    public:
    	POINT mCur;
    	int X;
    	int Y;
    };
    
    
    extern class cMouse Mouse;
    extern class cFunction Function;
    menucore.h
    Code:
    #include "tabclasses.h"
    
    cMouse Mouse;
    
    cD3D Tab_D3D;
    cPlayer Tab_Player;
    cWeapon Tab_Weapon;
    cMisc Tab_Misc;
    
    POINT VPort;
    
    bool footbar;
    
    #define FocusColor D3DCOLOR_ARGB(200, 255, 255, 255)
    #define NonFocusColor D3DCOLOR_ARGB(150, 0, 0, 255)
    
    #define D3DTab_Pos 10
    #define D3DTab_Len 33
    #define D3DTab_StartPos 8
    
    #define PlayerTab_Pos 80
    #define PlayerTab_Len 45
    #define PlayerTab_StartPos 78
    
    #define WeaponTab_Pos 150
    #define WeaponTab_Len 57
    #define WeaponTab_StartPos 148
    
    #define MiscTab_Pos 230
    #define MiscTab_Len 33
    #define MiscTab_StartPos 228
    
    
    int TabIndex=1;
    long ScrollbarPos;
    long ScrollbarLen;
    
    	int D3Dindex;
    	int Playerindex;
    	int Weaponindex;
    	int Miscindex;
    
    void TabControl(){
    	if(GetAsyncKeyState(VK_LEFT)&1){
    		TabIndex--;
    		if(TabIndex == 0){TabIndex = 4;}
    	}
    	if(GetAsyncKeyState(VK_RIGHT)&1){
    		TabIndex++;
    		if(TabIndex == 5){TabIndex = 1;}
    	}
    	if(TabIndex==1){ScrollbarPos = D3DTab_StartPos; ScrollbarLen = D3DTab_Len;}
    	if(TabIndex==2){ScrollbarPos = PlayerTab_StartPos; ScrollbarLen = PlayerTab_Len;}
    	if(TabIndex==3){ScrollbarPos = WeaponTab_StartPos; ScrollbarLen = WeaponTab_Len;}
    	if(TabIndex==4){ScrollbarPos = MiscTab_StartPos; ScrollbarLen = MiscTab_Len;}
    }
    
    void DrawFooter(LPDIRECT3DDEVICE9 pDevice){
    	if(footbar==true){Function.DXDrawBorderedBox(1, VPort.y - 20, 20, VPort.x - 1, D3DCOLOR_ARGB(150, 0, 0, 0), FocusColor, pDevice);}else{Function.DXDrawBorderedBox(1, VPort.y - 20, 20, VPort.x - 1, D3DCOLOR_ARGB(150, 0, 0, 0), NonFocusColor, pDevice);}
    	Function.DXDrawBorderedBox(ScrollbarPos, VPort.y - 17, 15, ScrollbarLen, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(150, 0, 255, 0), pDevice);
    	Function.DrawString(D3DTab_Pos, VPort.y - 17, 0xFFFFFFFF, Main.pFont, "D3D");
    	Function.DrawString(PlayerTab_Pos, VPort.y - 17, 0xFFFFFFFF, Main.pFont, "Player");
    	Function.DrawString(WeaponTab_Pos, VPort.y - 17, 0xFFFFFFFF, Main.pFont, "Weapon");
    	Function.DrawString(MiscTab_Pos, VPort.y - 17, 0xFFFFFFFF, Main.pFont, "Misc");
    }
    
    
    
    void DrawD3DTab(LPDIRECT3DDEVICE9 pDevice){
    	if(footbar==true){Function.DXDrawBorderedBox(Tab_D3D.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(150, 0, 0, 255), pDevice);}else{Function.DXDrawBorderedBox(Tab_D3D.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), FocusColor, pDevice);}
    	if(GetAsyncKeyState(VK_UP)&1){D3Dindex++; if(D3Dindex==4){D3Dindex=3;}}
    	if(GetAsyncKeyState(VK_DOWN)&1){D3Dindex--; if(D3Dindex==-1){D3Dindex=0;}}
    
    	if(GetAsyncKeyState(VK_NUMPAD0)&1){
    		if(D3Dindex==1){Tab_D3D.ItemThree =! Tab_D3D.ItemThree;}
    		if(D3Dindex==2){Tab_D3D.ItemTwo =! Tab_D3D.ItemTwo;}
    		if(D3Dindex==3){Tab_D3D.ItemOne =! Tab_D3D.ItemOne;}
    	}
    
    	if(D3Dindex==0){footbar=true;}else{footbar=false;}
    
    	Function.DrawString(Tab_D3D.X + 5, 105, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 1");
    	Function.DrawString(Tab_D3D.X + 5, 120, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 2");
    	Function.DrawString(Tab_D3D.X + 5, 135, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 3");
    
    	if(D3Dindex==1){Function.DrawString(Tab_D3D.X + 5, 135, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 3");}
    	if(D3Dindex==2){Function.DrawString(Tab_D3D.X + 5, 120, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 2");}
    	if(D3Dindex==3){Function.DrawString(Tab_D3D.X + 5, 105, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 1");}
    
    	if(Tab_D3D.ItemOne==true){Function.DrawString(Tab_D3D.X + 125, 105, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_D3D.X + 125, 105, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_D3D.ItemTwo==true){Function.DrawString(Tab_D3D.X + 125, 120, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_D3D.X + 125, 120, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_D3D.ItemThree==true){Function.DrawString(Tab_D3D.X + 125, 135, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_D3D.X + 125, 135, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    
    }
    
    void DrawPlayerTab(LPDIRECT3DDEVICE9 pDevice){
    	if(footbar==true){Function.DXDrawBorderedBox(Tab_Player.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(150, 0, 0, 255), pDevice);}else{Function.DXDrawBorderedBox(Tab_Player.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), FocusColor, pDevice);}
    
    	if(GetAsyncKeyState(VK_UP)&1){Playerindex++; if(Playerindex==4){Playerindex=3;}}
    	if(GetAsyncKeyState(VK_DOWN)&1){Playerindex--; if(Playerindex==-1){Playerindex=0;}}
    
    	if(GetAsyncKeyState(VK_NUMPAD0)&1){
    		if(Playerindex==1){Tab_Player.ItemThree =! Tab_Player.ItemThree;}
    		if(Playerindex==2){Tab_Player.ItemTwo =! Tab_Player.ItemTwo;}
    		if(Playerindex==3){Tab_Player.ItemOne =! Tab_Player.ItemOne;}
    	}
    
    	if(Playerindex==0){footbar=true;}else{footbar=false;}
    
    	Function.DrawString(Tab_Player.X + 5, 105, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 1");
    	Function.DrawString(Tab_Player.X + 5, 120, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 2");
    	Function.DrawString(Tab_Player.X + 5, 135, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 3");
    
    	if(Playerindex==1){Function.DrawString(Tab_Player.X + 5, 135, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 3");}
    	if(Playerindex==2){Function.DrawString(Tab_Player.X + 5, 120, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 2");}
    	if(Playerindex==3){Function.DrawString(Tab_Player.X + 5, 105, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 1");}
    
    	if(Tab_Player.ItemOne==true){Function.DrawString(Tab_Player.X + 125, 105, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Player.X + 125, 105, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Player.ItemTwo==true){Function.DrawString(Tab_Player.X + 125, 120, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Player.X + 125, 120, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Player.ItemThree==true){Function.DrawString(Tab_Player.X + 125, 135, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Player.X + 125, 135, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    }
    
    void DrawWeaponTab(LPDIRECT3DDEVICE9 pDevice){
    	if(footbar==true){Function.DXDrawBorderedBox(Tab_Weapon.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(150, 0, 0, 255), pDevice);}else{Function.DXDrawBorderedBox(Tab_Weapon.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), FocusColor, pDevice);}
    
    	if(GetAsyncKeyState(VK_UP)&1){Weaponindex++; if(Weaponindex==4){Weaponindex=3;}}
    	if(GetAsyncKeyState(VK_DOWN)&1){Weaponindex--; if(Weaponindex==-1){Weaponindex=0;}}
    
    	if(GetAsyncKeyState(VK_NUMPAD0)&1){
    		if(Weaponindex==1){Tab_Weapon.ItemThree =! Tab_Weapon.ItemThree;}
    		if(Weaponindex==2){Tab_Weapon.ItemTwo =! Tab_Weapon.ItemTwo;}
    		if(Weaponindex==3){Tab_Weapon.ItemOne =! Tab_Weapon.ItemOne;}
    	}
    
    	if(Weaponindex==0){footbar=true;}else{footbar=false;}
    
    	Function.DrawString(Tab_Weapon.X + 5, 105, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 1");
    	Function.DrawString(Tab_Weapon.X + 5, 120, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 2");
    	Function.DrawString(Tab_Weapon.X + 5, 135, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 3");
    
    	if(Weaponindex==1){Function.DrawString(Tab_Weapon.X + 5, 135, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 3");}
    	if(Weaponindex==2){Function.DrawString(Tab_Weapon.X + 5, 120, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 2");}
    	if(Weaponindex==3){Function.DrawString(Tab_Weapon.X + 5, 105, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 1");}
    
    	if(Tab_Weapon.ItemOne==true){Function.DrawString(Tab_Weapon.X + 125, 105, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Weapon.X + 125, 105, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Weapon.ItemTwo==true){Function.DrawString(Tab_Weapon.X + 125, 120, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Weapon.X + 125, 120, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Weapon.ItemThree==true){Function.DrawString(Tab_Weapon.X + 125, 135, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Weapon.X + 125, 135, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    }
    
    void DrawMiscTab(LPDIRECT3DDEVICE9 pDevice){
    	if(footbar==true){Function.DXDrawBorderedBox(Tab_Misc.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(150, 0, 0, 255), pDevice);}else{Function.DXDrawBorderedBox(Tab_Misc.X, 100, 400, 150, D3DCOLOR_ARGB(150, 0, 0, 0), FocusColor, pDevice);}
    
    	if(GetAsyncKeyState(VK_UP)&1){Miscindex++; if(Miscindex==4){Miscindex=3;}}
    	if(GetAsyncKeyState(VK_DOWN)&1){Miscindex--; if(Miscindex==-1){Miscindex=0;}}
    
    	if(GetAsyncKeyState(VK_NUMPAD0)&1){
    		if(Miscindex==1){Tab_Misc.ItemThree =! Tab_Misc.ItemThree;}
    		if(Miscindex==2){Tab_Misc.ItemTwo =! Tab_Misc.ItemTwo;}
    		if(Miscindex==3){Tab_Misc.ItemOne =! Tab_Misc.ItemOne;}
    	}
    
    	if(Miscindex==0){footbar=true;}else{footbar=false;}
    
    	Function.DrawString(Tab_Misc.X + 5, 105, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 1");
    	Function.DrawString(Tab_Misc.X + 5, 120, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 2");
    	Function.DrawString(Tab_Misc.X + 5, 135, D3DCOLOR_ARGB(255, 0, 255, 255), Main.pFont, "Item 3");
    
    	if(Miscindex==1){Function.DrawString(Tab_Misc.X + 5, 135, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 3");}
    	if(Miscindex==2){Function.DrawString(Tab_Misc.X + 5, 120, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 2");}
    	if(Miscindex==3){Function.DrawString(Tab_Misc.X + 5, 105, D3DCOLOR_ARGB(255, 255, 255, 255), Main.pFont, "Item 1");}
    
    	if(Tab_Misc.ItemOne==true){Function.DrawString(Tab_Misc.X + 125, 105, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Misc.X + 125, 105, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Misc.ItemTwo==true){Function.DrawString(Tab_Misc.X + 125, 120, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Misc.X + 125, 120, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    	if(Tab_Misc.ItemThree==true){Function.DrawString(Tab_Misc.X + 125, 135, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Misc.X + 125, 135, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    }
    
    void MenuMain(LPDIRECT3DDEVICE9 pDevice){
    	if(TabIndex==1){DrawD3DTab(pDevice);}
    	if(TabIndex==2){DrawPlayerTab(pDevice);}
    	if(TabIndex==3){DrawWeaponTab(pDevice);}
    	if(TabIndex==4){DrawMiscTab(pDevice);}
    	DrawFooter(pDevice);
    }
    
    void tCheck(){
    	if(TabIndex==1){Tab_Player.X = -150; Tab_Weapon.X = -150; Tab_Misc.X = -150;}
    	if(TabIndex==2){Tab_D3D.X = -150; Tab_Misc.X = -150; Tab_Weapon.X = -150;}
    	if(TabIndex==3){Tab_D3D.X = -150; Tab_Misc.X = -150; Tab_Player.X = -150;}
    	if(TabIndex==4){Tab_Player.X = -150; Tab_Player.X = -150; Tab_Weapon.X = -150;}
    }
    
    DWORD WINAPI Timer(LPVOID){
    	while(true){
    
    		if(footbar==true){
    		TabControl();
    		if(TabIndex==1){if(Tab_D3D.X <= 100){Tab_D3D.X +=1; Sleep(1); tCheck();}}
    		if(TabIndex==2){if(Tab_Player.X <= 100){Tab_Player.X +=1; Sleep(1); tCheck();}}
    		if(TabIndex==3){if(Tab_Weapon.X <= 100){Tab_Weapon.X +=1; Sleep(1); tCheck();}}
    		if(TabIndex==4){if(Tab_Misc.X <= 100){Tab_Misc.X +=1; Sleep(1); tCheck();}}
    		}
    
    	}
    }
    
    void InitTabs(){
    	CreateThread(NULL, NULL, Timer, NULL, NULL, NULL);
    }
    tabclasses.h
    Code:
    class cD3D
    {
    public: 
    	long X;
    	long Y;
    	bool ItemOne;
    	bool ItemTwo;
    	bool ItemThree;
    
    };
    
    class cPlayer
    {
    public: 
    	long X;
    	long Y;
    	bool ItemOne;
    	bool ItemTwo;
    	bool ItemThree;
    };
    
    class cWeapon
    {
    public: 
    	long X;
    	long Y;
    	bool ItemOne;
    	bool ItemTwo;
    	bool ItemThree;
    
    };
    
    class cMisc
    {
    public: 
    	long X;
    	long Y;
    	bool ItemOne;
    	bool ItemTwo;
    	bool ItemThree;
    };
    
    
    extern class cD3D D3D;
    extern class cPlayer Player;
    extern class cWeapon Weapon;
    extern class cMisc Misc;
    Credits: Me
    Last edited by RedAppleCoder; 09-16-2012 at 08:19 AM. Reason: code added
    Haters Gon' Hate

  2. The Following 10 Users Say Thank You to RedAppleCoder For This Useful Post:

    A200K (10-06-2012),maranenko5 (06-20-2018),Marik768 (01-20-2013),matypatty (09-16-2012),Oxxxymiron (10-21-2012),pDevice (09-17-2012),ramindx1 (10-21-2012),street_21 (09-23-2012),The Decoder (01-14-2013),V I (01-20-2013)

  3. #2
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Nice work. I was working on the "Slide out" effect myself since it seemed really cool.

    Nice to see others trying new things as well. Good work
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  4. The Following User Says Thank You to Flengo For This Useful Post:

    The Decoder (01-14-2013)

  5. #3
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by RedAppleCoder View Post
    Smooth movings look great everytime
    I just noticed, correct me if I'm wrong, but you have no menu options. You're just drawing them. There's no use of them.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  6. #4
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by Dragon(H)ell View Post
    I thought that too in first but I think you can do it like this

    Code:
    if(Tab_Weapon.ItemOne){
    bla bla bla
    }esle{
    blablabla}
    I couldn't find anything being initialized or called to change the value of it being on or off.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  7. #5
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by Dragon(H)ell View Post
    Code:
    if(Tab_Weapon.ItemOne==true){Function.DrawString(Tab_Weapon.X + 125, 105, D3DCOLOR_ARGB(255, 0, 255, 0), Main.pFont, "On");}else{Function.DrawString(Tab_Weapon.X + 125, 105, D3DCOLOR_ARGB(255, 255, 0, 0), Main.pFont, "Off");}
    That's just drawing it. There is no dependency on a variable (hack) for it to change. That's what I couldn't find.

    That's just drawing the string.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  8. #6
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by Shadow` View Post
    Well, I just skimmed the video and saw this comment, and my theory is that the "Tab_Weapon.ItemOne" is the variable. Perhaps if he has some sort of GetAsyncKey to activate it from true and false, then it would be changeable. If he was just drawing the text, i would see no reason for the if statement.
    I skimmed through the code, and there's nothing to change the variable though.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  9. #7
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    there are the variables.. bool Tab_D3D.ItemOne as example. if u realy understand classes and c++ then its easy.
    Haters Gon' Hate

  10. The Following User Says Thank You to RedAppleCoder For This Useful Post:

    wraithkilla (09-19-2012)

  11. #8
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by RedAppleCoder View Post
    there are the variables.. bool Tab_D3D.ItemOne as example. if u realy understand classes and c++ then its easy.
    I can see the variables easily.
    But what changes their values? I can't find that.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  12. #9
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    Quote Originally Posted by Flengo View Post


    I can see the variables easily.
    But what changes their values? I can't find that.
    Youll find this in each Tab void:

    Code:
    if(GetAsyncKeyState(VK_NUMPAD0)&1){
    		if(D3Dindex==1){Tab_D3D.ItemThree =! Tab_D3D.ItemThree;}
    		if(D3Dindex==2){Tab_D3D.ItemTwo =! Tab_D3D.ItemTwo;}
    		if(D3Dindex==3){Tab_D3D.ItemOne =! Tab_D3D.ItemOne;}
    }
    Haters Gon' Hate

  13. The Following User Says Thank You to RedAppleCoder For This Useful Post:

    [MPGH]Flengo (09-19-2012)

  14. #10
    flameswor10's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Posts
    12,528
    Reputation
    981
    Thanks
    10,409
    My Mood
    In Love
    I can see lots of improvements that you can make with your code.
    Try to make everything as easy as possible to add features.
    It will save time for yourself, and anyone who happens to read your code.

    I would suggest by using arrays and using references to variables so it can be more 'globalized' and 'automated'.
    The menu class itself should not be edited by the user unless changing the GUI around.

    e.g
    Code:
    struct ItemStructs{
    char *ItemName;
    int *Variable; //can be a boolean
    char **Options;
    int max;
    };
    
    ItemStructs ITEM[20]; //Already a much cleaner way of adding features to your menu C:
    Last edited by flameswor10; 09-19-2012 at 09:18 PM.
    No I do not make game hacks anymore, please stop asking.

  15. The Following User Says Thank You to flameswor10 For This Useful Post:

    [MPGH]Flengo (09-19-2012)

  16. #11
    itayisback's Avatar
    Join Date
    Jul 2012
    Gender
    male
    Location
    CA
    Posts
    170
    Reputation
    10
    Thanks
    8
    My Mood
    Happy
    Great Work!
    Press "Thanks" If I Helped You

    iOS & Java Developer Mainly

  17. #12
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    Quote Originally Posted by flameswor10 View Post
    I can see lots of improvements that you can make with your code.
    Try to make everything as easy as possible to add features.
    It will save time for yourself, and anyone who happens to read your code.

    I would suggest by using arrays and using references to variables so it can be more 'globalized' and 'automated'.
    The menu class itself should not be edited by the user unless changing the GUI around.

    e.g
    Code:
    struct ItemStructs{
    char *ItemName;
    int *Variable; //can be a boolean
    char **Options;
    int max;
    };
    
    ItemStructs ITEM[20]; //Already a much cleaner way of adding features to your menu C:
    i wrote this for beginners that everyone can understand what i do.
    Haters Gon' Hate

  18. #13
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,179
    My Mood
    Inspired
    Quote Originally Posted by RedAppleCoder View Post
    i wrote this for beginners that everyone can understand what i do.
    Its much easier to understand if its neater and more organized.
    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.

     


     
    VM | PM | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.2013

    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  19. The Following User Says Thank You to Flengo For This Useful Post:

    Shadow` (09-22-2012)

  20. #14
    RedAppleCoder's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Hamm
    Posts
    36
    Reputation
    10
    Thanks
    54
    My Mood
    Fine
    Thats true but no one realy understand what arrays are when you beginn
    Haters Gon' Hate

  21. #15
    Saltine's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Posts
    493
    Reputation
    104
    Thanks
    629
    Quote Originally Posted by RedAppleCoder View Post
    Thats true but no one realy understand what arrays are when you beginn
    Arrays are an early part of every language tutorial, essential knowledge for beginners. Everyone who even attempts to understand game hacking should have a knowledge at least that detailed. Even if they don't, they should be taught how to code intelligently, and not learn poor practices like those exercised in the development of this.

    Oh no! Vortex is gay!

  22. The Following User Says Thank You to Saltine For This Useful Post:

    Departure (09-28-2012)

Page 1 of 2 12 LastLast

Similar Threads

  1. [Detected] NEW D3D MPGH MENU PUBLIC-2
    By udelz in forum Piercing Blow Hacks & Cheats
    Replies: 79
    Last Post: 10-16-2011, 06:06 PM
  2. [Detected] NEW D3D MPGH MENU PUBLIC-2
    By udelz in forum Point Blank Hacks
    Replies: 13
    Last Post: 10-14-2011, 08:53 AM
  3. New D3D Hack has been released!
    By Dave84311 in forum Hack/Release News
    Replies: 23
    Last Post: 05-29-2009, 08:02 AM
  4. New D3D VIP Hack*undedected* (VIP Only!) 06/10/08
    By 007snicker in forum WarRock - International Hacks
    Replies: 8
    Last Post: 10-06-2008, 12:29 PM
  5. {{{NEW}}} D3D My Way!! {{{NEW}}}
    By SMGamer in forum WarRock - International Hacks
    Replies: 14
    Last Post: 06-10-2008, 01:16 PM