Thread: Error LNK2019

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    Mr.Magicman's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Sitting in my cave full of thoughts learning Asembly
    Posts
    2,102
    Reputation
    16
    Thanks
    649
    My Mood
    Cold
    Quote Originally Posted by Stephen View Post
    Erase everything.

    /
    Isnt that what you shuld Do to all his bases?

  2. #17
    DreadKyller's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    122
    Reputation
    12
    Thanks
    21
    Quote Originally Posted by Stephen View Post
    Erase everything.

    /
    Quote Originally Posted by Mr.Magicman View Post


    Isnt that what you shuld Do to all his bases?
    Wow, this site is like not good for trying to get help.

    Really... What is Deleting everything going to do? I tried makeing a new project OVER 5 times, NONE work. All I want to know is what is the sorce of the error.

    Base Code:
    Code:
    #include "Base.h"
    #include "Menu.h"
    #include "Detour.h"
    #include "ADE32.h"
    #include <time.h>
    #include <stdio.h>
    int frame;
    
    DWORD dwHSDevicePointer, dwDevicePointer;
    
    int menuX = 20, menuY = 100, offsetX, offsetY;
    bool isDragging = false;
    POINT cPos;
    
    DWORD hD3D, adr, *vtbl; 
    
    bool Compare(const BYTE* pData, const BYTE* bMask, const char* szMask){
    	for(;*szMask;++szMask,++pData,++bMask)
    		if(*szMask=='x' && *pData!=*bMask)   return 0;
    	return (*szMask) == NULL;
    }
    
    DWORD Pattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char * szMask){
    	for(DWORD i=0; i<dwLen; i++)
    		if (Compare((BYTE*)(dwAddress+i),bMask,szMask))  return (DWORD)(dwAddress+i);
    	return 0;
    }
    
    void __cdecl Push( const char* szCommand )
    {
    DWORD *LTClient = ( DWORD* )(0x377ED910);
    DWORD CNADDIE = 0x46F670;
    void* Send = ( void* )*( DWORD* )(CNADDIE);
    void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
    __asm
    {
    push szCommand;
    call CONoff;
    add esp,4;
    
    }
    }
    
    /***************************************************************************************************/
    LPD3DXFONT pFont;
    LPDIRECT3DDEVICE9 g_pDevice = 0;
    
    int	  FPScounter = 0;
    float FPSfLastTickCount = 0.0f;
    float FPSfCurrentTickCount;
    
    
    void DrawString(LPD3DXFONT Font, long x, long y, D3DCOLOR fontColor, char *text, ...)
    {  
        RECT rct;    
        rct.left     = x - 1;    
        rct.right    = x + 1;    
        rct.top      = y - 1 ;    
        rct.bottom   = y + 1;  
    
        if(!text) { return; } 
        va_list va_alist; 
        char logbuf[256] = {0}; 
        va_start (va_alist, text); 
        _vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist); 
        va_end (va_alist); 
        RECT FontRect = { x, y, x, y }; 
        pFont->DrawTextA(NULL, logbuf, -1, &rct, DT_NOCLIP, fontColor);  
    }
    
    
    void FillRGB( int x, int y, int w, int h, D3DCOLOR yourcolor, IDirect3DDevice9* pDevice )
    {
    const DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;
    struct Vertex
    {
    float x,y,z,ht;
    DWORD yourcolor;
    }
    
    V[4] =
    {
    {(float)x,(float)(y+h), 0.0f, 0.0f, yourcolor},
    {(float)x,(float)y, 0.0f, 0.0f, yourcolor},
    {(float)(x+w),(float)(y+h), 0.0f, 0.0f, yourcolor},
    {(float)(x+w),(float)y, 0.0f, 0.0f, yourcolor}
    };
    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
    pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
    pDevice->SetRenderState( D3DRS_FOGENABLE, false );
    
    pDevice->SetFVF(D3D_FVF);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,V,sizeof(Vertex));
    }
    
    
    void DrawBorder( int x, int y, int w, int h, int px, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
    	FillRGB( x, (y + h - px), w, px,	BorderColor, pDevice );
    	FillRGB( x, y, px, h,				BorderColor, pDevice );
    	FillRGB( x, y, w, px,				BorderColor, pDevice );
    	FillRGB( (x + w - px), y, px, h,	BorderColor, pDevice );
    }
    
    void DrawBox( int x, int y, int w, int h, D3DCOLOR BoxColor, D3DCOLOR BorderColor, IDirect3DDevice9* pDevice )
    {
    	FillRGB( x, y, w, h,		BoxColor, pDevice );
    	DrawBorder( x, y, w, h, 1,	BorderColor, pDevice );
    }
    
    void FPScheck(char *str, char *format)
    {
    	FPSfCurrentTickCount = clock() * 0.001f;
    	FPScounter++;
    
    	if((FPSfCurrentTickCount - FPSfLastTickCount) > 1.0f) {
    	    FPSfLastTickCount = FPSfCurrentTickCount;
    		sprintf(str,format,FPScounter);
    	    FPScounter = 0;
    	} 
    }
    
    HRESULT GenerateTexture(IDirect3DDevice9 *Device_Interface, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
    {
    	if( FAILED(Device_Interface->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
    	return E_FAIL;
    
    	WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
    	|(WORD)(((colour32>>20)&0xF)<<8)
    	|(WORD)(((colour32>>12)&0xF)<<4)
    	|(WORD)(((colour32>>4)&0xF)<<0);
    
    	D3DLOCKED_RECT d3dlr;
    	(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
    	WORD *pDst16 = (WORD*)d3dlr.pBits;
    
    	for(int xy=0; xy < 8*8; xy++)
    	*pDst16++ = colour16;
    
    	(*ppD3Dtex)->UnlockRect(0);
    
    	return S_OK;
    }
    /************************************************************************************/
    
    bool IsGameReadyForHook(void)
    {
        if( GetModuleHandleA( "d3d9.dll"     ) != NULL 
         && GetModuleHandleA( "ClientFX.fxd" ) != NULL 
         && GetModuleHandleA( "CShell.dll"   ) != NULL )
            return true;
        return false;
    }
    
    char sFPS[20]       ="xxx Fps";
    
    int visuals		= 0;
    
    int	cham		= 0;
    int	xhair		= 0;
    int Menu		= 0;
    
    
    char *Folder[] = { "+"  , "-" };	
    char *OnOff[]  = { "Off", "On"};
    char *Multi[] = {"Off", "1", "2", "3", "4", "5"};
    char *Dir[] = {"Off", "Up", "Down"};
    char *Color[] = {"Off", "Green", "Blue", "Red", "Black", "White"};
    	
    void RebuildMenu(void)
    
    {
       MenuAddText("FrameRate", sFPS);
    	MenuAddItem("=Visuals=", Folder, &visuals, 2, MENUFOLDER);
    	 if (visuals) {
    	MenuAddItem("Move Menu", OnOff, &Menu, 2, MENUITEM);
    	MenuAddItem("NX Chams", OnOff, &Menu, 2, MENUITEM);
    	MenuAddItem("Crosshair", Color, &Menu, 2, MENUITEM);
    	MenuAddItem("=Modifiers=", Folder, &visuals, 2, MENUFOLDER);
    	MenuAddItem("Fly Hack", OnOff, &Menu, 2, MENUITEM);
    	MenuAddItem("Speed Hack", OnOff, &Menu, 2, MENUITEM);
    	MenuAddItem("VJump", Dir, &Menu, 2, MENUITEM);
    	MenuAddItem("=Credits=", Folder, &Menu, 2, MENUFOLDER);
    	MenuAddText("Credits:", " Neotic Menu");
    	MenuAddText("    ", "V1.0");
    	MenuAddText("Base:", " COOlGuy");
    	MenuAddText("Edited:", " DreadKyller");
    	MenuAddText("MPGH.net-MultiPlayer Gameing Hacks","");
    	}
    }
    
    void ReFont(LPDIRECT3DDEVICE9 pDevice)
    {
    	if (g_pDevice != pDevice)
    	{
    		g_pDevice = pDevice;
    		try
    		{
    			if (pFont != 0)
    				pFont->Release();
    		} catch (...) {}
    		pFont = 0;
    		D3DXCreateFontA(pDevice, 15, 0, FW_NORMAL, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &pFont );
    		
    	}
    
    }
    
    void RenderFrame(LPDIRECT3DDEVICE9 pDevice)
    {
    	ReFont(pDevice);
    	if(Visible == 1) {
    
    
    	DrawBox(menuX-10, menuY-8, 140, frame, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(255, 255, 255, 255), pDevice);
    	DrawBox( 8, 8, 140, 20, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(255, 255, 255, 255), pDevice);
    	DrawString( pFont, 10, 10, D3DCOLOR_ARGB(255, 255, 0, 0), "      C00lGuy Base v1");
    
    	}else{
    
    	DrawBox( 8, 8, 140, 20, D3DCOLOR_ARGB(150, 0, 0, 0), D3DCOLOR_ARGB(255, 255, 255, 255), pDevice);
    	DrawString( pFont, 10, 10, D3DCOLOR_ARGB(255, 255, 0, 0), "      C00lGuy Base v1");
    
    	}
    	
    FPScheck(sFPS,"%d");
    
    	if (Menu == 1){
    	if(GetAsyncKeyState(VK_LBUTTON) < 0) 
    	{
    
    		GetCursorPos(&cPos);
    		
    		if(cPos.x > menuX - 10 && cPos.x < menuX + 125 && cPos.y > menuY - 10 && cPos.y < menuY + 455){
    			
    			if(!isDragging){
    
    				offsetX = cPos.x - menuX;
    				offsetY = cPos.y - menuY;
    				isDragging = true;
    			}
    		}
    	} else {
    
    		isDragging = false;
    	}
    	}
    	if(isDragging){
    		
    		menuX = cPos.x - offsetX;
    		menuY = cPos.y - offsetY;
    	}
    
    
    	if (Max == 0) RebuildMenu();
    	MenuShow(menuX,menuY,pFont);
    	MenuNav();
    }
    
    void PTC(void)
    {
    	while(1)
    	{
    		Sleep(200);
    
    		}
    		Sleep(200);
    	}
    
    HRESULT myPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT* pSourceRect,CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion)
    {
    	_asm NOP;
    	RenderFrame(pDevice);
    	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
    }
    
    HRESULT WINAPI myReset( LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
    {
    	__asm NOP;
    	pFont->OnLostDevice();
    	HRESULT hRet = pReset(pDevice, pPresentationParameters);
    	pFont->OnResetDevice();
        return hRet;
    }
    
    DWORD WINAPI Hacks(LPVOID)
    {
    	while( !IsGameReadyForHook() )
    	Sleep(100);
    	PTC();
    	return 0;
    }
    
    bool bCompare(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( bCompare( (BYTE*)( dwAddress+i ),bMask,szMask) )
    			return (DWORD)(dwAddress+i);
    	return 0;
    }
    
    DWORD WINAPI D3DInit(LPVOID)
    {
    	
    	hD3D = 0; 
    
        do {
    		hD3D = (DWORD)GetModuleHandleA("d3d9.dll"); 
            Sleep(10); 
        } while(!hD3D); 
        adr = FindPattern(hD3D, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx"); 
       
    	if (adr) { 
            memcpy(&vtbl,(void *)(adr+2),4);
            pReset     =  (oReset)DetourCreate		(( BYTE* )vtbl[16],	( BYTE* )myReset,	DETOUR_TYPE_JMP );
    		pPresent   =  (oPresent)DetourCreate	(( BYTE* )vtbl[17],	( BYTE* )myPresent, DETOUR_TYPE_JMP );
    	}
    	return 0;
    }
    
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    	DisableThreadLibraryCalls(hDll);
    	if (dwReason == DLL_PROCESS_ATTACH)
    	{
    		CreateThread(NULL, NULL, Hacks, NULL, NULL, NULL);
    		CreateThread(NULL, NULL, D3DInit, NULL, NULL, NULL);
    	}
    	return TRUE;
    }
    ADE32 Code:
    Code:
    #define WIN32_LEAN_AND_MEAN
    #define WIN32_EXTRA_LEAN
    
    #include <windows.h>
    
    #include "ADE32.h"
    
    DWORD ade32_table[512] = {
    /* 00 */  C_MODRM,
    /* 01 */  C_MODRM,
    /* 02 */  C_MODRM,
    /* 03 */  C_MODRM,
    /* 04 */  C_DATA1,
    /* 05 */  C_DATA66,
    /* 06 */  C_BAD,
    /* 07 */  C_BAD,
    /* 08 */  C_MODRM,
    /* 09 */  C_MODRM,
    /* 0A */  C_MODRM,
    /* 0B */  C_MODRM,
    /* 0C */  C_DATA1,
    /* 0D */  C_DATA66,
    /* 0E */  C_BAD,
    /* 0F */  C_OPCODE2,
    /* 10 */  C_MODRM+C_BAD,
    /* 11 */  C_MODRM,
    /* 12 */  C_MODRM+C_BAD,
    /* 13 */  C_MODRM,
    /* 14 */  C_DATA1+C_BAD,
    /* 15 */  C_DATA66+C_BAD,
    /* 16 */  C_BAD,
    /* 17 */  C_BAD,
    /* 18 */  C_MODRM+C_BAD,
    /* 19 */  C_MODRM,
    /* 1A */  C_MODRM,
    /* 1B */  C_MODRM,
    /* 1C */  C_DATA1+C_BAD,
    /* 1D */  C_DATA66+C_BAD,
    /* 1E */  C_BAD,
    /* 1F */  C_BAD,
    /* 20 */  C_MODRM,
    /* 21 */  C_MODRM,
    /* 22 */  C_MODRM,
    /* 23 */  C_MODRM,
    /* 24 */  C_DATA1,
    /* 25 */  C_DATA66,
    /* 26 */  C_SEG+C_BAD,
    /* 27 */  C_BAD,
    /* 28 */  C_MODRM,
    /* 29 */  C_MODRM,
    /* 2A */  C_MODRM,
    /* 2B */  C_MODRM,
    /* 2C */  C_DATA1,
    /* 2D */  C_DATA66,
    /* 2E */  C_SEG+C_BAD,
    /* 2F */  C_BAD,
    /* 30 */  C_MODRM,
    /* 31 */  C_MODRM,
    /* 32 */  C_MODRM,
    /* 33 */  C_MODRM,
    /* 34 */  C_DATA1,
    /* 35 */  C_DATA66,
    /* 36 */  C_SEG+C_BAD,
    /* 37 */  C_BAD,
    /* 38 */  C_MODRM,
    /* 39 */  C_MODRM,
    /* 3A */  C_MODRM,
    /* 3B */  C_MODRM,
    /* 3C */  C_DATA1,
    /* 3D */  C_DATA66,
    /* 3E */  C_SEG+C_BAD,
    /* 3F */  C_BAD,
    /* 40 */  0,
    /* 41 */  0,
    /* 42 */  0,
    /* 43 */  0,
    /* 44 */  C_BAD,
    /* 45 */  0,
    /* 46 */  0,
    /* 47 */  0,
    /* 48 */  0,
    /* 49 */  0,
    /* 4A */  0,
    /* 4B */  0,
    /* 4C */  C_BAD,
    /* 4D */  0,
    /* 4E */  0,
    /* 4F */  0,
    /* 50 */  0,
    /* 51 */  0,
    /* 52 */  0,
    /* 53 */  0,
    /* 54 */  0,
    /* 55 */  0,
    /* 56 */  0,
    /* 57 */  0,
    /* 58 */  0,
    /* 59 */  0,
    /* 5A */  0,
    /* 5B */  0,
    /* 5C */  C_BAD,
    /* 5D */  0,
    /* 5E */  0,
    /* 5F */  0,
    /* 60 */  C_BAD,
    /* 61 */  C_BAD,
    /* 62 */  C_MODRM+C_BAD,
    /* 63 */  C_MODRM+C_BAD,
    /* 64 */  C_SEG,
    /* 65 */  C_SEG+C_BAD,
    /* 66 */  C_66,
    /* 67 */  C_67,
    /* 68 */  C_DATA66,
    /* 69 */  C_MODRM+C_DATA66,
    /* 6A */  C_DATA1,
    /* 6B */  C_MODRM+C_DATA1,
    /* 6C */  C_BAD,
    /* 6D */  C_BAD,
    /* 6E */  C_BAD,
    /* 6F */  C_BAD,
    /* 70 */  C_DATA1+C_REL+C_BAD,
    /* 71 */  C_DATA1+C_REL+C_BAD,
    /* 72 */  C_DATA1+C_REL,
    /* 73 */  C_DATA1+C_REL,
    /* 74 */  C_DATA1+C_REL,
    /* 75 */  C_DATA1+C_REL,
    /* 76 */  C_DATA1+C_REL,
    /* 77 */  C_DATA1+C_REL,
    /* 78 */  C_DATA1+C_REL,
    /* 79 */  C_DATA1+C_REL,
    /* 7A */  C_DATA1+C_REL+C_BAD,
    /* 7B */  C_DATA1+C_REL+C_BAD,
    /* 7C */  C_DATA1+C_REL,
    /* 7D */  C_DATA1+C_REL,
    /* 7E */  C_DATA1+C_REL,
    /* 7F */  C_DATA1+C_REL,
    /* 80 */  C_MODRM+C_DATA1,
    /* 81 */  C_MODRM+C_DATA66,
    /* 82 */  C_MODRM+C_DATA1+C_BAD,
    /* 83 */  C_MODRM+C_DATA1,
    /* 84 */  C_MODRM,
    /* 85 */  C_MODRM,
    /* 86 */  C_MODRM,
    /* 87 */  C_MODRM,
    /* 88 */  C_MODRM,
    /* 89 */  C_MODRM,
    /* 8A */  C_MODRM,
    /* 8B */  C_MODRM,
    /* 8C */  C_MODRM+C_BAD,
    /* 8D */  C_MODRM,
    /* 8E */  C_MODRM+C_BAD,
    /* 8F */  C_MODRM,
    /* 90 */  0,
    /* 91 */  0,
    /* 92 */  0,
    /* 93 */  C_BAD,
    /* 94 */  C_BAD,
    /* 95 */  C_BAD,
    /* 96 */  C_BAD,
    /* 97 */  C_BAD,
    /* 98 */  C_BAD,
    /* 99 */  0,
    /* 9A */  C_DATA66+C_DATA2+C_BAD,
    /* 9B */  0,
    /* 9C */  C_BAD,
    /* 9D */  C_BAD,
    /* 9E */  C_BAD,
    /* 9F */  C_BAD,
    /* A0 */  C_ADDR67,
    /* A1 */  C_ADDR67,
    /* A2 */  C_ADDR67,
    /* A3 */  C_ADDR67,
    /* A4 */  0,
    /* A5 */  0,
    /* A6 */  0,
    /* A7 */  0,
    /* A8 */  C_DATA1,
    /* A9 */  C_DATA66,
    /* AA */  0,
    /* AB */  0,
    /* AC */  0,
    /* AD */  C_BAD,
    /* AE */  0,
    /* AF */  C_BAD,
    /* B0 */  C_DATA1,
    /* B1 */  C_DATA1,
    /* B2 */  C_DATA1,
    /* B3 */  C_DATA1,
    /* B4 */  C_DATA1,
    /* B5 */  C_DATA1,
    /* B6 */  C_DATA1+C_BAD,
    /* B7 */  C_DATA1+C_BAD,
    /* B8 */  C_DATA66,
    /* B9 */  C_DATA66,
    /* BA */  C_DATA66,
    /* BB */  C_DATA66,
    /* BC */  C_DATA66+C_BAD,
    /* BD */  C_DATA66,
    /* BE */  C_DATA66,
    /* BF */  C_DATA66,
    /* C0 */  C_MODRM+C_DATA1,
    /* C1 */  C_MODRM+C_DATA1,
    /* C2 */  C_DATA2+C_STOP,
    /* C3 */  C_STOP,
    /* C4 */  C_MODRM+C_BAD,
    /* C5 */  C_MODRM+C_BAD,
    /* C6 */  C_MODRM+C_DATA1,
    /* C7 */  C_MODRM+C_DATA66,
    /* C8 */  C_DATA2+C_DATA1,
    /* C9 */  0,
    /* CA */  C_DATA2+C_STOP+C_BAD,
    /* CB */  C_STOP+C_BAD,
    /* CC */  C_BAD,
    /* CD */  C_BAD,
    /* CE */  C_BAD,
    /* CF */  C_STOP+C_BAD,
    /* D0 */  C_MODRM,
    /* D1 */  C_MODRM,
    /* D2 */  C_MODRM,
    /* D3 */  C_MODRM,
    /* D4 */  C_DATA1+C_BAD,
    /* D5 */  C_DATA1+C_BAD,
    /* D6 */  C_BAD,
    /* D7 */  C_BAD,
    /* D8 */  C_MODRM,
    /* D9 */  C_MODRM,
    /* DA */  C_MODRM,
    /* DB */  C_MODRM,
    /* DC */  C_MODRM,
    /* DD */  C_MODRM,
    /* DE */  C_MODRM,
    /* DF */  C_MODRM,
    /* E0 */  C_DATA1+C_REL+C_BAD,
    /* E1 */  C_DATA1+C_REL+C_BAD,
    /* E2 */  C_DATA1+C_REL,
    /* E3 */  C_DATA1+C_REL,
    /* E4 */  C_DATA1+C_BAD,
    /* E5 */  C_DATA1+C_BAD,
    /* E6 */  C_DATA1+C_BAD,
    /* E7 */  C_DATA1+C_BAD,
    /* E8 */  C_DATA66+C_REL,
    /* E9 */  C_DATA66+C_REL+C_STOP,
    /* EA */  C_DATA66+C_DATA2+C_BAD,
    /* EB */  C_DATA1+C_REL+C_STOP,
    /* EC */  C_BAD,
    /* ED */  C_BAD,
    /* EE */  C_BAD,
    /* EF */  C_BAD,
    /* F0 */  C_LOCK+C_BAD,
    /* F1 */  C_BAD,
    /* F2 */  C_REP,
    /* F3 */  C_REP,
    /* F4 */  C_BAD,
    /* F5 */  C_BAD,
    /* F6 */  C_MODRM,
    /* F7 */  C_MODRM,
    /* F8 */  0,
    /* F9 */  0,
    /* FA */  C_BAD,
    /* FB */  C_BAD,
    /* FC */  0,
    /* FD */  0,
    /* FE */  C_MODRM,
    /* FF */  C_MODRM,
    /* 00 */  C_MODRM,
    /* 01 */  C_MODRM,
    /* 02 */  C_MODRM,
    /* 03 */  C_MODRM,
    /* 04 */  C_ERROR,
    /* 05 */  C_ERROR,
    /* 06 */  0,
    /* 07 */  C_ERROR,
    /* 08 */  0,
    /* 09 */  0,
    /* 0A */  0,
    /* 0B */  0,
    /* 0C */  C_ERROR,
    /* 0D */  C_ERROR,
    /* 0E */  C_ERROR,
    /* 0F */  C_ERROR,
    /* 10 */  C_ERROR,
    /* 11 */  C_ERROR,
    /* 12 */  C_ERROR,
    /* 13 */  C_ERROR,
    /* 14 */  C_ERROR,
    /* 15 */  C_ERROR,
    /* 16 */  C_ERROR,
    /* 17 */  C_ERROR,
    /* 18 */  C_ERROR,
    /* 19 */  C_ERROR,
    /* 1A */  C_ERROR,
    /* 1B */  C_ERROR,
    /* 1C */  C_ERROR,
    /* 1D */  C_ERROR,
    /* 1E */  C_ERROR,
    /* 1F */  C_ERROR,
    /* 20 */  C_ERROR,
    /* 21 */  C_ERROR,
    /* 22 */  C_ERROR,
    /* 23 */  C_ERROR,
    /* 24 */  C_ERROR,
    /* 25 */  C_ERROR,
    /* 26 */  C_ERROR,
    /* 27 */  C_ERROR,
    /* 28 */  C_ERROR,
    /* 29 */  C_ERROR,
    /* 2A */  C_ERROR,
    /* 2B */  C_ERROR,
    /* 2C */  C_ERROR,
    /* 2D */  C_ERROR,
    /* 2E */  C_ERROR,
    /* 2F */  C_ERROR,
    /* 30 */  C_ERROR,
    /* 31 */  C_ERROR,
    /* 32 */  C_ERROR,
    /* 33 */  C_ERROR,
    /* 34 */  C_ERROR,
    /* 35 */  C_ERROR,
    /* 36 */  C_ERROR,
    /* 37 */  C_ERROR,
    /* 38 */  C_ERROR,
    /* 39 */  C_ERROR,
    /* 3A */  C_ERROR,
    /* 3B */  C_ERROR,
    /* 3C */  C_ERROR,
    /* 3D */  C_ERROR,
    /* 3E */  C_ERROR,
    /* 3F */  C_ERROR,
    /* 40 */  C_ERROR,
    /* 41 */  C_ERROR,
    /* 42 */  C_ERROR,
    /* 43 */  C_ERROR,
    /* 44 */  C_ERROR,
    /* 45 */  C_ERROR,
    /* 46 */  C_ERROR,
    /* 47 */  C_ERROR,
    /* 48 */  C_ERROR,
    /* 49 */  C_ERROR,
    /* 4A */  C_ERROR,
    /* 4B */  C_ERROR,
    /* 4C */  C_ERROR,
    /* 4D */  C_ERROR,
    /* 4E */  C_ERROR,
    /* 4F */  C_ERROR,
    /* 50 */  C_ERROR,
    /* 51 */  C_ERROR,
    /* 52 */  C_ERROR,
    /* 53 */  C_ERROR,
    /* 54 */  C_ERROR,
    /* 55 */  C_ERROR,
    /* 56 */  C_ERROR,
    /* 57 */  C_ERROR,
    /* 58 */  C_ERROR,
    /* 59 */  C_ERROR,
    /* 5A */  C_ERROR,
    /* 5B */  C_ERROR,
    /* 5C */  C_ERROR,
    /* 5D */  C_ERROR,
    /* 5E */  C_ERROR,
    /* 5F */  C_ERROR,
    /* 60 */  C_ERROR,
    /* 61 */  C_ERROR,
    /* 62 */  C_ERROR,
    /* 63 */  C_ERROR,
    /* 64 */  C_ERROR,
    /* 65 */  C_ERROR,
    /* 66 */  C_ERROR,
    /* 67 */  C_ERROR,
    /* 68 */  C_ERROR,
    /* 69 */  C_ERROR,
    /* 6A */  C_ERROR,
    /* 6B */  C_ERROR,
    /* 6C */  C_ERROR,
    /* 6D */  C_ERROR,
    /* 6E */  C_ERROR,
    /* 6F */  C_ERROR,
    /* 70 */  C_ERROR,
    /* 71 */  C_ERROR,
    /* 72 */  C_ERROR,
    /* 73 */  C_ERROR,
    /* 74 */  C_ERROR,
    /* 75 */  C_ERROR,
    /* 76 */  C_ERROR,
    /* 77 */  C_ERROR,
    /* 78 */  C_ERROR,
    /* 79 */  C_ERROR,
    /* 7A */  C_ERROR,
    /* 7B */  C_ERROR,
    /* 7C */  C_ERROR,
    /* 7D */  C_ERROR,
    /* 7E */  C_ERROR,
    /* 7F */  C_ERROR,
    /* 80 */  C_DATA66+C_REL,
    /* 81 */  C_DATA66+C_REL,
    /* 82 */  C_DATA66+C_REL,
    /* 83 */  C_DATA66+C_REL,
    /* 84 */  C_DATA66+C_REL,
    /* 85 */  C_DATA66+C_REL,
    /* 86 */  C_DATA66+C_REL,
    /* 87 */  C_DATA66+C_REL,
    /* 88 */  C_DATA66+C_REL,
    /* 89 */  C_DATA66+C_REL,
    /* 8A */  C_DATA66+C_REL,
    /* 8B */  C_DATA66+C_REL,
    /* 8C */  C_DATA66+C_REL,
    /* 8D */  C_DATA66+C_REL,
    /* 8E */  C_DATA66+C_REL,
    /* 8F */  C_DATA66+C_REL,
    /* 90 */  C_MODRM,
    /* 91 */  C_MODRM,
    /* 92 */  C_MODRM,
    /* 93 */  C_MODRM,
    /* 94 */  C_MODRM,
    /* 95 */  C_MODRM,
    /* 96 */  C_MODRM,
    /* 97 */  C_MODRM,
    /* 98 */  C_MODRM,
    /* 99 */  C_MODRM,
    /* 9A */  C_MODRM,
    /* 9B */  C_MODRM,
    /* 9C */  C_MODRM,
    /* 9D */  C_MODRM,
    /* 9E */  C_MODRM,
    /* 9F */  C_MODRM,
    /* A0 */  0,
    /* A1 */  0,
    /* A2 */  0,
    /* A3 */  C_MODRM,
    /* A4 */  C_MODRM+C_DATA1,
    /* A5 */  C_MODRM,
    /* A6 */  C_ERROR,
    /* A7 */  C_ERROR,
    /* A8 */  0,
    /* A9 */  0,
    /* AA */  0,
    /* AB */  C_MODRM,
    /* AC */  C_MODRM+C_DATA1,
    /* AD */  C_MODRM,
    /* AE */  C_ERROR,
    /* AF */  C_MODRM,
    /* B0 */  C_MODRM,
    /* B1 */  C_MODRM,
    /* B2 */  C_MODRM,
    /* B3 */  C_MODRM,
    /* B4 */  C_MODRM,
    /* B5 */  C_MODRM,
    /* B6 */  C_MODRM,
    /* B7 */  C_MODRM,
    /* B8 */  C_ERROR,
    /* B9 */  C_ERROR,
    /* BA */  C_MODRM+C_DATA1,
    /* BB */  C_MODRM,
    /* BC */  C_MODRM,
    /* BD */  C_MODRM,
    /* BE */  C_MODRM,
    /* BF */  C_MODRM,
    /* C0 */  C_MODRM,
    /* C1 */  C_MODRM,
    /* C2 */  C_ERROR,
    /* C3 */  C_ERROR,
    /* C4 */  C_ERROR,
    /* C5 */  C_ERROR,
    /* C6 */  C_ERROR,
    /* C7 */  C_ERROR,
    /* C8 */  0,
    /* C9 */  0,
    /* CA */  0,
    /* CB */  0,
    /* CC */  0,
    /* CD */  C_DATA1,
    /* CE */  0,
    /* CF */  0,
    /* D0 */  C_ERROR,
    /* D1 */  C_ERROR,
    /* D2 */  C_ERROR,
    /* D3 */  C_ERROR,
    /* D4 */  C_ERROR,
    /* D5 */  C_ERROR,
    /* D6 */  C_ERROR,
    /* D7 */  C_ERROR,
    /* D8 */  C_ERROR,
    /* D9 */  C_ERROR,
    /* DA */  C_ERROR,
    /* DB */  C_ERROR,
    /* DC */  C_ERROR,
    /* DD */  C_ERROR,
    /* DE */  C_ERROR,
    /* DF */  C_ERROR,
    /* E0 */  C_ERROR,
    /* E1 */  C_ERROR,
    /* E2 */  C_ERROR,
    /* E3 */  C_ERROR,
    /* E4 */  C_ERROR,
    /* E5 */  C_ERROR,
    /* E6 */  C_ERROR,
    /* E7 */  C_ERROR,
    /* E8 */  C_ERROR,
    /* E9 */  C_ERROR,
    /* EA */  C_ERROR,
    /* EB */  C_ERROR,
    /* EC */  C_ERROR,
    /* ED */  C_ERROR,
    /* EE */  C_ERROR,
    /* EF */  C_ERROR,
    /* F0 */  C_ERROR,
    /* F1 */  C_ERROR,
    /* F2 */  C_ERROR,
    /* F3 */  C_ERROR,
    /* F4 */  C_ERROR,
    /* F5 */  C_ERROR,
    /* F6 */  C_ERROR,
    /* F7 */  C_ERROR,
    /* F8 */  C_ERROR,
    /* F9 */  C_ERROR,
    /* FA */  C_ERROR,
    /* FB */  C_ERROR,
    /* FC */  C_ERROR,
    /* FD */  C_ERROR,
    /* FE */  C_ERROR,
    /* FF */  C_ERROR
    }; // ade32_table[]
    
    
    int disasm(BYTE* opcode0, disasm_struct* diza){
    	BYTE* opcode = opcode0;
    
    	memset(diza, 0x00, sizeof(disasm_struct));
    	diza->disasm_defdata = 4;
    	diza->disasm_defaddr = 4;
    
    	if(*(WORD*)opcode == 0x0000)
    		return 0;
    	if(*(WORD*)opcode == 0xFFFF)
    		return 0;
    
    	DWORD flag = 0;
    
    repeat_prefix:
    
    	BYTE c = *opcode++;
    	DWORD t = ade32_table[ c ];
    
    	if(t & C_ANYPREFIX){
    		if(flag & t)
    			return 0;
    
    		flag |= t;
    
    		if(t & C_67)
    			diza->disasm_defaddr ^= 2^4;
    		else if(t & C_66)
    			diza->disasm_defdata ^= 2^4;
    		else if(t & C_SEG)
    			diza->disasm_seg = c;
    		else if(t & C_REP)
    			diza->disasm_rep = c;
    		// LOCK
    
    		goto repeat_prefix;
    	} // C_ANYPREFIX
    
    	flag |= t;
    	diza->disasm_opcode = c;
    
    	if(c == 0x0F){
    		c = *opcode++;
    		diza->disasm_opcode2 = c;
    		flag |= ade32_table[256+c]; // 2nd flagtable half
    		
    		if(flag == C_ERROR)
    			return 0;
    	}else if(c == 0xF7){
    		if(((*opcode) & 0x38) == 0)
    			flag |= C_DATA66;
    	}else if(c == 0xF6){
    		if(((*opcode) & 0x38) == 0)
    			flag |= C_DATA1;
    	}else if(c == 0xCD){
    		if(*opcode == 0x20)
    			flag |= C_DATA4;
    	}
    
    	if(flag & C_MODRM){
    		c = *opcode++;
    		diza->disasm_modrm = c;
    
    		if(((c & 0x38) == 0x20) && (diza->disasm_opcode == 0xFF))
    			flag |= C_STOP;
    
    		BYTE mod = c & 0xC0;
    		BYTE rm  = c & 0x07;
    
    		if(mod != 0xC0){
    			if(diza->disasm_defaddr == 4){
    				if(rm == 4){
    					flag |= C_SIB;
    					c = *opcode++;
    					diza->disasm_sib = c;
    					rm = c & 0x07;
    				}
    
    				if(mod == 0x40)
    					flag |= C_ADDR1;
    				else if(mod == 0x80)
    					flag |= C_ADDR4;
    				else if (rm == 5)
    					flag |= C_ADDR4;
    			}else{ // MODRM 16-bit
    				if(mod == 0x40)
    					flag |= C_ADDR1;
    				else if(mod == 0x80)
    					flag |= C_ADDR2;
    				else if(rm == 6)
    					flag |= C_ADDR2;
    			}
    		}
    	} // C_MODRM
    
    	diza->disasm_flag = flag;
    
    	DWORD a =  flag & (C_ADDR1 | C_ADDR2 | C_ADDR4);
    	DWORD d = (flag & (C_DATA1 | C_DATA2 | C_DATA4)) >> 8;
    
    	if(flag & C_ADDR67)
    		a += diza->disasm_defaddr;
    	if(flag & C_DATA66)
    		d += diza->disasm_defdata;
    
    	diza->disasm_addrsize = a;
    	diza->disasm_datasize = d;
    
    	DWORD i;
    	for(i = 0; i < a; i++)
    		diza->disasm_addr_b[i] = *opcode++;
    
    	for(i = 0; i < d; i++)
    		diza->disasm_data_b[i] = *opcode++;
    
    	diza->disasm_len = opcode - opcode0;
    
    	return diza->disasm_len;
    } // disasm()
    
    int oplen(BYTE *opcode){
    	disasm_struct diza;
    	memset(&diza,0,sizeof(diza));
    	
    	disasm((BYTE*)opcode,&diza);
    
    	if((diza.disasm_flag == C_ERROR) || ((diza.disasm_flag&C_STOP) == C_STOP) || ((diza.disasm_flag&C_REL)==C_REL) || ((diza.disasm_flag&C_BAD)==C_BAD))
    		return -1;
    
    	return diza.disasm_len;
    }
    Menu Code:
    Code:
    #include "Menu.h"
    #include <stdio.h>
    
    char		Title[1]="";	  // Some room for a title
    int 		Pos = 0;			  // current highlighted menuitem	
    int 		Max = 0;			  // number of menu items
    int			XOfs = 114;	  // offset for option text 160 | 130 | 114
    int			YSize = 14;	  // heigh of a menuline 14
    int			Mysize=13;
    int			Visible = 0;
    
    RECT rect;
    RECT rect2;
    RECT rect3;
    
    struct {
      int  typ;		  // type of menuline, folder, item
      char *txt;	  // text to show
      char **opt;	  // array of options
      int  *var;	  // variable containing current status
      int  maxvalue;  // maximumvalue,  normally 1  gives  0=off  1=on
    } MENU[MENUMAXITEMS];
    
    void MenuAddItem(char *txt, char **opt, int *var, int maxvalue, int typ)
    {
      MENU[Max].typ=typ;
      MENU[Max].txt=txt;
      MENU[Max].opt=opt;
      MENU[Max].var=var;
      MENU[Max].maxvalue=maxvalue;
      Max++;
      frame=(Max*Mysize+20);
    }
    
    void MenuAddText(char *txt, char* opt)
    {
    	MenuAddItem(txt,(char**)opt, 0, 0, MENUTEXT);
    }
    
    void MenuShow(int x, int y,	ID3DXFont *pFont)
    {
    
      int i, val;
      DWORD color;
        SetRect( &rect, x+XOfs/2, y, x+XOfs /2 , y );
      if (!Visible) return;
    
      if (Title[0]) {
    
    	  pFont->DrawTextA(NULL,Title,-1,&rect,DT_NOCLIP | DT_CENTER, MCOLOR_TITLE);
    
    	  y+=Mysize;
      }
       for (i=0; i<Max; i++) {
    	   val=(MENU[i].var)?(*MENU[i].var):0;
    	 
           if (i==Pos)
    		   color=MCOLOR_CURRENT;
           else if (MENU[i].typ==MENUFOLDER)
               color=MCOLOR_FOLDER;
           else if (MENU[i].typ==MENUTEXT)
               color=MCOLOR_TEXT;
           else
    		   color=(val)?MCOLOR_ACTIVE:MCOLOR_INACTIVE;//color=(val)?Orange:MCOLOR_INACTIVE;
         SetRect( &rect3, x, y, x , y );
         SetRect( &rect2, x+XOfs, y, x+XOfs , y );
    	   pFont->DrawTextA(NULL,MENU[i].txt,-1,&rect3, DT_NOCLIP,color);
           if (MENU[i].opt) {
    		   if (MENU[i].typ==MENUTEXT)
    		   	   pFont->DrawTextA(NULL,(char *)MENU[i].opt,-1,&rect2, DT_NOCLIP | DT_RIGHT, color);
    		   else
    			   pFont->DrawTextA(NULL,(char *)MENU[i].opt[val],-1,&rect2, DT_NOCLIP | DT_RIGHT, color);
    	   }
           y+=Mysize;
      }
    }
    
    void MenuNav(void)
    {
      if (GetAsyncKeyState(VK_INSERT)&1) Visible=(!Visible);
      if (!Visible) return;
    
      if (GetAsyncKeyState(VK_UP)&1) {
    		do {
    			Pos--;
    			if (Pos<0)  Pos=Max-1;
    		} while (MENU[Pos].typ==MENUTEXT);		// skip textitems
      } else if (GetAsyncKeyState(VK_DOWN)&1) {
    		do {
    			Pos++;
    		    if (Pos==Max) Pos=0;
    		} while (MENU[Pos].typ==MENUTEXT);		// skip textitems
      } else if (MENU[Pos].var) {
    		int dir=0;
    		// bugfix: thx to ***-Wieter20
    		if (GetAsyncKeyState(VK_LEFT )&1 && *MENU[Pos].var > 0                      ) dir=-1;
    		if (GetAsyncKeyState(VK_RIGHT)&1 && *MENU[Pos].var < (MENU[Pos].maxvalue-1)) dir=1;
    		if (dir) {
    			*MENU[Pos].var += dir;
    			if (MENU[Pos].typ==MENUFOLDER) Max=0;  // change on menufolder, force a rebuild
    		}
      }
    }
    Detour Code:
    Code:
    #include "Detour.h"
    #include "ADE32.h"
    
    #pragma warning(disable: 4311)
    #pragma warning(disable: 4312)
    #pragma warning(disable: 4244)
    
    #define DETOUR_MAX_SRCH_OPLEN 64
    
    #define JMP32_SZ 5
    #define BIT32_SZ 4
    
    // jmp32 sig
    #define SIG_SZ 3
    #define SIG_OP_0 0xCC
    #define SIG_OP_1 0x90
    #define SIG_OP_2 0xC3
    
    static DWORD dwOldProt;
    
    int GetDetourLen(int patchType);
    int GetDetourLenAuto(PBYTE &pbFuncOrig, int minDetLen);
    
    // Thin wrapper for APIs
    LPVOID DetourCreate(LPCSTR lpModuleName, LPCSTR lpProcName, LPVOID lpFuncDetour, int patchType, int detourLen)
    {
    	LPVOID lpFuncOrig = NULL;
    		
    	if((lpFuncOrig = GetProcAddress(GetModuleHandleA(lpModuleName), lpProcName)) == NULL)
    		return NULL;
    
    	return DetourCreate(lpFuncOrig, lpFuncDetour, patchType, detourLen);
    }
    
    LPVOID DetourCreate(LPVOID lpFuncOrig, LPVOID lpFuncDetour, int patchType, int detourLen)
    {
    	LPVOID lpMallocPtr = NULL;
    	DWORD dwProt = NULL;
    	PBYTE pbMallocPtr = NULL;
    	PBYTE pbFuncOrig = (PBYTE)lpFuncOrig;
    	PBYTE pbFuncDetour = (PBYTE)lpFuncDetour;
    	PBYTE pbPatchBuf = NULL;
    	int minDetLen = 0;
    	int detLen = 0;
    
    	// Get detour length
    	if((minDetLen = GetDetourLen(patchType)) == 0)
    		return NULL;
    
    	if(detourLen != DETOUR_LEN_AUTO)
    		detLen = detourLen;
    
    	else if((detLen = GetDetourLenAuto(pbFuncOrig, minDetLen)) < minDetLen)
    		return NULL;
    
    	// Alloc mem for the overwritten bytes
    	if((lpMallocPtr = (LPVOID)malloc(detLen+JMP32_SZ+SIG_SZ)) == NULL)
    		return NULL;
    
    	pbMallocPtr = (PBYTE)lpMallocPtr;
    
    	// Enable writing to original
    	VirtualProtect(lpFuncOrig, detLen, PAGE_READWRITE, &dwProt);
    
    	// Write overwritten bytes to the malloc
    	memcpy(lpMallocPtr, lpFuncOrig, detLen);
    	pbMallocPtr += detLen;
    	pbMallocPtr[0] = 0xE9;
    	*(DWORD*)(pbMallocPtr+1) = (DWORD)((pbFuncOrig+detLen)-pbMallocPtr)-JMP32_SZ;
    	pbMallocPtr += JMP32_SZ;
    	pbMallocPtr[0] = SIG_OP_0;
    	pbMallocPtr[1] = SIG_OP_1;
    	pbMallocPtr[2] = SIG_OP_2;
    
    	// Create a buffer to prepare the detour bytes
    	pbPatchBuf = new BYTE[detLen];
    	memset(pbPatchBuf, 0x90, detLen);
    
    	switch(patchType)
    	{
    		case DETOUR_TYPE_JMP:
    			pbPatchBuf[0] = 0xE9;
    			*(DWORD*)&pbPatchBuf[1] = (DWORD)(pbFuncDetour - pbFuncOrig) - 5;
    			break;
    
    		case DETOUR_TYPE_PUSH_RET:
    			pbPatchBuf[0] = 0x68;
    			*(DWORD*)&pbPatchBuf[1] = (DWORD)pbFuncDetour;
    			pbPatchBuf[5] = 0xC3;
    			break;
    
    		case DETOUR_TYPE_NOP_JMP:
    			pbPatchBuf[0] = 0x90;
    			pbPatchBuf[1] = 0xE9;
    			*(DWORD*)&pbPatchBuf[2] = (DWORD)(pbFuncDetour - pbFuncOrig) - 6;
    			break;
    
    		case DETOUR_TYPE_NOP_NOP_JMP:
    			pbPatchBuf[0] = 0x90;
    			pbPatchBuf[1] = 0x90;
    			pbPatchBuf[2] = 0xE9;
    			*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
    			break;
    
    		case DETOUR_TYPE_STC_JC:
    			pbPatchBuf[0] = 0xF9;
    			pbPatchBuf[1] = 0x0F;
    			pbPatchBuf[2] = 0x82;
    			*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
    			break;
    
    		case DETOUR_TYPE_CLC_JNC:
    			pbPatchBuf[0] = 0xF8;
    			pbPatchBuf[1] = 0x0F;
    			pbPatchBuf[2] = 0x83;
    			*(DWORD*)&pbPatchBuf[3] = (DWORD)(pbFuncDetour - pbFuncOrig) - 7;
    			break;
    		
    		default:
    			return NULL;
    	}
    
    	// Write the detour
    	for(int i=0; i<detLen; i++)
    		pbFuncOrig[i] = pbPatchBuf[i];
    
    	delete [] pbPatchBuf;
    
    	// Reset original mem flags
    	VirtualProtect(lpFuncOrig, detLen, dwProt, &dwOldProt);
    
    	return lpMallocPtr;
    }
    
    BOOL DetourRemove(LPVOID lpDetourCreatePtr)
    {
    	PBYTE pbMallocPtr = NULL;
    	DWORD dwFuncOrig = NULL;
    	DWORD dwProt = NULL;
    	int i=0;
    
    	if((pbMallocPtr = (PBYTE)lpDetourCreatePtr) == NULL)
    		return FALSE;
    
    	// Find the orig jmp32 opcode sig
    	for(i=0; i<=DETOUR_MAX_SRCH_OPLEN; i++)
    	{
    		if(pbMallocPtr[i] == SIG_OP_0 
    			&& pbMallocPtr[i+1] == SIG_OP_1
    			&& pbMallocPtr[i+2] == SIG_OP_2)
    			break;
    
    		if(i == DETOUR_MAX_SRCH_OPLEN)
    			return FALSE;
    	}
    
    	// Calculate the original address
    	pbMallocPtr += (i-JMP32_SZ+1); // Inc to jmp
    	dwFuncOrig = *(DWORD*)pbMallocPtr; // Get 32bit jmp
    	pbMallocPtr += BIT32_SZ; // Inc to end of jmp
    	dwFuncOrig += (DWORD)pbMallocPtr; // Add this addr to 32bit jmp
    	dwFuncOrig -= (i-JMP32_SZ); // Dec by detour len to get to start of orig
    
    	// Write the overwritten bytes back to the original
    	VirtualProtect((LPVOID)dwFuncOrig, (i-JMP32_SZ), PAGE_READWRITE, &dwProt);
    	memcpy((LPVOID)dwFuncOrig, lpDetourCreatePtr, (i-JMP32_SZ));
    	VirtualProtect((LPVOID)dwFuncOrig, (i-JMP32_SZ), dwProt, &dwOldProt);
    
    	// Memory cleanup
    	free(lpDetourCreatePtr);
    
    	return TRUE;
    }
    
    int GetDetourLen(int patchType)
    {
    	switch(patchType)
    	{
    		case DETOUR_TYPE_JMP:
    			return 5;
    
    		case DETOUR_TYPE_PUSH_RET:
    		case DETOUR_TYPE_NOP_JMP:
    			return 6;
    		
    		case DETOUR_TYPE_NOP_NOP_JMP:
    		case DETOUR_TYPE_STC_JC:
    		case DETOUR_TYPE_CLC_JNC:
    			return 7;
    		
    		default:
    			return 0;
    	}
    }
    
    int GetDetourLenAuto(PBYTE &pbFuncOrig, int minDetLen)
    {
    	int len = 0;
    	PBYTE pbCurOp = pbFuncOrig;
    
    	while(len < minDetLen)
    	{
    		int i = oplen(pbCurOp);
    		
    		if(i == 0 || i == -1)
    			return 0;
    
    		if(len > DETOUR_MAX_SRCH_OPLEN)
    			return 0;
    
    		len += i;
    		pbCurOp += i;
    	}
    
    	return len;
    }
    This is COOlGuys' Menu Base.

    Now can someone please give some help?

  3. #18
    Synns's Avatar
    Join Date
    May 2007
    Gender
    male
    Posts
    5,174
    Reputation
    170
    Thanks
    2,557
    My Mood
    Bitchy
    [
    Add

    #pragma comment( lib, "d3dx9.lib" )

    Up at the top of Base.cpp ...

  4. #19
    CodeDemon's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    vagina
    Posts
    1,070
    Reputation
    50
    Thanks
    940
    My Mood
    Fine
    OP Is stupid and does not listen to the advice given to him. You have to pragma the library file...

  5. #20
    DreadKyller's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    122
    Reputation
    12
    Thanks
    21
    OMG, YOU DON'T FKIN LISTEN!!!!!!

    I DO NOT NED THE D3DX9 ANYMORE YOU SHITS!!!!!

    I SAID OVER 5 TIMES ALREADY THAT THAT IS FIXED. OPEN YOUR FKIN EYES.

    I Tried adding #pragma comment( lib, "d3dx9.lib" ) at the top as soon as it was suggested for your information, I have tried EVERYTHING neamed on this thread, NOTHING WORKS.

  6. #21
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    Wow. You have lost all your help. Jump in a river.

    Because you either have to include the lib file in the project then add the d3dx9.lib.
    Cause thats the only reason. You just fail hard.
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  7. #22
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,881
    Reputation
    163
    Thanks
    3,291
    My Mood
    Sleepy
    I know how to fix your error.

  8. #23
    CodeDemon's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    vagina
    Posts
    1,070
    Reputation
    50
    Thanks
    940
    My Mood
    Fine
    Quote Originally Posted by Crash View Post
    I know how to fix your error.
    I bet it involves money and a book

  9. The Following User Says Thank You to CodeDemon For This Useful Post:

    whatup777 (10-05-2010)

  10. #24
    DreadKyller's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    122
    Reputation
    12
    Thanks
    21
    Do any of you understand at all? I already tried putting in d3dx9 every possible way I could find looking everywhere on the net, I can officially conclude my problem does not have anything at all to do with d3dx9.

    Wow crash, can you please say it then, maybe you'll be the first person here who understands what I'm asking.

  11. #25
    whatup777's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    CA Source Code Section
    Posts
    4,025
    Reputation
    147
    Thanks
    351
    My Mood
    Dead
    I bet he will. /
    Quotes I live by.


    A foolish person learns from his mistakes, I wise person learns from others.
    Quote Originally Posted by AVGN View Post



    mhm

    i live in texas

    i was at the grocery store with my son. He saw a mexican guy, and he said "Look daddy! a mower man!"

    he's 4 yrs old

  12. #26
    NOOBJr's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in NOOB
    Posts
    1,423
    Reputation
    112
    Thanks
    693
    How about just stick to hot key hacks. If you can actually do that i mean!

  13. #27
    |Drake™|'s Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    365
    Reputation
    10
    Thanks
    84
    When you include the d3dx9 , make sure you use x86 if your vista or 7.

  14. #28
    DreadKyller's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    122
    Reputation
    12
    Thanks
    21
    Just because I am new to programming does not mean I need to fkin listen to people bitching about shit. May I remind you not to fkin insult me cause at first you were just a bad off.

    My point is what in the fuck is this site but a good place to post working hacks but a hell hole of a place to get help. If you ask for help people practically say figure out on your own, WHY DO YOU THINK I AM POSTING IN THE HELP SECTION DUMB @$$ES?????

    I not need no fkin abuse from shit.

    If no one is even going to try to help anyone at all then damn you all to hell.

    And yes I can make a fkin hotkey hack, the problem is those are never used because people never like them. Personally I can't ever remember what fkin keys are what. essecially when trying to include as many features as I am trying, I do not want to make like 80 hot keys.
    Last edited by DreadKyller; 10-05-2010 at 06:54 PM. Reason: forgot something

  15. #29
    NOOBJr's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    in NOOB
    Posts
    1,423
    Reputation
    112
    Thanks
    693
    This aint bible school kid!

  16. #30
    DreadKyller's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    122
    Reputation
    12
    Thanks
    21
    Quote Originally Posted by |Drake™| View Post
    When you include the d3dx9 , make sure you use x86 if your vista or 7.
    FINALLY, SOMEONE ACTUALLY GIVE ME A SMALL HOPE.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. error LNK2019
    By tstert in forum Combat Arms Help
    Replies: 9
    Last Post: 07-06-2010, 09:19 AM
  2. Hellbreath Int Error?
    By RebornAce in forum General
    Replies: 10
    Last Post: 03-06-2009, 09:04 PM
  3. Connection error
    By DrKaOs in forum WarRock - International Hacks
    Replies: 6
    Last Post: 02-05-2006, 08:37 PM
  4. K Warrock error :(
    By i eat trees in forum WarRock - International Hacks
    Replies: 2
    Last Post: 01-26-2006, 08:40 PM