Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › CrossFire Hacks & Cheats › CF:Simple D3d Hook

TalkingCF:Simple D3d Hook

Posts 1–10 of 10 · Page 1 of 1
HU
Hungry
CF:Simple D3d Hook
Maybe Usefull for someone making hack.
Creds:Strife, Fatboy88


#include <Windows.h>
#include <d3d9.h>
#include <detours.h>

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


IDirect3DDevice9 * pGameDevice;

////////////////
///BeginScene///
////////////////
typedef HRESULT(WINAPI* BeginScene_)(LPDIRECT3DDEVICE9 pDevice);
BeginScene_ pBeginScene;
HRESULT WINAPI nBeginScene(LPDIRECT3DDEVICE9 pDevice)
{
_asm NOP;
HRESULT hRet = pBeginScene(pDevice);






return hRet;
}

/************************************************** ************************************************/

//////////////
///EndScene///
//////////////
typedef HRESULT(WINAPI* EndScene_)(LPDIRECT3DDEVICE9 pDevice);
EndScene_ pEndScene;
HRESULT WINAPI nEndScene(LPDIRECT3DDEVICE9 pDevice)
{

HRESULT hRet = pEndScene(pDevice);




return hRet;
}

/************************************************** ************************************************/

//////////////////////////
///DrawIndexedPrimitive///
//////////////////////////
typedef HRESULT(WINAPI* DrawIndexedPrimitive_)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
UINT NumVertices, UINT StartIndex, UINT PrimitiveCount);
DrawIndexedPrimitive_ pDrawIndexedPrimitive;
HRESULT WINAPI nDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinIndex,
UINT NumVertices, UINT StartIndex, UINT PrimitiveCount)
{


{

pDevice->SetRenderState( D3DRS_FOGENABLE, false );//useless engine has it set to 0 Tablefog is on tho


}



IDirect3DVertexBuffer9* pStreamData = NULL;

UINT iOffsetInBytes,iStride;

pDevice->GetStreamSource(0,&pStreamData,&iOffsetInBytes, &i Stride);

if ( iStride == 40 )


{


pDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_FALSE );
pDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_NEVER );


}






return pDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimitiveCount);


}

/************************************************** ************************************************/

/////////////////////
///SetStreamSource///
/////////////////////
typedef HRESULT(WINAPI* SetStreamSource_)(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride);
SetStreamSource_ pSetStreamSource;
HRESULT WINAPI nSetStreamSource(LPDIRECT3DDEVICE9 pDevice, UINT StreamNumber, IDirect3DVertexBuffer9 * pStreamData, UINT OffsetInBytes, UINT Stride)
{
_asm NOP;
HRESULT hRet = pSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);

return hRet;
}

/************************************************** ************************************************/

///////////
///Reset///
///////////
typedef HRESULT(WINAPI* Reset_)(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters);
Reset_ pReset;
HRESULT WINAPI nReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
{
_asm NOP;
HRESULT hRet = pReset(pDevice, pPresentationParameters);

return hRet;
}

/************************************************** ************************************************/


DWORD dwWait(LPVOID lpArgs)
{

DWORD Base = NULL;

for (;Base == NULL;Sleep(100))
Base = (DWORD)GetModuleHandle("crossfire.exe");

for(;pGameDevice == NULL; Sleep(10000))
{
DWORD dwProtect;
VirtualProtect((void*)(0x70A440), 4, PAGE_EXECUTE_READWRITE, &dwProtect);
memcpy(&pGameDevice, (void*)(0x70A440), 4);
VirtualProtect((void*)(0x70A440), 4, dwProtect, NULL);
}




DWORD* pdwNewDevice = *(DWORD**)pGameDevice;
pdwNewDevice = (DWORD*)pdwNewDevice[0]; //turn our pointer into an array for the vtable*/


// pReset = (Reset_)DetourFunction((PBYTE)pdwNewDevice[16],(PBYTE)nReset);
// pBeginScene = (BeginScene_)DetourFunction((PBYTE)pdwNewDevice[41],(PBYTE)nBeginScene);
pEndScene = (EndScene_)DetourFunction((PBYTE)pdwNewDevice[42],(PBYTE)nEndScene);
// pDrawIndexedPrimitive = (DrawIndexedPrimitive_)DetourFunction((PBYTE)pdwNe wDevice[82],(PBYTE)nDrawIndexedPrimitive);
// pSetStreamSource = (SetStreamSource_)DetourFunction((PBYTE)pdwNewDevi ce[100],(PBYTE)nSetStreamSource);

return 0;
}

bool WINAPI DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
if(dwReason == DLL_PROCESS_ATTACH)
{

CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwWait, NULL, NULL, NULL);

return true;
}

return false;
}
#1 · 16y ago
AsianNick
AsianNick
There's a coding section for this and anyone who wants to compile it

Bloodshed ftw
#2 · 16y ago
HowHate
HowHate
Upload the DLL not the source code lol!
#3 · 16y ago
konefke
konefke
Quote Originally Posted by HowHate View Post
Upload the DLL not the source code lol!
agree 100%.
#4 · 16y ago
CR
CrossRaiders
Quote Originally Posted by HowHate View Post
Upload the DLL not the source code lol!
Quote Originally Posted by konefke View Post
agree 100%.
I agree 101% Lol
#5 · 16y ago
Amy_x
Amy_x
This needs in the coding section
I should say nice work..
But i dnt get a fuck of this XD
#6 · 16y ago
BU
buraks
*gives Amy a headshot* good enough? LOL
#7 · 16y ago
IC
icones
upload is dll please
#8 · 16y ago
LU
lukekis015
Quote Originally Posted by icones View Post
upload is dll please
i agree 250%
#9 · 16y ago
TA
TaBz3
Quote Originally Posted by abel09 View Post
I agree 101% Lol
102% :P
#10 · 16y ago
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

  • Most simple d3d hookBy Lyoto Machida in C++/C Programming
    4Last post 15y ago
  • WR D3D Hook - =o - 03/22/07By Dave84311 in Hack/Release News
    14Last post 18y ago
  • WR D3D Hook - =o - 09/21/07By Dave84311 in Hack/Release News
    26Last post 18y ago
  • D3D hooking tutorial 5 i thinkBy llvengancell in WarRock - International Hacks
    7Last post 19y ago
  • WR D3D Hook Updated to include Punkbuster Hardware Bypass!By Dave84311 in Hack/Release News
    3Last post 18y ago

Tags for this Thread

None