ExclamationHelp detouring Hack Shield

Posts 1–14 of 14 · Page 1 of 1
Help detouring Hack Shield
Hi

i've just completed my first d3d hack with menu.

here's a screen:


but i have detecting problem's who come from the detour's old offset, but i don't know what to chane and to what change it...
Code:
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);
}
Anyone can help me?

p.s.:he will get credits for my hack.....
JMP is detected.
that's the problem!

hot to make it undetected.....
Are you using a bypass? What base are you using? This simple bypass will work only for Direct3D.

Code:
void w0rx( )
{
         
         int EhSvc = (long)GetModuleHandleA("EhSvc.dll");
         if(EhSvc !=0){ 
         DWORD OldProtect;

	int EhPtr   = 0xB2DB8;//Constant
	int EhY = (EhSvc+EhPtr-0x20);//Constant
        int Eh0 = (EhSvc+EhPtr-0x44);//Constant
       int EhX = (EhSvc+EhPtr-0x40);//Constant
	VirtualProtect((void*)(Eh0),0x14,PAGE_EXECUTE_READWRITE,&OldProtect); 
    *(DWORD*)(Eh0) = 4; 
    VirtualProtect((void*)(EhX),0x14,PAGE_EXECUTE_READWRITE,&OldProtect); 
    *(DWORD*)(EhX) = 4;
    VirtualProtect((void*)(EhY),0x14,PAGE_EXECUTE_READWRITE,&OldProtect); 
    *(DWORD*)(EhY) = 4;
		 }
}






void Loop( )
{
    for(;;Sleep(50)){
   w0rx();
  
	}
 }
my base doesn't support bypass...it needs detour and my detour is detected...
Quote Originally Posted by loll3d View Post
my base doesn't support bypass...it needs detour and my detour is detected...
What base do you use? I use Hans' base and it works fine.
Quote Originally Posted by Synns View Post
What base do you use? I use Hans' base and it works fine.
i'm using that base....but maybe i dont put the bypass in hte right way....

and the detour??did you took i out?
Quote Originally Posted by loll3d View Post
my base doesn't support bypass...it needs detour and my detour is detected...
All bases can support a bypass...

Add the bypass and then create the thread for it. Pm me i have a good detour.
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Loop,0,0, 0);

Put that in DLLMain.
Quote Originally Posted by Synns View Post
CreateThread(0,0,(LPTHREAD_START_ROUTINE)Loop,0,0, 0);

Put that in DLLMain.
should i delete the detour function if i add your bypass??
Quote Originally Posted by loll3d View Post
should i delete the detour function if i add your bypass??
No. It's a bypass, why would you delete it?
i added your bypass leaving the detour the way it is.......response: DETECTED

here is the d3dbase.cpp
Code:
#include "d3dbase.h"
#include "bypass.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 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);
        CreateThread(0,0,(LPTHREAD_START_ROUTINE)Loop,0,0, 0);
	}
	return TRUE;
}
show me where is the problem....
Wow I dont get a fuck of hans's base,. Maybe someone can make a tut in C++ section on how to add new addies and youre own text to it?
hmm awt abt q basic?
try it(qbasic)
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us