Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Hans211 hack base help


    Nitr0
     Share

    Recommended Posts

    If you help I can pay you back with something.

     

    I need some help adding hacks to the Hans211 base. I am using Vista and have VS C++ 6.0 with the DiretX 2004 summer update. I successfully changed around the menu, like adding more stuff in the folders. Then when I compile it, everything goes ok. I am making a Operation 7 hack ( because I seem to not need a bypass to run the hack ). I am at the point where I need to add some hacks to the code.

    Under here I guess?:

     

    // Seperate thread for making hacks
    DWORD WINAPI HACKthread( LPVOID param )
    {
    // --- hack loop
    while (1) {
    
    	// ..if (CH_stamina)   ....
    	// ..
    
    	// ..
    	// ..
    
    	Sleep(50);
    }
    return 0;
    }

     

    So whoever is helping me understands where I am at I started over to the stock base but removed and added some stuff, so the hackbase.cpp file looks like:

     

    // -----------------------------------------------------------------------------
    // Project : HackBase v1.0
    // Author  : Hans211
    // Date	: 11 April 2009
    //
    // A basic D3D framework:
    // - D3D menu with folders
    // - Optimized d3dfont, right aligned text
    // - Works for d3d8 or d3d9  (define it in main.h)
    // -----------------------------------------------------------------------------
    #include "d3dbase.h"
    #include <stdio.h>
    
    
    char	sFPS[20]="xxx Fps";
    int	 CH_back	   = 2;		// 40%
    
    // group states
    int		CH_cheats	  = 1;
    int		CH_weap		  = 1;
    // item  states
    int		CH_unlammo	  = 1;
    int	 CH_crosshair  = 1;
    
    // none standard options
    char	*opt_Grp[]	 = { "+","-" };
    char	*opt_OffOn[]   = { "Off","On" };
    char	*opt_Stamina[] = { "Off","Stealth","Full" };
    char	*opt_Back[]	= { "Off","20%","40%","60%","80%","Solid" };
    
    D3DMenu	*pMenu=NULL;
    
    
    // Change this to make your own menu	
    void RebuildMenu(void)
    {
     pMenu->AddItem("Background"		, &CH_back	  , opt_Back, 6);
     pMenu->AddText("Framerate", sFPS);
    
     pMenu->AddGroup("[Cheats]" , &CH_cheats, opt_Grp);
     if (CH_cheats) {
      pMenu->AddItem("Crosshair",&CH_crosshair , opt_Grp);
    
     }
     pMenu->AddGroup("[Weapons]", &CH_weap  , opt_Grp);
     if (CH_weap) {
      pMenu->AddItem("Unlimited ammo", &CH_unlammo   , opt_OffOn);
     }
    }
    
    // --- simple FPS vars and function
    int	  Fpaysafecardounter = 0;
    float FPSfLastTickCount = 0.0f;
    float FPSfCurrentTickCount;
    
    void Fpaysafecardheck(char *str, char *format)
    {
    FPSfCurrentTickCount = clock() * 0.001f;
    Fpaysafecardounter++;
    
    if((FPSfCurrentTickCount - FPSfLastTickCount) > 1.0f) {
    	FPSfLastTickCount = FPSfCurrentTickCount;
    	sprintf(str,format,Fpaysafecardounter);
    	Fpaysafecardounter = 0;
    } 
    }
    
    // Draw a background
    void DrawGui(pD3DdeviceX pDevice, DWORD col)
    {
    if (CH_back==5)					// solid
    	col|=0xff000000;
    else
    	col|=CH_back*0x30000000;	// transparency
    DrawBox(pDevice,pMenu->x-3,pMenu->y-2,pMenu->totwidth+6,pMenu->totheight+4  ,col);
    DrawBox(pDevice,pMenu->x-3,pMenu->y-2,pMenu->totwidth+6,pMenu->titleheight+1,col|0xff000000);
    }
    
    // called with every EndScene
    void DoMenu(pD3DdeviceX pDevice)
    {
    if (pMenu==0) {												// first time , create the menu
    	pMenu = new D3DMenu("== Hans211 D3D Base ==",100,160);	// title, maxitems,width
    	pMenu->visible=1;										// make it visible
    	pMenu->col_title=0xffffffff;							// change title color to white
    } else {
    	Fpaysafecardheck(sFPS,"%d Fps");
    	if (pMenu->noitems==0) RebuildMenu();
    	if (pMenu->visible && CH_back) DrawGui(pDevice,0x000000);  // black background
    	pMenu->Show(pFont);
    	pMenu->Nav();
    }
    }
    
    
    // Seperate thread for making hacks
    DWORD WINAPI HACKthread( LPVOID param )
    {
    // --- hack loop
    while (1) {
    
    	// ..if (CH_stamina)   ....
    	// ..
    
    	// ..
    	// ..
    
    	Sleep(50);
    }
    return 0;
    }

    So I have just unl ammo and a crosshair left.

     

    I also added a bit of code in the d3dbase.cpp source file so it waits with hooking untill you press the home key. ( To prevent crashing ). This is the code I added:

     

    // --- wait for home key to start
    while ((GetAsyncKeyState(VK_HOME)&0x8000)==0)  Sleep(200);

     

    The final d3dbase.cpp file looks like:

     

    // -----------------------------------------------------------------------------
    // Project : D3DBase v1.0
    // Author  : Hans211
    // Date	: 11 April 2009
    //
    // A basic D3D framework:
    // - D3D menu with folders
    // - Optimized d3dfont, center and right aligned text
    // - Works for d3d8 or d3d9  (define it in D3Dbase.h)
    // -----------------------------------------------------------------------------
    #include "d3dbase.h"
    
    #ifdef FOR_D3D8
    #include "d3dfont8.cpp"
    #else
    #include "d3dfont9.cpp"
    #endif
    
    oEndScene	pEndScene;
    oReset		pReset;
    
    CD3DFont	*pFont=NULL;
    
    
    void PreReset(pD3DdeviceX pDevice)
    {
    if (pFont) {
    	pFont->InvalidateDeviceObjects();
    	pFont->DeleteDeviceObjects();
    	pFont = NULL;
    }
    }
    
    void PostReset(pD3DdeviceX pDevice)
    {
    pFont = new CD3DFont("Arial", 10, D3DFONT_BOLD);
    if (pFont) {
    	pFont->InitDeviceObjects(pDevice);
    	pFont->RestoreDeviceObjects();
    }
    }
    
    HRESULT WINAPI myReset ( pD3DdeviceX pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
    {
    PreReset(pDevice);
    return pReset(pDevice, pPresentationParameters);
    }
    
    HRESULT WINAPI myEndScene (pD3DdeviceX pDevice)
    {
    if (pFont==NULL) 
    	PostReset(pDevice);			// Create font
    else 
    	DoMenu(pDevice);
    return pEndScene(pDevice);
    }
    
    void DrawBox(pD3DdeviceX pDevice, int x, int y, int w, int h, D3DCOLOR col)
    {
    struct {
    	float x,y,z,rhw;
    	DWORD dwColor;
    } qV[4] = { { (float)x	, (float)(y+h), 0.0f, 0.0f, col},
    			{ (float)x	, (float)y	, 0.0f, 0.0f, col},
    			{ (float)(x+w), (float)(y+h), 0.0f, 0.0f, col},
    			{ (float)(x+w), (float)y	, 0.0f, 0.0f, col} };
    
    pDevice->SetPixelShader(NULL);
    pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
    pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,qV,sizeof(qV[0]));
    }
    
    bool bCompare(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 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;
    }
    
    void *DetourCreate(BYTE *src, const BYTE *dst, const int len)
    {
    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;
    for (int i=5; i<len; i++)  src[i]=0x90;
    VirtualProtect(src, len, dwBack, &dwBack);
    return (jmp-len);
    }
    
    int D3Dinit(void)
    {
    DWORD		hD3D, adr, *vtbl;
    
    // --- wait for home key to start
    while ((GetAsyncKeyState(VK_HOME)&0x8000)==0)  Sleep(200);
    // wait for the d3dx dll
    hD3D=0;
    do {
    	hD3D = (DWORD)GetModuleHandle(D3Ddllname);
    	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((PBYTE)vtbl[RESET]   , (PBYTE)myReset   ,5);
    		pEndScene = (oEndScene)	DetourCreate((PBYTE)vtbl[ENDSCENE], (PBYTE)myEndScene,5);
    	}
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HACKthread, NULL, NULL, NULL);
    return 0;
    }
    
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if (dwReason == DLL_PROCESS_ATTACH) {		
    	CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3Dinit, NULL, NULL, NULL);
    }
    return TRUE;
    }

     

    So now I want you to help me add 2 hack features, Unl ammo and a crosshair. You don't have to find the ammo address, I can do that myself if you want.

    Link to comment
    Share on other sites

    I really havent use Hans base but... Im olny giving you the crosshair, cause i lost Unl Ammo xD... Change the Base to D3D8 and do This:

     

    First Define the Hack:

     

    Define it (int CH_Crosshair = 1;)

    Add the Crosshair like this:

     

    // Seperate thread for making hacks
    DWORD WINAPI HACKthread( LPVOID param )
    {
    // --- hack loop
    while (1) {
    
    	if (CH_Crosshair)( LPDIRECT3DDEVICE8 )pDevice 
    ;{
    D3DCOLOR xcolor = D3DCOLOR_ARGB(255 , 255 , 0 , 0 ); //set color
    
    int size = 19, strong = 3; // size and width/length
    int iCenterX = Ge*Zensored*temMetrics( 0 ) / 2;
    int iCenterY = Ge*Zensored*temMetrics( 1 ) / 2;
    if( iCenterX < 20 && iCenterY < 20 )
    {
    iCenterX = ( Ge*Zensored*temMetrics( 0 ) / 2 );
    iCenterY = ( Ge*Zensored*temMetrics( 1 ) / 2 );
    }
    D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
    D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
    pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0, 0);
    pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0, 0);
    }
    
    	Sleep(50);
    }
    return 0;
    }

    And u have this code wrong at the menu

     

    Change this:
    pMenu->AddItem("Crosshair",&CH_Crosshair , opt_Grp);
    
    To this:
    pMenu->AddItem("Crosshair",&CH_Crosshair , opt_OffOn);

     

     

    Well thats some of my help.. Hope it works O.o

    Link to comment
    Share on other sites

    Didn't work, this is the results:

     

    --------------------Configuration: Hans211 - Win32 Debug--------------------
    Compiling...
    hackbase.cpp
    main.h : Building for D3D8
    c:\users\****\desktop\hack4\d3dbase\hackbase.cpp(102) : error C2065: 'pDevice' : undeclared identifier
    c:\users\****\desktop\hack4\d3dbase\hackbase.cpp(115) : error C2227: left of '->Clear' must point to class/struct/union
    c:\users\****\desktop\hack4\d3dbase\hackbase.cpp(116) : error C2227: left of '->Clear' must point to class/struct/union
    d3dbase.cpp
    main.h : Building for D3D8
    d3dmenu.cpp
    main.h : Building for D3D8
    Error executing cl.exe.
    
    Hans211.dll - 3 error(s), 0 warning(s)

     

    Help.

    Link to comment
    Share on other sites

    This might be the fix...

    Change the old one by this one :

       if (CH_Crosshair)( LPDIRECT3DDEVICE8 )pD3DdeviceX
    ;{
    D3DCOLOR xcolor = D3DCOLOR_ARGB(255 , 255 , 0 , 0 ); //set color
    
    int size = 19, strong = 3; // size and width/length
    int iCenterX = Ge*Zensored*temMetrics( 0 ) / 2;
    int iCenterY = Ge*Zensored*temMetrics( 1 ) / 2;
    if( iCenterX < 20 && iCenterY < 20 )
    {
    iCenterX = ( Ge*Zensored*temMetrics( 0 ) / 2 );
    iCenterY = ( Ge*Zensored*temMetrics( 1 ) / 2 );
    }
    D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
    D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
    pD3DdeviceX->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0, 0);
    pD3DdeviceX->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0, 0);
    }

     

    IF having Errors put them here xD

    Edited by ZWE47
    Link to comment
    Share on other sites

    --------------------Configuration: Hans211 - Win32 Debug--------------------
    Compiling...
    hackbase.cpp
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(102) : error C2226: syntax error : unexpected type 'LPDIRECT3DDEVICE8'
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(115) : warning C4091: '' : ignored on left of 'struct IDirect3DDevice8 *' when no variable is declared
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(115) : error C2143: syntax error : missing ';' before '->'
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(115) : error C2143: syntax error : missing ';' before '->'
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(116) : warning C4091: '' : ignored on left of 'struct IDirect3DDevice8 *' when no variable is declared
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(116) : error C2143: syntax error : missing ';' before '->'
    C:\Users\****\Desktop\hack4\D3Dbase\hackbase.cpp(116) : error C2143: syntax error : missing ';' before '->'
    Error executing cl.exe.
    
    Hans211.dll - 5 error(s), 2 warning(s)

    Link to comment
    Share on other sites

    Wow sorry i have no ideas in how to fix that error... W8 for hans he might know how... Sorry

    Link to comment
    Share on other sites

    	
    switch(crosshair)
    {
    case 1:
       D3DCOLOR YourColor= D3DCOLOR_ARGB( 255, 255, 0, 255 ); /// <--- COlor							
    int size = 13, strong = 1; // crosshair size
    int iCenterX = Ge*Zensored*temMetrics( 0 ) / 2;
    int iCenterY = Ge*Zensored*temMetrics( 1 ) / 2;
    if( iCenterX < 20 && iCenterY < 20 )
    {
    	iCenterX = ( Ge*Zensored*temMetrics( 0 ) / 2 );
    	iCenterY = ( Ge*Zensored*temMetrics( 1 ) / 2 );
    }
    D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong};
    D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size};
    m_pD3Ddev->Clear(1, &rec2, D3DCLEAR_TARGET, YourColor, 0,  0);
    m_pD3Ddev->Clear(1, &rec3, D3DCLEAR_TARGET, YourColor, 0,  0);
    
    break;
    }

     

    dude use your brain..

     

    if (CH_Crosshair)( LPDIRECT3DDEVICE8 )pD3DdeviceX

    ;{

    wtf??

     

    Only error he had cause he used wrong Device...

     

    If it doesn't work change m_pD3Ddev to pDevice ...

     

    You can try a void

    Edited by tommy24a
    Link to comment
    Share on other sites

    we already tried that dude changing it to pDevice and didnt work too... and thats the crosshair i use in my hack i dont have any problems

    Edited by ZWE47
    Link to comment
    Share on other sites

    dude it wasn't only the Device the error just open your eye. that was the error... if (CH_Crosshair)( LPDIRECT3DDEVICE8 )pD3DdeviceX

    ;{

    Link to comment
    Share on other sites

    I am the type of person ( when It comes to coding ) that if I see the stock base, then see it with a hack added; I will learn enough from that to know how to add my own codes. I just don't know where to put them right now!

    Link to comment
    Share on other sites

    The Hackthread is meaned for non D3D hacks, like stamina, nospread or something.

     

    D3D hacks should be done in the d3dbase.

    so, extend the D3Dbase.cpp:

    extern int CH_crosshair;   //defined in other file
    void DrawCrosshair (pD3DdeviceX pDevice)
    {
    .... your code ...
    pDevice->Clear(.....);
    }
    
    HRESULT WINAPI myEndScene (pD3DdeviceX pDevice)
    {
    if (pFont==NULL)
    	PostReset(pDevice);			// Create font
    else {
    	if (CH_crosshair) DrawCrosshair(pDevice);
    	DoMenu(pDevice);
    }
    return pEndScene(pDevice);
    }

     

    and in hackbase.cpp add

    int CH_crosshair=0;
    
    add to rebuildmenu:
    pMenu->AddItem("Crosshair",&CH_crosshair , opt_OffOn);

     

    With every frame/endscene now first the crosshair is drawn and then the menu

     

    For Non D3D hacks, just extend the Hackthread, for example:

    globally : (where the int CH_xxxxx defines are
    
    #define ADR_NOSPREAD	  0x00b7a54c
    int	*p_nospread   =(int   *)ADR_NOSPREAD;
    
    and in the hackthread do
    DWORD WINAPI HACKthread( LPVOID param )
    {
    // --- hack loop
    while (1) {
    
    	if (CH_nospread) *p_nospread=0;
    
    	Sleep(50);
    }
    return 0;
    }

    Link to comment
    Share on other sites

    Thank you so much! I knew that no one could help me better with your base then the person who made it! I am confused with one thing though. Where does this go in d3dbase.cpp?:

     

    extern int CH_crosshair;   //defined in other file
    void DrawCrosshair (pD3DdeviceX pDevice)
    {
    .... your code ...
    pDevice->Clear(.....);
    }
    
    HRESULT WINAPI myEndScene (pD3DdeviceX pDevice)
    {
    if (pFont==NULL)
    	PostReset(pDevice);			// Create font
    else {
    	if (CH_crosshair) DrawCrosshair(pDevice);
    	DoMenu(pDevice);
    }
    return pEndScene(pDevice);
    }

     

    Here is my d3dbase.cpp I have right now:

     

    // -----------------------------------------------------------------------------
    // Project : D3DBase v1.0
    // Author  : Hans211
    // Date	: 11 April 2009
    //
    // A basic D3D framework:
    // - D3D menu with folders
    // - Optimized d3dfont, center and right aligned text
    // - Works for d3d8 or d3d9  (define it in D3Dbase.h)
    // -----------------------------------------------------------------------------
    #include "d3dbase.h"
    
    #ifdef FOR_D3D8
    #include "d3dfont8.cpp"
    #else
    #include "d3dfont9.cpp"
    #endif
    
    oEndScene	pEndScene;
    oReset		pReset;
    
    CD3DFont	*pFont=NULL;
    
    
    void PreReset(pD3DdeviceX pDevice)
    {
    if (pFont) {
    	pFont->InvalidateDeviceObjects();
    	pFont->DeleteDeviceObjects();
    	pFont = NULL;
    }
    }
    
    void PostReset(pD3DdeviceX pDevice)
    {
    pFont = new CD3DFont("Arial", 10, D3DFONT_BOLD);
    if (pFont) {
    	pFont->InitDeviceObjects(pDevice);
    	pFont->RestoreDeviceObjects();
    }
    }
    
    HRESULT WINAPI myReset ( pD3DdeviceX pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
    {
    PreReset(pDevice);
    return pReset(pDevice, pPresentationParameters);
    }
    
    HRESULT WINAPI myEndScene (pD3DdeviceX pDevice)
    {
    if (pFont==NULL) 
    	PostReset(pDevice);			// Create font
    else 
    	DoMenu(pDevice);
    return pEndScene(pDevice);
    }
    
    void DrawBox(pD3DdeviceX pDevice, int x, int y, int w, int h, D3DCOLOR col)
    {
    struct {
    	float x,y,z,rhw;
    	DWORD dwColor;
    } qV[4] = { { (float)x	, (float)(y+h), 0.0f, 0.0f, col},
    			{ (float)x	, (float)y	, 0.0f, 0.0f, col},
    			{ (float)(x+w), (float)(y+h), 0.0f, 0.0f, col},
    			{ (float)(x+w), (float)y	, 0.0f, 0.0f, col} };
    
    pDevice->SetPixelShader(NULL);
    pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE,true);
    pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
    pDevice->SetTexture(0, NULL);
    pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,qV,sizeof(qV[0]));
    }
    
    bool bCompare(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 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;
    }
    
    void *DetourCreate(BYTE *src, const BYTE *dst, const int len)
    {
    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;
    for (int i=5; i<len; i++)  src[i]=0x90;
    VirtualProtect(src, len, dwBack, &dwBack);
    return (jmp-len);
    }
    
    int D3Dinit(void)
    {
    DWORD		hD3D, adr, *vtbl;
    
    // --- wait for home key to start
    while ((GetAsyncKeyState(VK_HOME)&0x8000)==0)  Sleep(200);
    // wait for the d3dx dll
    hD3D=0;
    do {
    	hD3D = (DWORD)GetModuleHandle(D3Ddllname);
    	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((PBYTE)vtbl[RESET]   , (PBYTE)myReset   ,5);
    		pEndScene = (oEndScene)	DetourCreate((PBYTE)vtbl[ENDSCENE], (PBYTE)myEndScene,5);
    	}
    CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)HACKthread, NULL, NULL, NULL);
    return 0;
    }
    
    BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
    {
    DisableThreadLibraryCalls(hDll);
    if (dwReason == DLL_PROCESS_ATTACH) {		
    	CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3Dinit, NULL, NULL, NULL);
    }
    return TRUE;
    }

     

    If you could put that crosshair code in there for me, that would be great. Thanks a lot. xD

    Link to comment
    Share on other sites

    • 3 weeks later...
    • 2 years later...

    For Non D3D hacks, just extend the Hackthread, for example:

    globally : (where the int CH_xxxxx defines are
    
    #define ADR_NOSPREAD	  0x00b7a54c
    int	*p_nospread   =(int   *)ADR_NOSPREAD;
    
    and in the hackthread do
    DWORD WINAPI HACKthread( LPVOID param )
    {
    // --- hack loop
    while (1) {
    
    	if (CH_nospread) *p_nospread=0;
    
    	Sleep(50);
    }
    return 0;
    }

     

    Hans, I have a cheat table in darkbyte like this :

    [ENABLE]
    00469311:
    db 75 55
    
    
    [DISABLE]
    00469311:
    db 74 55

     

    can you give an example with this on how to add in to your menu thanks ..

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...