[Help] Base CodeDemon 3D3. DC 1 Min

Posts 115 of 16 · Page 1 of 2
[Help] Base CodeDemon 3D3. DC 1 Min
I have a personal doubts about the basis of CodeDemon.

I put the functions of the hacks (the recoil, reloaded, glass walls and super bullets) more than 2 minutes after the game closes.

I think this is partly the cause of DC in Combat Arms BR

Code:
void ReFont(LPDIRECT3DDEVICE9 pDevice) // Credits for the ReFont function go to mmbob
{
    if (g_pDevice != pDevice)
    {
        g_pDevice = pDevice;
        try
        {
            if (dMenu.pFont != 0)
                dMenu.pFont->Release();
        } catch (...) {}
        dMenu.pFont = 0;
        D3DXCreateFontA(pDevice, 14, 0, FW_BOLD, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &dMenu.pFont );
    }
}

HRESULT WINAPI Reset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters )
{
	dMenu.pFont->OnLostDevice();

	HRESULT hRet = pReset(pDevice, pPresentationParameters);

	dMenu.pFont->OnResetDevice();

	return hRet;
}

HRESULT WINAPI EndScene(LPDIRECT3DDEVICE9 pDevice)
{
	ReFont(pDevice);
	dMenu.BuildMenu("CodeDemon",0,0,180,200,RED,BLACK,GREEN,pDevice);
	
	return pEndScene(pDevice);
}



int D3Dinit(void) //Just a hook I used for testing, got it from Marko I believe.
{
	DWORD		hD3D, adr, *vtbl;

	// wait for the d3dx dll
	hD3D=0;
	do {
		hD3D = (DWORD)GetModuleHandle("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)	DetourFunction((PBYTE)vtbl[16]   , (PBYTE)Reset   ,5);
 		pEndScene = (oEndScene)	DetourFunction((PBYTE)vtbl[42], (PBYTE)EndScene,5);
 	}
	return 0;
}
bool memoria( void * pDest, char * szPatch, size_t sSize ) //Nopping Method
{
    DWORD dwOrgProtect = NULL;
    if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
        return FALSE;

    memcpy( pDest, szPatch, sSize );
    VirtualProtect( pDest, sSize, dwOrgProtect, NULL );
    return TRUE;
}



#define ADR_RECOIL1ADDY 
#define CSHELL_LTC  
#define reloaded 
#define WALLSS 

    bool WALLS = 0;
	bool Recoil = 0;
	bool reload = 0;

void HackThread()

{

       
	while(1){
    if (hack1==1)
   	if(reload){
			memcpy(( void* )(reloaded), "\x0F\x84\xB1\x01\x00\x00", 6);
			reload = 0;
		}else{
			memcpy(( void* )(reloaded), "\x90\x90\x90\x90\x90\x90", 6);
			reload = 1;
	}
}
if (hack2==1)
	if(Recoil){
memcpy(( void* )( ADR_RECOIL1ADDY ), "\xD9\x44\x24\x10", 4 );
Recoil = 0;
	} else {
memcpy(( void* )( ADR_RECOIL1ADDY ), "\x90\x90\x90\x90", 4 );
Recoil = 1;
	}


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);
	}
	if( dwReason == DLL_PROCESS_DETACH)
	{
		dMenu.pFont->Release();
	}
	return TRUE;
}
CodeDemon analizes ?

CodeDemon see if I did something wrong!
That adress is the size of the... Im not realy sure but its the size of the Module?
And you define the base of the module with the hD3D which is the first parameter.

Im noticing that this is a signaturescan for the Direct3D Devicepointer
Quote Originally Posted by Mr.Magicman View Post
That adress is the size of the... Im not realy sure but its the size of the Module?
And you define the base of the module with the hD3D which is the first parameter.

Im noticing that this is a signaturescan for the Direct3D Devicepointer
No no, it is a basic part of the Code, if I change this value, the menu does not appear, so I think the error is in it.
Quote Originally Posted by Alessandro10 View Post
No no, it is a basic part of the Code, if I change this value, the menu does not appear, so I think the error is in it.
If you change it the scan becomes corrupted and returns 0x000000. So its not realy recomended.

I would like someone to explain what the size is the size of.
Quote Originally Posted by Mr.Magicman View Post


If you change it the scan becomes corrupted and returns 0x000000. So its not realy recomended.

I would like someone to explain what the size is the size of.
Expect CodeDemon appear xD
CodeDemon aint better than me. We are ecuals.
Quote Originally Posted by Mr.Magicman View Post
CodeDemon aint better than me. We are ecuals.
was not what I meant lol
is that it was his base xD

not know of any database updated? that all who tried the game closes
LOL you think it is "partly" the cause of the DC, why not paste all his base ?
Problem is that I did for hotkeys CA BR with Glass Walls, No Recoil and reloaded to the public. for me I put the super bullets xD

On the menu it turns everything right, work, more play closes.
Quote Originally Posted by Alessandro10 View Post
Problem is that I did for hotkeys CA BR with Glass Walls, No Recoil and reloaded to the public. for me I put the super bullets xD

On the menu it turns everything right, work, more play closes.
Yes, you need to change the hook / detour because it's detected.
Quote Originally Posted by anaestheist View Post
Yes, you need to change the hook / detour because it's detected.
Where I got the base and rephrased the hotkeys for the menu.
im realy sure that the detours are detected
Quote Originally Posted by StupidLittleNoob View Post
You-o no-o understando el problemo.

Hooks needo changing-o.
ito iso thato simplo
, Sir, are a genious.
Posts 115 of 16 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?