Post by Nightmare Community on Dec 18, 2011 20:18:49 GMT -5
Nb :
+++ Dolo Baru Loe Boleh Compas
//Name : FEBRII NP RAZY KMPT
//Copyright : FEBRII ERVANZ © 2011 Or Facebook
//Author : Febrii Admin P.A.S
//Date : 14/10/2011 02:30.34
/******************************************************--==||so||==--******************************************************/
#include
#include
#include
#include
#include
#include
#include "Main.h"
using namespace std;
ofstream infile;
ofstream myfile;
LPDIRECT3DTEXTURE9 texGreen;
LPDIRECT3DTEXTURE9 texYellow;
LPDIRECT3DTEXTURE9 texRed;
LPDIRECT3DTEXTURE9 texBlue;
LPDIRECT3DTEXTURE9 texPurple;
LPDIRECT3DTEXTURE9 texPink;
LPDIRECT3DTEXTURE9 texOrange;
LPDIRECT3DTEXTURE9 texBlack;
#include
#pragma comment(lib, "d3d9.lib")
bool CekHook=true;
bool Colors=true;
bool Chams = false;
bool cross = false;
bool betterwh = false;
bool nosmoke = true;
bool Tested = false;
#include
#pragma comment(lib, "d3dx9.lib")
#pragma warning(disable:4102)
#pragma warning(disable:4101)
#define SMOKE (nNumVertices == 192 || nPrimitiveCount == 52 || nNumVertices == 256)
#define D3DparamX , UINT paramx
#define D3DparamvalX , paramx
//-------------------------------------------------------------------------------------//
LPDIRECT3DDEVICE9 npDevice;
//-------------------------------------------------------------------------------------//
LPDIRECT3DDEVICE9 g_pDevice = 0;
//int hackopt1;
int B = 1;
int CALL = 1;
LPDIRECT3DDEVICE9 rpDevice = 0;
UINT OffsetInBytes;
UINT m_Stride;
UINT primCount;
UINT NumVertices;
int hsorg;
int CopiedWrExe;
int dwordgame;
int CopiedHsDll;
int dwordhs;
int poczatekhs;
int koniechs;
int edxreg;
int hsfx;
int wrfx;
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
if( FAILED(pD3Ddev->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)<<Cool
|(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;
}
//--------------------------------------------------------------------------------//
PVOID D3Ddiscover(void *tbl, int size)
{
HWND hWnd;
void *pInterface=0 ;
D3DPRESENT_PARAMETERS d3dpp;
// myfile << "Reset is hooked\n";
// if( g_pFont )
// g_pFont->OnLostDevice();
if ((hWnd=CreateWindowEx(NULL,WC_DIALOG,"",WS_OVERLAPPED,0,0,50,50,0,0,0,0))==NULL) return NULL;
// if ((hWnd=CreateWindowEx(NULL,WC_DIALOG,"",WS_OVERLAPPED,0,0,50,50,0,0,0,0))==0) return 0;
// HWND hWnd = CreateWindow(NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
ShowWindow(hWnd, SW_HIDE);
LPDIRECT3D9 pD3D;
LPDIRECT3DDEVICE9 pD3Ddev;
if ((pD3D = Direct3DCreate9(D3D_SDK_VERSION))!=NULL)
{
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = true;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = hWnd;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = 600;
d3dpp.BackBufferHeight = 600;
pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pD3Ddev);
if (pD3Ddev) {
pInterface = (PDWORD)*(DWORD *)pD3Ddev;
memcpy(tbl,(void *)pInterface,size);
pD3Ddev->Release();
}
pD3D->Release();
}
DestroyWindow(hWnd);
return pInterface;
}
#pragma once
class cPatch
{
private:
DWORD ADR;
BYTE OFF_BYTES[255];
BYTE ON_BYTES[255];
int SIZE;
enum PATCHSTATUS
{
NORMAL,
PATCHED,
};
int STATUS;
void* memcpy_s(void* pvAddress, const void* pvBuffer, size_t stLen);
public:
cPatch(DWORD pAdr,BYTE* pByte,int pSize);
void Patch();
void Restore();
};
void* cPatch::memcpy_s(void *pvAddress, const void *pvBuffer, size_t stLen)
{
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
void* pvRetn = memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
return pvRetn;
}
cPatch::cPatch(DWORD pAdr,BYTE* pByte,int pSize)
{
STATUS = NORMAL;
SIZE = pSize;
ADR = pAdr;
for(int i = 0; i < pSize; i++)
{
OFF_BYTES = 0x00;
ON_BYTES = pByte;
}
}
void cPatch::Patch()
{
if( STATUS==NORMAL )
{
BYTE *pOFF_BYTES = (BYTE*)ADR;
for( int i = 0; i < SIZE; i++ )
{
OFF_BYTES = pOFF_BYTES;
}
memcpy_s((void*)ADR,(const void*)ON_BYTES,SIZE);
STATUS=PATCHED;
}
}
void cPatch::Restore()
{
if(STATUS==PATCHED)
{
memcpy_s((void*)ADR,(const void*)OFF_BYTES,SIZE);
STATUS=NORMAL;
}
}
extern "C" int __cdecl mlde32(void *codeptr);
//---------------DETOURS-------------------------------//
DWORD B8Detours( DWORD SrcVA, DWORD DstVA, DWORD Size )
{
#define SIZEOF_MOVEAX_JMPEAX 12
DWORD DetourVA, dwProtect, i;
if ( SrcVA && DstVA && Size >= SIZEOF_MOVEAX_JMPEAX )
{
DetourVA = (DWORD) VirtualAlloc(
NULL, Size + SIZEOF_MOVEAX_JMPEAX,
MEM_COMMIT, PAGE_EXECUTE_READWRITE );
if ( DetourVA && VirtualProtect( (VOID*)SrcVA, Size, PAGE_EXECUTE_READWRITE, &dwProtect ) )
{
for ( i=0; i < Size; i++ ) {
*(BYTE*)( DetourVA + i ) = *(BYTE*)( SrcVA + i );
}
*(BYTE*)( DetourVA + Size + 0 ) = 0xB8;
*(DWORD*)( DetourVA + Size + 1 ) = ( SrcVA + Size );
*(WORD*)( DetourVA + Size + 5 ) = 0xE0FF;
*(BYTE*)( SrcVA + 0 ) = 0xB8;
*(DWORD*)( SrcVA + 1 ) = ( DstVA );
*(WORD*)( SrcVA + 5 ) = 0xE0FF;
VirtualProtect( (VOID*)SrcVA, Size, dwProtect, &dwProtect );
VirtualProtect( (VOID*)DetourVA, Size +
SIZEOF_MOVEAX_JMPEAX, PAGE_EXECUTE_READ, &dwProtect );
return DetourVA;
}
}
return(0);
}
void UnlinkModule(HINSTANCE hDll)
{
DWORD dwPEB_LDR_DATA = 0;
_asm
{
pushad;
pushfd;
mov eax, fs:[30h]
mov eax, [eax+0Ch]
mov dwPEB_LDR_DATA, eax
InLoadOrderModuleList:
mov esi, [eax+0Ch]
mov edx, [eax+10h]
LoopInLoadOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+18h]
cmp ecx, hDll
jne SkipA
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InMemoryOrderModuleList
SkipA:
cmp edx, esi
jne LoopInLoadOrderModuleList
InMemoryOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+14h]
mov edx, [eax+18h]
LoopInMemoryOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+10h]
cmp ecx, hDll
jne SkipB
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InInitializationOrderModuleList
SkipB:
cmp edx, esi
jne LoopInMemoryOrderModuleList
InInitializationOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+1Ch]
mov edx, [eax+20h]
LoopInInitializationOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+08h]
cmp ecx, hDll
jne SkipC
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp Finished
SkipC:
cmp edx, esi
jne LoopInInitializationOrderModuleList
Finished:
popfd;
popad;
}
}
typedef HRESULT (WINAPI* oDrawIndexedPrimitive) (LPDIRECT3DDEVICE9 rpDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
oDrawIndexedPrimitive pDrawIndexedPrimitive;
inline HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 rpDevice, D3DPRIMITIVETYPE pType D3DparamX ,UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount )
{
__asm
{
}
npDevice = rpDevice;
}
if(Colors)
{
GenerateTexture(rpDevice, &texGreen,D3DCOLOR_ARGB(255,0,255,0));
GenerateTexture(rpDevice, &texYellow , D3DCOLOR_ARGB(255,255,255,0));
GenerateTexture(rpDevice, &texRed, D3DCOLOR_ARGB(255,255,0,0));
GenerateTexture(rpDevice, &texBlue, D3DCOLOR_ARGB(255,0,0,255));
GenerateTexture(rpDevice, &texPurple, D3DCOLOR_ARGB(255,160,0,255));
GenerateTexture(rpDevice, &texPink, D3DCOLOR_ARGB(255,255,192,203));
GenerateTexture(rpDevice, &texOrange, D3DCOLOR_ARGB(255,0,0,204));
GenerateTexture(rpDevice, &texBlack, D3DCOLOR_ARGB(255, 0, 0, 0));
Colors=false;
}
LPDIRECT3DVERTEXBUFFER9 vertexBuf;
UINT Offset = 0;
UINT Stride = 64;
if(rpDevice->GetStreamSource(0, &vertexBuf, &Offset, &Stride) == D3D_OK)
vertexBuf->Release();
//****************************************************************************************************************//
if (GetAsyncKeyState(VK_INSERT)&1)
//if(CALL)
{
if (Stride==44)
{
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texYellow);
pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texYellow);
}
if (Stride==52)
{
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texGreen);
pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texGreen);
}
}
if (GetAsyncKeyState(VK_DELETE)&1)
//if(B)
{
if(SMOKE)
{
return D3D_OK;
}
}
/*
if(CALL)
if(Stride == 48 || Stride == 52 || Stride ==0x24 || Stride == 64 )
{
rpDevice->SetRenderState(D3DRS_ZENABLE, false);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
}*/
__asm
{
}
return pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
}
void HideModule(HINSTANCE hModule)
{
DWORD dwPEB_LDR_DATA = 0;
_asm
{
pushad;
pushfd;
mov eax, fs:[30h]
mov eax, [eax+0Ch]
mov dwPEB_LDR_DATA, eax
InLoadOrderModuleList:
mov esi, [eax+0Ch]
mov edx, [eax+10h]
LoopInLoadOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+18h]
cmp ecx, hModule
jne SkipA
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InMemoryOrderModuleList
SkipA:
cmp edx, esi
jne LoopInLoadOrderModuleList
InMemoryOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+14h]
mov edx, [eax+18h]
LoopInMemoryOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+10h]
cmp ecx, hModule
jne SkipB
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InInitializationOrderModuleList
SkipB:
cmp edx, esi
jne LoopInMemoryOrderModuleList
InInitializationOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+1Ch]
mov edx, [eax+20h]
LoopInInitializationOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+08h]
cmp ecx, hModule
jne SkipC
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp Finished
SkipC:
cmp edx, esi
jne LoopInInitializationOrderModuleList
Finished:
popfd;
popad;
}
}
//---------------------------------------------------------------//
int D3D(void)
{
HINSTANCE hD3D;
DWORD vTable[124];
hD3D=0;
do {
hD3D = GetModuleHandle("d3d9.dll");
if (!hD3D) Sleep(150);
}
while(!hD3D);
if (D3Ddiscover((void *)&vTable[0],420)==NULL)
return 0;
{
while(1)
{
if(memcmp((void*)vTable[82],(void*)(PBYTE)"\x8B\xFF",1)== 0)
{
pDrawIndexedPrimitive = (oDrawIndexedPrimitive) B8Detours((DWORD)vTable[74+8], (DWORD)myDrawIndexedPrimitive,12 );
}
Sleep(110);
}
return 0;
}
}
//---------------------------------------------------------------------------------------------------------------------------------//
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hDll);
if (dwReason == DLL_PROCESS_ATTACH)
{
HideModule(hDll);
MessageBox (0,"FITUR:\n*WALLHACK\n*NO SMOKE\n*AMMO UNLIMITED\n\nHOTKEY:\n*AUTO ON SEMUA\n\nSPESIAL THANK'S:\n\n*Febrii Np Razy Kmpt","--==||R<>E<>S||==--", MB_OK | MB_ICONEXCLAMATION);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)D3D, 0, 0, 0);
//CreateThread(0, 0, (LPTHREAD_START_ROUTINE)LCOI, 0, 0, 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)SonYGantenG, 0, 0, 0);
}
return FALSE;
}
/******************************************************--==||R<>E<>S||==--******************************************************/
+++ Dolo Baru Loe Boleh Compas
//Name : FEBRII NP RAZY KMPT
//Copyright : FEBRII ERVANZ © 2011 Or Facebook
//Author : Febrii Admin P.A.S
//Date : 14/10/2011 02:30.34
/******************************************************--==||so||==--******************************************************/
#include
#include
#include
#include
#include
#include
#include "Main.h"
using namespace std;
ofstream infile;
ofstream myfile;
LPDIRECT3DTEXTURE9 texGreen;
LPDIRECT3DTEXTURE9 texYellow;
LPDIRECT3DTEXTURE9 texRed;
LPDIRECT3DTEXTURE9 texBlue;
LPDIRECT3DTEXTURE9 texPurple;
LPDIRECT3DTEXTURE9 texPink;
LPDIRECT3DTEXTURE9 texOrange;
LPDIRECT3DTEXTURE9 texBlack;
#include
#pragma comment(lib, "d3d9.lib")
bool CekHook=true;
bool Colors=true;
bool Chams = false;
bool cross = false;
bool betterwh = false;
bool nosmoke = true;
bool Tested = false;
#include
#pragma comment(lib, "d3dx9.lib")
#pragma warning(disable:4102)
#pragma warning(disable:4101)
#define SMOKE (nNumVertices == 192 || nPrimitiveCount == 52 || nNumVertices == 256)
#define D3DparamX , UINT paramx
#define D3DparamvalX , paramx
//-------------------------------------------------------------------------------------//
LPDIRECT3DDEVICE9 npDevice;
//-------------------------------------------------------------------------------------//
LPDIRECT3DDEVICE9 g_pDevice = 0;
//int hackopt1;
int B = 1;
int CALL = 1;
LPDIRECT3DDEVICE9 rpDevice = 0;
UINT OffsetInBytes;
UINT m_Stride;
UINT primCount;
UINT NumVertices;
int hsorg;
int CopiedWrExe;
int dwordgame;
int CopiedHsDll;
int dwordhs;
int poczatekhs;
int koniechs;
int edxreg;
int hsfx;
int wrfx;
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
if( FAILED(pD3Ddev->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)<<Cool
|(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;
}
//--------------------------------------------------------------------------------//
PVOID D3Ddiscover(void *tbl, int size)
{
HWND hWnd;
void *pInterface=0 ;
D3DPRESENT_PARAMETERS d3dpp;
// myfile << "Reset is hooked\n";
// if( g_pFont )
// g_pFont->OnLostDevice();
if ((hWnd=CreateWindowEx(NULL,WC_DIALOG,"",WS_OVERLAPPED,0,0,50,50,0,0,0,0))==NULL) return NULL;
// if ((hWnd=CreateWindowEx(NULL,WC_DIALOG,"",WS_OVERLAPPED,0,0,50,50,0,0,0,0))==0) return 0;
// HWND hWnd = CreateWindow(NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
ShowWindow(hWnd, SW_HIDE);
LPDIRECT3D9 pD3D;
LPDIRECT3DDEVICE9 pD3Ddev;
if ((pD3D = Direct3DCreate9(D3D_SDK_VERSION))!=NULL)
{
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = true;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = hWnd;
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
d3dpp.BackBufferWidth = 600;
d3dpp.BackBufferHeight = 600;
pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pD3Ddev);
if (pD3Ddev) {
pInterface = (PDWORD)*(DWORD *)pD3Ddev;
memcpy(tbl,(void *)pInterface,size);
pD3Ddev->Release();
}
pD3D->Release();
}
DestroyWindow(hWnd);
return pInterface;
}
#pragma once
class cPatch
{
private:
DWORD ADR;
BYTE OFF_BYTES[255];
BYTE ON_BYTES[255];
int SIZE;
enum PATCHSTATUS
{
NORMAL,
PATCHED,
};
int STATUS;
void* memcpy_s(void* pvAddress, const void* pvBuffer, size_t stLen);
public:
cPatch(DWORD pAdr,BYTE* pByte,int pSize);
void Patch();
void Restore();
};
void* cPatch::memcpy_s(void *pvAddress, const void *pvBuffer, size_t stLen)
{
MEMORY_BASIC_INFORMATION mbi;
VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
void* pvRetn = memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
return pvRetn;
}
cPatch::cPatch(DWORD pAdr,BYTE* pByte,int pSize)
{
STATUS = NORMAL;
SIZE = pSize;
ADR = pAdr;
for(int i = 0; i < pSize; i++)
{
OFF_BYTES = 0x00;
ON_BYTES = pByte;
}
}
void cPatch::Patch()
{
if( STATUS==NORMAL )
{
BYTE *pOFF_BYTES = (BYTE*)ADR;
for( int i = 0; i < SIZE; i++ )
{
OFF_BYTES = pOFF_BYTES;
}
memcpy_s((void*)ADR,(const void*)ON_BYTES,SIZE);
STATUS=PATCHED;
}
}
void cPatch::Restore()
{
if(STATUS==PATCHED)
{
memcpy_s((void*)ADR,(const void*)OFF_BYTES,SIZE);
STATUS=NORMAL;
}
}
extern "C" int __cdecl mlde32(void *codeptr);
//---------------DETOURS-------------------------------//
DWORD B8Detours( DWORD SrcVA, DWORD DstVA, DWORD Size )
{
#define SIZEOF_MOVEAX_JMPEAX 12
DWORD DetourVA, dwProtect, i;
if ( SrcVA && DstVA && Size >= SIZEOF_MOVEAX_JMPEAX )
{
DetourVA = (DWORD) VirtualAlloc(
NULL, Size + SIZEOF_MOVEAX_JMPEAX,
MEM_COMMIT, PAGE_EXECUTE_READWRITE );
if ( DetourVA && VirtualProtect( (VOID*)SrcVA, Size, PAGE_EXECUTE_READWRITE, &dwProtect ) )
{
for ( i=0; i < Size; i++ ) {
*(BYTE*)( DetourVA + i ) = *(BYTE*)( SrcVA + i );
}
*(BYTE*)( DetourVA + Size + 0 ) = 0xB8;
*(DWORD*)( DetourVA + Size + 1 ) = ( SrcVA + Size );
*(WORD*)( DetourVA + Size + 5 ) = 0xE0FF;
*(BYTE*)( SrcVA + 0 ) = 0xB8;
*(DWORD*)( SrcVA + 1 ) = ( DstVA );
*(WORD*)( SrcVA + 5 ) = 0xE0FF;
VirtualProtect( (VOID*)SrcVA, Size, dwProtect, &dwProtect );
VirtualProtect( (VOID*)DetourVA, Size +
SIZEOF_MOVEAX_JMPEAX, PAGE_EXECUTE_READ, &dwProtect );
return DetourVA;
}
}
return(0);
}
void UnlinkModule(HINSTANCE hDll)
{
DWORD dwPEB_LDR_DATA = 0;
_asm
{
pushad;
pushfd;
mov eax, fs:[30h]
mov eax, [eax+0Ch]
mov dwPEB_LDR_DATA, eax
InLoadOrderModuleList:
mov esi, [eax+0Ch]
mov edx, [eax+10h]
LoopInLoadOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+18h]
cmp ecx, hDll
jne SkipA
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InMemoryOrderModuleList
SkipA:
cmp edx, esi
jne LoopInLoadOrderModuleList
InMemoryOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+14h]
mov edx, [eax+18h]
LoopInMemoryOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+10h]
cmp ecx, hDll
jne SkipB
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InInitializationOrderModuleList
SkipB:
cmp edx, esi
jne LoopInMemoryOrderModuleList
InInitializationOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+1Ch]
mov edx, [eax+20h]
LoopInInitializationOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+08h]
cmp ecx, hDll
jne SkipC
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp Finished
SkipC:
cmp edx, esi
jne LoopInInitializationOrderModuleList
Finished:
popfd;
popad;
}
}
typedef HRESULT (WINAPI* oDrawIndexedPrimitive) (LPDIRECT3DDEVICE9 rpDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount);
oDrawIndexedPrimitive pDrawIndexedPrimitive;
inline HRESULT WINAPI myDrawIndexedPrimitive(LPDIRECT3DDEVICE9 rpDevice, D3DPRIMITIVETYPE pType D3DparamX ,UINT nMinIndex, UINT nNumVertices, UINT nStartIndex, UINT nPrimitiveCount )
{
__asm
{
}
npDevice = rpDevice;
}
if(Colors)
{
GenerateTexture(rpDevice, &texGreen,D3DCOLOR_ARGB(255,0,255,0));
GenerateTexture(rpDevice, &texYellow , D3DCOLOR_ARGB(255,255,255,0));
GenerateTexture(rpDevice, &texRed, D3DCOLOR_ARGB(255,255,0,0));
GenerateTexture(rpDevice, &texBlue, D3DCOLOR_ARGB(255,0,0,255));
GenerateTexture(rpDevice, &texPurple, D3DCOLOR_ARGB(255,160,0,255));
GenerateTexture(rpDevice, &texPink, D3DCOLOR_ARGB(255,255,192,203));
GenerateTexture(rpDevice, &texOrange, D3DCOLOR_ARGB(255,0,0,204));
GenerateTexture(rpDevice, &texBlack, D3DCOLOR_ARGB(255, 0, 0, 0));
Colors=false;
}
LPDIRECT3DVERTEXBUFFER9 vertexBuf;
UINT Offset = 0;
UINT Stride = 64;
if(rpDevice->GetStreamSource(0, &vertexBuf, &Offset, &Stride) == D3D_OK)
vertexBuf->Release();
//****************************************************************************************************************//
if (GetAsyncKeyState(VK_INSERT)&1)
//if(CALL)
{
if (Stride==44)
{
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texYellow);
pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texYellow);
}
if (Stride==52)
{
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texGreen);
pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_FILLMODE,D3DFILL_SOLID);
rpDevice->SetTexture(0, texGreen);
}
}
if (GetAsyncKeyState(VK_DELETE)&1)
//if(B)
{
if(SMOKE)
{
return D3D_OK;
}
}
/*
if(CALL)
if(Stride == 48 || Stride == 52 || Stride ==0x24 || Stride == 64 )
{
rpDevice->SetRenderState(D3DRS_ZENABLE, false);
rpDevice->SetRenderState(D3DRS_ZENABLE, true);
rpDevice->SetRenderState(D3DRS_ZENABLE,false);
}*/
__asm
{
}
return pDrawIndexedPrimitive(rpDevice,pType D3DparamvalX,nMinIndex,nNumVertices,nStartIndex,nPrimitiveCount);
}
void HideModule(HINSTANCE hModule)
{
DWORD dwPEB_LDR_DATA = 0;
_asm
{
pushad;
pushfd;
mov eax, fs:[30h]
mov eax, [eax+0Ch]
mov dwPEB_LDR_DATA, eax
InLoadOrderModuleList:
mov esi, [eax+0Ch]
mov edx, [eax+10h]
LoopInLoadOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+18h]
cmp ecx, hModule
jne SkipA
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InMemoryOrderModuleList
SkipA:
cmp edx, esi
jne LoopInLoadOrderModuleList
InMemoryOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+14h]
mov edx, [eax+18h]
LoopInMemoryOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+10h]
cmp ecx, hModule
jne SkipB
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp InInitializationOrderModuleList
SkipB:
cmp edx, esi
jne LoopInMemoryOrderModuleList
InInitializationOrderModuleList:
mov eax, dwPEB_LDR_DATA
mov esi, [eax+1Ch]
mov edx, [eax+20h]
LoopInInitializationOrderModuleList:
lodsd
mov esi, eax
mov ecx, [eax+08h]
cmp ecx, hModule
jne SkipC
mov ebx, [eax]
mov ecx, [eax+4]
mov [ecx], ebx
mov [ebx+4], ecx
jmp Finished
SkipC:
cmp edx, esi
jne LoopInInitializationOrderModuleList
Finished:
popfd;
popad;
}
}
//---------------------------------------------------------------//
int D3D(void)
{
HINSTANCE hD3D;
DWORD vTable[124];
hD3D=0;
do {
hD3D = GetModuleHandle("d3d9.dll");
if (!hD3D) Sleep(150);
}
while(!hD3D);
if (D3Ddiscover((void *)&vTable[0],420)==NULL)
return 0;
{
while(1)
{
if(memcmp((void*)vTable[82],(void*)(PBYTE)"\x8B\xFF",1)== 0)
{
pDrawIndexedPrimitive = (oDrawIndexedPrimitive) B8Detours((DWORD)vTable[74+8], (DWORD)myDrawIndexedPrimitive,12 );
}
Sleep(110);
}
return 0;
}
}
//---------------------------------------------------------------------------------------------------------------------------------//
BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hDll);
if (dwReason == DLL_PROCESS_ATTACH)
{
HideModule(hDll);
MessageBox (0,"FITUR:\n*WALLHACK\n*NO SMOKE\n*AMMO UNLIMITED\n\nHOTKEY:\n*AUTO ON SEMUA\n\nSPESIAL THANK'S:\n\n*Febrii Np Razy Kmpt","--==||R<>E<>S||==--", MB_OK | MB_ICONEXCLAMATION);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)D3D, 0, 0, 0);
//CreateThread(0, 0, (LPTHREAD_START_ROUTINE)LCOI, 0, 0, 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)SonYGantenG, 0, 0, 0);
}
return FALSE;
}
/******************************************************--==||R<>E<>S||==--******************************************************/