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 › Other First Person Shooter Hacks › Homefront Hacks › no pub hacks yet?

no pub hacks yet?

Posts 1–11 of 11 · Page 1 of 1
Birdshit
Birdshit
no pub hacks yet?
so nobody is gonna even try to compete with artyfagyl aiming?
#1 · 15y ago
MS
msr890
yeah it would Be nice if some one made a pub for this... there not even useing vac... so im suprised no one has yet... then agein it seems no one here pays any attention to this game.. even though its so much better than cod... "imo"
#2 · 15y ago
SL
Slaytanic
I agree it's better than fail ops

it's a diff engine and no one really did much for bc2 or moh so not really suprised.

There are hacks out there though cause I played with a guy who was sniping from within a building and headshotting my whole team
now I don't know the maps that well but I quit on the 15th headshot he got on me and I was inside a building he couldn't even see if playing legit
#3 · 15y ago
Birdshit
Birdshit
the only hacks available are from the most prolific paid hack site
the best I could do is some lame ass chams and maybe a getpixel based autoshoot but thats it... I dont even know where to begin to make an aimbot.

http://www.mpgh.net/forum/261-medal-...riggerbot.html

I could probably just slap it together with some new model recognition but Id have to install the model stride logger, AND visual C++...

Update:

I ran the D3D9 Model Logger and apparently the stride for all player models is 36... I have to go to work now but when I get home I'll do the full model recognition and install C++ anyone willing to team up with me to add an aimbot?

I have absolutely no clue(not exactly, I know you use cheat engine, but thats it) how to reverse offsets for player entities and clientinfo or anything like that so until someone could spoonfeed me those things I cannot C+P an aimbot (from the many available snippets) although chams should be enough to allow considerable ownage from those who already have the ability to aim for themselves

Update Again:
Got everything installed and now wonder... how will we know when vac has finally been enabled for this game?

Update Again:
for some reason the model logger still works but even if I change the code of my MOH hack to just a generic m_Stride == 36 instead of the model rec, it doesnt work? why? too confused and too tired to figure it out now.
#4 · edited 15y ago · 15y ago
SC
Scyin
Posting up in here to support the progress. If you need any coding assistance or suggestions let me know. As long as it's C++ or C#
#5 · 15y ago
Birdshit
Birdshit
I copied and pasted my old hacks code and changed the DrawIndexedPrimitive area to the new stride and removed all the primCount but it plain just doesnt show up ingame, not even the crosshair, yet if I load up the D3D9 model logger dll by strife, it works...

the entire code for d3d9dev.cpp (Azorbix Starterkit):


Code:
/*	Direct3D9 Device */

#include <windows.h>
#include "main.h"
#include "d3d9.h"
#include "stdio.h"

#define D3DHOOK_TEXTURES //comment this to disable texture hooking
#define PI 3.14159265

bool shoot;
bool shootwall;
bool xhair;
bool Chams;
UINT m_Stride;
UINT modelrec;

ID3DXLine *pLine; 

LPD3DXFONT pFont;
LPDIRECT3DDEVICE9 pDevice;  

IDirect3DPixelShader9* shaderRed;
IDirect3DPixelShader9* shaderBlue;

D3DVIEWPORT9 Viewport;
D3DCOLOR dCIRCLE		= D3DCOLOR_ARGB( 255, 0, 255, 0);//green
D3DCOLOR dCIRCLE2		= D3DCOLOR_ARGB( 255, 255, 0, 0);//red

void TriggerBotWall()
{
	COLORREF		        cPixelb;
	COLORREF		        cPixelb2;

	HWND			d3dhwnd2;
	HDC				d3ddc2;

	d3dhwnd2 = GetForegroundWindow();
    d3ddc2 = GetDC(d3dhwnd2);

	{
	cPixelb = GetPixel( d3ddc2, (Viewport.Width/2)-3, (Viewport.Height/2)-2);
	cPixelb2 = GetPixel( d3ddc2, (Viewport.Width/2)+3, (Viewport.Height/2)-2);

	// shootAT BLUE Chams (thru walls)
	if(GetRValue(cPixelb)<= 100
	&& GetGValue(cPixelb)<= 100
	&& GetBValue(cPixelb)>= 200
	&& GetRValue(cPixelb2)<= 100
	&& GetGValue(cPixelb2)<= 100
	&& GetBValue(cPixelb2)>= 200)

	
	{
	// QUICKSCOPE METHOD -  SORT of works
	 // keybd_event(VK_RCONTROL, 0xA3, KEYEVENTF_EXTENDEDKEY | 0,0);// assign Right CTRL to scope and toggle aim off
		mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, NULL, NULL); // Simulate click
		mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, NULL, NULL);
	 // keybd_event(VK_RCONTROL, 0xA3, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
	
		//mouse_event(MOUSEEVENTF_ABSOLUTE,((Viewport.Width/2)* (65535/Viewport.Width)),((Viewport.Height/2)-4* (65535/Viewport.Height)), NULL, NULL);
	}
	} // End X loop
	ReleaseDC(d3dhwnd2,d3ddc2);
}
void TriggerBot()
{
	COLORREF		        cPixelr;
	COLORREF		        cPixelr2;

	HWND			d3dhwnd;
	HDC				d3ddc;

	d3dhwnd = GetForegroundWindow();
    d3ddc = GetDC(d3dhwnd);

	{
	cPixelr = GetPixel( d3ddc, (Viewport.Width/2)-3, (Viewport.Height/2)-2);
	cPixelr2 = GetPixel( d3ddc, (Viewport.Width/2)+3, (Viewport.Height/2)-2);

	
	// AIM AT BLUE Chams
	//if(GetRValue(cPixel)<= 74
	//&& GetGValue(cPixel)<= 74
	//&& GetBValue(cPixel)>= 250)

        // AIM AT RED Chams

	if(GetRValue(cPixelr)>= 220
	&& GetGValue(cPixelr)<= 100
	&& GetBValue(cPixelr)<= 100
	&& GetRValue(cPixelr2)>= 220
	&& GetGValue(cPixelr2)<= 100
	&& GetBValue(cPixelr2)<= 100)
	{
	//keybd_event(VK_RCONTROL, 0xA3, KEYEVENTF_EXTENDEDKEY | 0,0);// bad quickscope attempt assign Right CTRL to scope and toggle aim off
	//keybd_event(VK_RCONTROL, 0xA3, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, NULL, NULL); // Simulate click
		
		mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, NULL, NULL); // Simulate click
		mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, NULL, NULL);
		
		//mouse_event(MOUSEEVENTF_ABSOLUTE,((Viewport.Width/2)* (65535/Viewport.Width)),((Viewport.Height/2)* (65535/Viewport.Height)), NULL, NULL);
		//mouse_event(MOUSEEVENTF_ABSOLUTE,((Viewport.Width/2)* (65535/Viewport.Width)),((Viewport.Height/2+2)* (65535/Viewport.Height)), NULL, NULL);
	//mouse_event(MOUSEEVENTF_ABSOLUTE,(Viewport.Width/2)+4,(Viewport.Height/2)-4, NULL, NULL);
	//mouse_event(MOUSEEVENTF_ABSOLUTE,(Viewport.Width/2)-4,(Viewport.Height/2)+4, NULL, NULL);
	//mouse_event(MOUSEEVENTF_ABSOLUTE,(Viewport.Width/2),(Viewport.Height/2)-4, NULL, NULL);
		//mouse_event(MOUSEEVENTF_MOVE,0,20,0,0);
		//mouse_event(MOUSEEVENTF_MOVE,20,-20,0,0); 
		//mouse_event(MOUSEEVENTF_MOVE,-20,20,0,0); 
		//mouse_event(MOUSEEVENTF_MOVE,-20,-20,0,0);
		//mouse_event(MOUSEEVENTF_MOVE,20,20,0,0); 
		//mouse_event(MOUSEEVENTF_MOVE,0,-20,0,0)

	}
	}
 ReleaseDC(d3dhwnd,d3ddc);
} // End X loop
//void DrawCircle(int X, int Y, int radius, int numSides, DWORD Color)
//{
//    D3DXVECTOR2 Line[128];
//    float Step = PI * 2.0 / numSides;
//    int Count = 0;
//    for (float a=0; a < PI*2.0; a += Step)
//    {
//        float X1 = radius * cos(a) + X;
//        float Y1 = radius * sin(a) + Y;
//        float X2 = radius * cos(a+Step) + X;
//        float Y2 = radius * sin(a+Step) + Y;
//        Line[Count].x = X1;
//        Line[Count].y = Y1;
//        Line[Count+1].x = X2;
//        Line[Count+1].y = Y2;
//        Count += 2;
//    }
//    pLine->Begin();
//    pLine->Draw(Line,Count,Color);
//    pLine->End();
//	pLine->Release();
//}  
HRESULT GenerateShader(IDirect3DDevice9 *pD3Ddev, IDirect3DPixelShader9 **pShader, float r, float g, float b, float a)
{
	char szShader[256];
	ID3DXBuffer *pShaderBuf = NULL;
	sprintf_s (szShader, "ps_2_0\ndef c0, %f, %f, %f, %f\nmov oC0, c0", r, g, b, a);
	D3DXAssembleShader(szShader, sizeof(szShader), NULL, NULL, 0, &pShaderBuf, NULL);

	if(FAILED(pD3Ddev->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)))
		return E_FAIL;

	return S_OK;
}


HRESULT CD3DManager::Initialize()
{
    /*
    initialize Resources such as textures 
    (managed and unmanaged [D3DPOOL]), 
    vertex buffers, and other D3D rendering resources
    ...
    m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
    */
  GenerateShader(m_pD3Ddev, &shaderRed,  255, 0, 0, 255);
  GenerateShader(m_pD3Ddev, &shaderBlue,  0, 0, 255, 255);

    return S_OK;
}  

HRESULT CD3DManager::PreReset()
{
	/*
	release all UNMANAGED [D3DPOOL_DEFAULT] 
	textures, vertex buffers, and other 
	volitile resources
	...
	_SAFE_RELEASE(m_pD3Dtexture);
	*/
	return S_OK;
}

HRESULT CD3DManager::PostReset()
{
	/*
	re-initialize all UNMANAGED [D3DPOOL_DEFAULT]
	textures, vertex buffers, and other volitile 
	resources
	...
	m_pD3Ddev->CreateTexture(..., ..., &m_pD3Dtexture);
	*/
	
	GenerateShader(m_pD3Ddev, &shaderRed,  255, 0, 0, 255);
	GenerateShader(m_pD3Ddev, &shaderBlue,  0, 0, 255, 255);

	return S_OK;
}

HRESULT CD3DManager::Release()
{
	/*
	Release all textures, vertex buffers, and 
	other resources
	...
	_SAFE_RELEASE(m_pD3Dtexture);
	*/
	return S_OK;
}

//-----------------------------------------------------------------------------

HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, LPVOID *ppvObj) 
{
	return m_pD3Ddev->QueryInterface(riid, ppvObj);
}

ULONG APIENTRY hkIDirect3DDevice9::AddRef() 
{
	m_refCount++;
	return m_pD3Ddev->AddRef();
}

HRESULT APIENTRY hkIDirect3DDevice9::BeginScene() 
	{
		m_pD3Ddev->GetViewport(&Viewport);

			if (GetAsyncKeyState(VK_INSERT)&1)
{
	Chams = !Chams;
}
			if (GetAsyncKeyState(VK_HOME)&1)
{
	xhair = !xhair;
}
			if (GetAsyncKeyState(VK_DELETE)&1)
{
	shoot = !shoot;
}
			if (GetAsyncKeyState(VK_END)&1)
{
	shootwall = !shootwall;
}
	return m_pD3Ddev->BeginScene();
}

HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock() 
{
	return m_pD3Ddev->BeginStateBlock();
}

HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT *pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) 
{
	return m_pD3Ddev->Clear(Count, pRects, Flags, Color, Z, Stencil);
}

HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface,CONST RECT* pRect, D3DCOLOR color) 
{	
	return m_pD3Ddev->ColorFill(pSurface,pRect,color);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS *pPresentationParameters, IDirect3DSwapChain9 **ppSwapChain) 
{
	return m_pD3Ddev->CreateAdditionalSwapChain(pPresentationParameters, ppSwapChain);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality,Discard,ppSurface, pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateOffscreenPlainSurface(Width,Height,Format,Pool,ppSurface,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) 
{
	return m_pD3Ddev->CreatePixelShader(pFunction, ppShader);
}
HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) 
{
	if (m_Stride = 36)
	{
    if( Type == D3DQUERYTYPE_OCCLUSION )
    {
        Type = D3DQUERYTYPE_TIMESTAMP;
    }
	}
	return m_pD3Ddev->CreateQuery(Type,ppQuery);
}
HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateRenderTarget(Width, Height, Format, MultiSample,MultisampleQuality, Lockable, ppSurface,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) 
{
	return m_pD3Ddev->CreateStateBlock(Type, ppSB);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) 
{
	HRESULT ret = m_pD3Ddev->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);

#ifdef D3DHOOK_TEXTURES
	if(ret == D3D_OK) { new hkIDirect3DTexture9(ppTexture, this, Width, Height, Format); }
#endif

	return ret;
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) 
{
	return m_pD3Ddev->CreateVertexDeclaration(pVertexElements,ppDecl);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) 
{
	return m_pD3Ddev->CreateVertexShader(pFunction, ppShader);
}

HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) 
{
	return m_pD3Ddev->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture,pSharedHandle);
}

HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle) 
{
	return m_pD3Ddev->DeletePatch(Handle);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE Type,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
		if (Chams) 
	{
		if ((m_Stride == 36))
		{
		m_pD3Ddev->SetRenderState( D3DRS_ZENABLE,false );
        m_pD3Ddev->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
        m_pD3Ddev->SetTexture( 0, NULL);
		m_pD3Ddev->SetPixelShader( NULL ); 
		m_pD3Ddev->SetPixelShader( shaderBlue );
        m_pD3Ddev->DrawIndexedPrimitive(Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
        m_pD3Ddev->SetRenderState( D3DRS_ZENABLE, true );
        m_pD3Ddev->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
        m_pD3Ddev->SetTexture( 0, NULL );
		m_pD3Ddev->SetTexture(0, NULL );
		m_pD3Ddev->SetPixelShader( NULL );
		m_pD3Ddev->SetPixelShader( shaderRed );

}
	}
	return m_pD3Ddev->DrawIndexedPrimitive(Type,BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinIndex, UINT NumVertices, UINT PrimitiveCount, CONST void *pIndexData, D3DFORMAT IndexDataFormat, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride) 
{	
	return m_pD3Ddev->DrawIndexedPrimitiveUP(PrimitiveType, MinIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) 
{
	return m_pD3Ddev->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void *pVertexStreamZeroData, UINT VertexStreamZeroStride) 
{
	return m_pD3Ddev->DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float *pNumSegs, CONST D3DRECTPATCH_INFO *pRectPatchInfo) 
{
	return m_pD3Ddev->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
}

HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float *pNumSegs, CONST D3DTRIPATCH_INFO *pTriPatchInfo)
{
	return m_pD3Ddev->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
}

HRESULT APIENTRY hkIDirect3DDevice9::EndScene()
{
	GenerateShader(m_pD3Ddev, &shaderRed,  255, 0, 0, 255);
	GenerateShader(m_pD3Ddev, &shaderBlue,  0, 0, 255, 255);

				if (shoot)
	  {
		TriggerBot();
	  }
		if (shootwall)
	  {
		TriggerBotWall();
	  }
	if(xhair)
		{
			D3DRECT aimdot3 = {(Viewport.Width/2)-1,(Viewport.Height/2)-2, (Viewport.Width/2)+1,(Viewport.Height/2)};
		    m_pD3Ddev->Clear(1, &aimdot3, D3DCLEAR_TARGET,dCIRCLE2, 0,  0);
		}			
return m_pD3Ddev->EndScene();
}

HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) 
{
	return m_pD3Ddev->EndStateBlock(ppSB);
}

HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources() 
{
	return m_pD3Ddev->EvictManagedResources();
}

UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem() 
{
	return m_pD3Ddev->GetAvailableTextureMem();
}

HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) 
{
	return m_pD3Ddev->GetBackBuffer(iSwapChain,iBackBuffer, Type, ppBackBuffer);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float *pPlane) 
{
	return m_pD3Ddev->GetClipPlane(Index, pPlane);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9 *pClipStatus) 
{
	return m_pD3Ddev->GetClipStatus(pClipStatus);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS *pParameters) 
{
	return m_pD3Ddev->GetCreationParameters(pParameters);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT *pPaletteNumber)
{
	return m_pD3Ddev->GetCurrentTexturePalette(pPaletteNumber);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9 **ppZStencilSurface) 
{
	return m_pD3Ddev->GetDepthStencilSurface(ppZStencilSurface);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9 *pCaps) 
{
	return m_pD3Ddev->GetDeviceCaps(pCaps);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9 **ppD3D9) 
{
	HRESULT hRet = m_pD3Ddev->GetDirect3D(ppD3D9);
	if( SUCCEEDED(hRet) )
		*ppD3D9 = m_pD3Dint;
	return hRet;
}

HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain,D3DDISPLAYMODE* pMode) 
{
	return m_pD3Ddev->GetDisplayMode(iSwapChain,pMode);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain,IDirect3DSurface9* pDestSurface) 
{
	return m_pD3Ddev->GetFrontBufferData(iSwapChain,pDestSurface);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF) 
{
	return m_pD3Ddev->GetFVF(pFVF);
}

void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain,D3DGAMMARAMP* pRamp) 
{
	m_pD3Ddev->GetGammaRamp(iSwapChain,pRamp);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) 
{
	return m_pD3Ddev->GetIndices(ppIndexData);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9 *pLight) 
{
	return m_pD3Ddev->GetLight(Index, pLight);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL *pEnable) 
{
	return m_pD3Ddev->GetLightEnable(Index, pEnable);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9 *pMaterial) 
{
	return m_pD3Ddev->GetMaterial(pMaterial);
}

float APIENTRY hkIDirect3DDevice9::GetNPatchMode() 
{
	return m_pD3Ddev->GetNPatchMode();
}

unsigned int APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains() 
{
	return m_pD3Ddev->GetNumberOfSwapChains();
}

HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY *pEntries)
{
	return m_pD3Ddev->GetPaletteEntries(PaletteNumber, pEntries);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) 
{
	return m_pD3Ddev->GetPixelShader(ppShader);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount) 
{
	return m_pD3Ddev->GetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) 
{
	return m_pD3Ddev->GetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
{
	return m_pD3Ddev->GetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) 
{
	return m_pD3Ddev->GetRasterStatus(iSwapChain,pRasterStatus);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD *pValue) 
{
	return m_pD3Ddev->GetRenderState(State, pValue);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) 
{
	return m_pD3Ddev->GetRenderTarget(RenderTargetIndex,ppRenderTarget);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) 
{
	return m_pD3Ddev->GetRenderTargetData(pRenderTarget,pDestSurface);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) 
{
	return m_pD3Ddev->GetSamplerState(Sampler,Type,pValue);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect) 
{
	return m_pD3Ddev->GetScissorRect(pRect);
}

BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing() 
{
	return m_pD3Ddev->GetSoftwareVertexProcessing();
}

HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* OffsetInBytes,UINT* pStride) 
{
	return m_pD3Ddev->GetStreamSource(StreamNumber, ppStreamData,OffsetInBytes, pStride);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber,UINT* Divider) 
{
	return m_pD3Ddev->GetStreamSourceFreq(StreamNumber,Divider);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain,IDirect3DSwapChain9** pSwapChain)
{
	return m_pD3Ddev->GetSwapChain(iSwapChain,pSwapChain);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9 **ppTexture) 
{
	return m_pD3Ddev->GetTexture(Stage, ppTexture);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *pValue) 
{
	return m_pD3Ddev->GetTextureStageState(Stage, Type, pValue);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX *pMatrix) 
{
	return m_pD3Ddev->GetTransform(State, pMatrix);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) 
{
	return m_pD3Ddev->GetVertexDeclaration(ppDecl);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) 
{
	return m_pD3Ddev->GetVertexShader(ppShader);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister,BOOL* pConstantData,UINT BoolCount)
{
	return m_pD3Ddev->GetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister,float* pConstantData,UINT Vector4fCount) 
{

	return m_pD3Ddev->GetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister,int* pConstantData,UINT Vector4iCount)
{
	return m_pD3Ddev->GetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9 *pViewport) 
{
	return m_pD3Ddev->GetViewport(pViewport);
}

HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD LightIndex, BOOL bEnable) 
{
	return m_pD3Ddev->LightEnable(LightIndex, bEnable);
}

HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) 
{
	return m_pD3Ddev->MultiplyTransform(State, pMatrix);
}

HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion) 
{	
	return m_pD3Ddev->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}

HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) 
{
	return m_pD3Ddev->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer,pVertexDecl, Flags);
}

ULONG APIENTRY hkIDirect3DDevice9::Release() 
{
	if( --m_refCount == 0 )
		m_pManager->Release();

	return m_pD3Ddev->Release();
}

HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS *pPresentationParameters) 
{
	m_pManager->PreReset();

	HRESULT hRet = m_pD3Ddev->Reset(pPresentationParameters);

	if( SUCCEEDED(hRet) )
	{
		m_PresentParam = *pPresentationParameters;
		m_pManager->PostReset();
	}

	return hRet;
}

HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float *pPlane) 
{
	return m_pD3Ddev->SetClipPlane(Index, pPlane);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9 *pClipStatus) 
{
	return m_pD3Ddev->SetClipStatus(pClipStatus);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) 
{
	return m_pD3Ddev->SetCurrentTexturePalette(PaletteNumber);
}

void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags)
{	
	m_pD3Ddev->SetCursorPosition(X, Y, Flags);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9 *pCursorBitmap) 
{
	return m_pD3Ddev->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) 
{
	return m_pD3Ddev->SetDepthStencilSurface(pNewZStencil);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) 
{
	return m_pD3Ddev->SetDialogBoxMode(bEnableDialogs);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF) 
{
	return m_pD3Ddev->SetFVF(FVF);
}

void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp)
{
	m_pD3Ddev->SetGammaRamp(iSwapChain,Flags, pRamp);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) 
{
	return m_pD3Ddev->SetIndices(pIndexData);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9 *pLight) 
{
	return m_pD3Ddev->SetLight(Index, pLight);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9 *pMaterial) 
{	
	return m_pD3Ddev->SetMaterial(pMaterial);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments) 
{	
	return m_pD3Ddev->SetNPatchMode(nSegments);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY *pEntries) 
{
	return m_pD3Ddev->SetPaletteEntries(PaletteNumber, pEntries);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) 
{
	return m_pD3Ddev->SetPixelShader(pShader);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount) 
{
	return m_pD3Ddev->SetPixelShaderConstantB(StartRegister,pConstantData,BoolCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) 
{
	return m_pD3Ddev->SetPixelShaderConstantF(StartRegister,pConstantData,Vector4fCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) 
{
	return m_pD3Ddev->SetPixelShaderConstantI(StartRegister,pConstantData,Vector4iCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) 
{
	return m_pD3Ddev->SetRenderState(State, Value);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) 
{
	return m_pD3Ddev->SetRenderTarget(RenderTargetIndex,pRenderTarget);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) 
{
	return m_pD3Ddev->SetSamplerState(Sampler,Type,Value);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect) 
{
	return m_pD3Ddev->SetScissorRect(pRect);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) 
{
	return m_pD3Ddev->SetSoftwareVertexProcessing(bSoftware);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) 
{
	if( StreamNumber == 0 )
	{
	m_Stride = Stride;
	}

	return m_pD3Ddev->SetStreamSource(StreamNumber, pStreamData,OffsetInBytes, Stride);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber,UINT Divider)
{	
	return m_pD3Ddev->SetStreamSourceFreq(StreamNumber,Divider);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9 *pTexture) 
{
#ifdef D3DHOOK_TEXTURES
	IDirect3DDevice9 *dev = NULL;
	if(pTexture != NULL && ((hkIDirect3DTexture9*)(pTexture))->GetDevice(&dev) == D3D_OK)
	{
		if(dev == this)
			return m_pD3Ddev->SetTexture(Stage, ((hkIDirect3DTexture9*)(pTexture))->m_D3Dtex);
	}
#endif
	
	return m_pD3Ddev->SetTexture(Stage, pTexture);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) 
{
	return m_pD3Ddev->SetTextureStageState(Stage, Type, Value);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX *pMatrix) 
{
	return m_pD3Ddev->SetTransform(State, pMatrix);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) 
{
	return m_pD3Ddev->SetVertexDeclaration(pDecl);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) 
{
	return m_pD3Ddev->SetVertexShader(pShader);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister,CONST BOOL* pConstantData,UINT  BoolCount) 
{
	return m_pD3Ddev->SetVertexShaderConstantB(StartRegister,pConstantData,BoolCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) 
{
	return m_pD3Ddev->SetVertexShaderConstantF(StartRegister,pConstantData,Vector4fCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) 
{
	return m_pD3Ddev->SetVertexShaderConstantI(StartRegister,pConstantData,Vector4iCount);
}

HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9 *pViewport) 
{
	return m_pD3Ddev->SetViewport(pViewport);
}

BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow) 
{
	return m_pD3Ddev->ShowCursor(bShow);
}

HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) 
{
	return m_pD3Ddev->StretchRect(pSourceSurface,pSourceRect,pDestSurface,pDestRect,Filter);
}

HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel() 
{
	return m_pD3Ddev->TestCooperativeLevel();
}

HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) 
{
	return m_pD3Ddev->UpdateSurface(pSourceSurface,pSourceRect,pDestinationSurface,pDestPoint);
}

HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9 *pSourceTexture, IDirect3DBaseTexture9 *pDestinationTexture) 
{
	return m_pD3Ddev->UpdateTexture(pSourceTexture, pDestinationTexture);
}

HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD *pNumPasses) 
{
	return m_pD3Ddev->ValidateDevice(pNumPasses);
}
where am I failing here? I dont get it!
EVEN with all the DIP code removed and replaced with the most simple zbuffer disable code, it still doesnt work... and I even tried matching the source code of strife's model logger (the DIP area) and nothing... this is starting to bug me BECAUSE THE MODEL LOGGER WORKS!

PROOF:


Update: Im downloading an older version of the DirectX SDK in hopes that thats the problem (was using feb '10 but now downloading the suggested summer 2004 version)

Update: old code still didnt work... however I managed to compile the source code for the model logger, and add the Occlusion exploit but now for some reason my game has no sound... so Im thinking thats the game bugged and not the fault of the hacks.
#6 · edited 15y ago · 15y ago
GameArena
GameArena
Quote Originally Posted by Birdshit View Post
so nobody is gonna even try to compete with artyfagyl aiming?
Yeah fuck those fags i havent seen any hacks other than theres. but yoou can use Cheat Engine .. speedhack, unlimited ammo ect
#7 · 15y ago
Birdshit
Birdshit
so I managed to recompile the D3D9 model logger source code with the ue3 engine occlusion exploit just before I gtg get ready for work... when I get home I'll work on changing the players to a solid pixel shader

from what Ive been able to deduce so far is that its the VTable hooking that enables this source code to work and my older code to not work... naked hooking the pure "HRESULT etc etc" is apparently pre-patched.

Code:
// added to defines
#define CQ  3

// added to typedef area

typedef HRESULT (WINAPI* tCreateQuery)(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
tCreateQuery oCreateQuery;

// ADDED THIS BEFORE ENDSCENE

HRESULT WINAPI hkCreateQuery(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
{
if( Type == D3DQUERYTYPE_OCCLUSION )
{
Type = D3DQUERYTYPE_EVENT;
}

return oCreateQuery( pDevice, Type, ppQuery );
}


LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);} 
void DX_Init(DWORD* table)
{
	WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
	RegisterClassEx(&wc);
	HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
	LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
	D3DPRESENT_PARAMETERS d3dpp; 
	ZeroMemory( &d3dpp, sizeof(d3dpp) );
	d3dpp.Windowed = TRUE;
	d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
	LPDIRECT3DDEVICE9 pd3dDevice;
	pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
	DWORD* pVTable = (DWORD*)pd3dDevice;
	pVTable = (DWORD*)pVTable[0];

	table[CQ]   = pVTable[118]; // HAD TO ADD VTable code for CreateQuery (118)
	table[ES]	= pVTable[42];
	table[DIP]	= pVTable[82];
	table[SSS]	= pVTable[100];

	DestroyWindow(hWnd);
}

DWORD WINAPI MyThread(LPVOID)
{
	DWORD VTable[4] = {0}; // changed to 4 from 3, because 4 DWORDS need to be made now 

	while(GetModuleHandle("d3d9.dll")==NULL){
		Sleep(250);
	}

	DX_Init(VTable);

	HOOK(EndScene,VTable[ES]);
	HOOK(DrawIndexedPrimitive,VTable[DIP]);
	HOOK(SetStreamSource,VTable[SSS]);
	HOOK(CreateQuery,VTable[CQ]);  //  ADDED THIS TO STRIFES ORIGINAL SOURCE CODE

	return 0;
}
PROGRESS!!!!!!:



Update:
bah I got sidetracked on youtube, damned youtube clicking spree! you just ate 3 hours of my time when I could have been working on these hacks! not gonna happen tommorow, I will dedicate to this when I get up...

Update: wth guys lol did you just leech my copy and pastes and now you dont need me anymore? lol!

Last Update (for now) Im having a hell of a time trying to get pixel shaders to be applied to the models with so many different C++ runtime errors I dont even know where to begin... so here is the full source code for strifes model logger + UE3 Engine Occlusion exploit:

Code:
/****************************\
D3D9 Model Recognition Logger 
		By: Strife
   Credits: DrUnKeN ChEeTaH
\****************************/

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

#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>
#include <fstream>
#include <detours.h>

using namespace std;

#define HOOK(func,addy)	o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)hk##func)

#define STRIDE		0
#define NUMVERTS	1
#define PRIMCOUNT	2
#define STARTINDEX	3
#define LOGVALUES	4

#define ES	0
#define DIP	1
#define SSS	2
#define CQ  3


void Log(char* fmt, ...);
void ModelRecLoggerMenu();

struct ModelRecLogger_t
{
	char* type;
	int   value;
	bool  isLogging;
};

ModelRecLogger_t model[5] = {
	{"Stride:",		0, false},
	{"NumVert:",	0, false},
	{"PrimCount:",	0, false},
	{"StartIndex:",	0, false},
	{"LOG ALL VALUES",	0, false}
};

unsigned int	g_uiTimer	= NULL;
unsigned int	g_uiStride	= NULL;

LPD3DXFONT		g_pFont	= NULL;
LPD3DXLINE		g_pLine = NULL;
D3DVIEWPORT9	g_ViewPort;

LPDIRECT3DTEXTURE9 g_pTexRed	= NULL;
LPDIRECT3DTEXTURE9 g_pTexOrange = NULL;

const BYTE red[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
};

const BYTE orange[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xFF, 0x00
};

//---------------------------------------------------------------------------------------------------------------------------------
typedef HRESULT (WINAPI* tSetStreamSource)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
tSetStreamSource oSetStreamSource;

typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
tEndScene oEndScene;

typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
tDrawIndexedPrimitive oDrawIndexedPrimitive;

typedef HRESULT (WINAPI* tCreateQuery)(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
tCreateQuery oCreateQuery;


//---DrawString--------------------------------------------------------------------------------------------------------------------



void DrawString(int x, int y, DWORD color, const char *fmt, ...)
{
	RECT FontPos = { x, y, x + 120, y + 16 };
	char buf[1024] = {'\0'};
	va_list va_alist;

	va_start(va_alist, fmt);
	vsprintf(buf, fmt, va_alist);
	va_end(va_alist);
	
	g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}

//---DrawRectangle-----------------------------------------------------------------------------------------------------------------

void DrawRectangle(float x, float y, float w, int h)
{

	D3DXVECTOR2 vLine1[2];
	D3DXVECTOR2 vLine2[2];
	D3DXVECTOR2 vLine3[2];
	D3DXVECTOR2 vLine4[2];

	vLine1[0].x = x; 
	vLine1[0].y = y; 
	vLine1[1].x = x; 
	vLine1[1].y = y+h;

	vLine2[0].x = x+w; 
	vLine2[0].y = y; 
	vLine2[1].x = x+w; 
	vLine2[1].y = y+h;

	vLine3[0].x = x; 
	vLine3[0].y = y; 
	vLine3[1].x = x+w; 
	vLine3[1].y = y;

	vLine4[0].x = x; 
	vLine4[0].y = y+h; 
	vLine4[1].x = x+w; 
	vLine4[1].y = y+h;

	g_pLine->SetWidth(2);
	g_pLine->SetAntialias(false);
	g_pLine->SetGLLines(false);
	g_pLine->Begin();
	g_pLine->Draw(vLine1, 2, 0xFF0000FF);
	g_pLine->Draw(vLine2, 2, 0xFF0000FF);
	g_pLine->Draw(vLine3, 2, 0xFF0000FF);
	g_pLine->Draw(vLine4, 2, 0xFF0000FF);
	g_pLine->End();

}

//---Hooked DirectX Functions-------------------------------------------------------------------------------------------------------

HRESULT WINAPI hkCreateQuery(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
{
if( Type == D3DQUERYTYPE_OCCLUSION )
{
Type = D3DQUERYTYPE_EVENT;
}

return oCreateQuery( pDevice, Type, ppQuery );
}

HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
	if(g_pTexRed == NULL)		D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&red, sizeof(red), &g_pTexRed);
	if(g_pTexOrange == NULL)	D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&orange, sizeof(orange), &g_pTexOrange);
	
	if(g_pFont == NULL) D3DXCreateFont(pDevice, 15, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana", &g_pFont);
	if(g_pLine == NULL) D3DXCreateLine(pDevice, &g_pLine);

	pDevice->GetViewport(&g_ViewPort);

	if(g_pFont != NULL && g_pLine != NULL){
		ModelRecLoggerMenu();
		if(g_uiTimer > GetTickCount()){ 
			DrawString(g_ViewPort.Width/2,g_ViewPort.Height/2, 0xFF00FF00, "Values Saved");
		}	
	}
	return oEndScene(pDevice);
}

HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
	__asm nop

	HRESULT hRet = oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	bool bIsLogging = false;

	for(int i = 0; i < 4; i++){
		if(model[i].isLogging == true){
			bIsLogging = true;
			break;
		}
	}

	if(bIsLogging){
		if((model[STRIDE].isLogging == true ? model[STRIDE].value			: g_uiStride)	== g_uiStride &&
		   (model[NUMVERTS].isLogging == true ? model[NUMVERTS].value		: NumVertices)	== NumVertices &&
		   (model[PRIMCOUNT].isLogging == true ? model[PRIMCOUNT].value		: primCount)	== primCount &&
		   (model[STARTINDEX].isLogging == true ? model[STARTINDEX].value	: startIndex)	== startIndex)
		{
			pDevice->SetRenderState( D3DRS_ZENABLE,false );
			pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
			pDevice->SetTexture( 0, g_pTexOrange );
			oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
			pDevice->SetRenderState( D3DRS_ZENABLE, true );
			pDevice->SetRenderState( D3DRS_FILLMODE,D3DFILL_SOLID );
			pDevice->SetTexture( 0, g_pTexRed );
		}
	}

	return hRet;
}

HRESULT WINAPI hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{
	__asm nop

	if(StreamNumber == 0){
		g_uiStride = Stride;
	}

	return oSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);
}

//-----------------------------------------------------------------------------------------------------------------------------------

void Log(char* fmt, ...)
{
	char buf[1024] = {0};
	va_list va_alist;
	ofstream output;

	va_start(va_alist, fmt);
	vsnprintf(buf, sizeof(buf), fmt, va_alist);
	va_end(va_alist);

	output.open("D3D9 Model Logger.txt", ios::app);
	if(output.fail()) return;
	output << buf << endl;
	output.close();
}

//--Credits to DrUnKeN ChEeTaH--------------------------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);} 
void DX_Init(DWORD* table)
{
	WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
	RegisterClassEx(&wc);
	HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
	LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
	D3DPRESENT_PARAMETERS d3dpp; 
	ZeroMemory( &d3dpp, sizeof(d3dpp) );
	d3dpp.Windowed = TRUE;
	d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
	LPDIRECT3DDEVICE9 pd3dDevice;
	pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
	DWORD* pVTable = (DWORD*)pd3dDevice;
	pVTable = (DWORD*)pVTable[0];

	table[CQ]   = pVTable[118];
	table[ES]	= pVTable[42];
	table[DIP]	= pVTable[82];
	table[SSS]	= pVTable[100];

	DestroyWindow(hWnd);
}
//------------------------------------------------------------------------------------------------------------------------------------

void ModelRecLoggerMenu()
{
	static int menuIndex = 0;
	static int incrementBy = 1;

	DrawString(10, 10, 0xFFFFFFFF, "In/Decrement By: %i", incrementBy);
		
	for(int i = 0; i < 5; i++){
		if(i == menuIndex){
			DrawRectangle(8, 23+(i*15), 140, 18);
		}
		DrawString(10, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%s", model[i].type);
		if(i != LOGVALUES){
			DrawString(100, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%i", model[i].value);
		}
	}
	
	if(GetAsyncKeyState(VK_UP)&1)	 menuIndex--;
	if(GetAsyncKeyState(VK_DOWN)&1)	 menuIndex++;
	if(GetAsyncKeyState(VK_LEFT)&1)	 model[menuIndex].value-=incrementBy;
	if(GetAsyncKeyState(VK_RIGHT)&1) model[menuIndex].value+=incrementBy;

	if(GetAsyncKeyState(VK_DELETE)&1)model[menuIndex].isLogging = !model[menuIndex].isLogging;

	if(GetAsyncKeyState(VK_INSERT)&1)model[menuIndex].value = 0;
	if(GetAsyncKeyState(VK_NEXT)&1){
		incrementBy *= 10;
		if(incrementBy > 1000){
			incrementBy = 1;
		}
	}

	if(GetAsyncKeyState(VK_END)&1){
		for(int i = 0; i < 4; i++){
			model[i].isLogging = false;
		}
	}

	if(model[LOGVALUES].isLogging == true){
		model[LOGVALUES].isLogging = false;
		g_uiTimer = GetTickCount() + 2000;

		Log("Stride: %i | NumVerts: %i | PrimCount: %i | StartIndex: %i",
			model[STRIDE].isLogging		== true ? model[STRIDE].value		: -1,
			model[NUMVERTS].isLogging	== true ? model[NUMVERTS].value		: -1,
			model[PRIMCOUNT].isLogging	== true ? model[PRIMCOUNT].value	: -1,
			model[STARTINDEX].isLogging	== true ? model[STARTINDEX].value	: -1);
	}

	if(menuIndex > 4) menuIndex = 0;
	if(menuIndex < 0) menuIndex = 4;

	if(model[menuIndex].value < 0) model[menuIndex].value = 0;
}

//------------------------------------------------------------------------------------------------------------------------------------

DWORD WINAPI MyThread(LPVOID)
{
	DWORD VTable[5] = {0};

	while(GetModuleHandle("d3d9.dll")==NULL){
		Sleep(250);
	}

	DX_Init(VTable);

	HOOK(EndScene,VTable[ES]);
	HOOK(DrawIndexedPrimitive,VTable[DIP]);
	HOOK(SetStreamSource,VTable[SSS]);
	HOOK(CreateQuery,VTable[CQ]);

	return 0;
}

BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH){
		CreateThread(0,0,MyThread,0,0,0);
	}

	return TRUE;
}

can anyone help me figure out how to generate the shaders with this form of VTable hooking?

I always get an error like VTable stack error when I try to add SetPixelShader(107) and CreatePixelShader(106) to the list of hooks and add them to the typedef area even tho it compiles... I know it has something to do with the incompatiblity of the generateshader function:

HRESULT GenerateShader( IDirect3DDevice9 *pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b, bool setzBuf )
{
char szShader[ 256 ];
ID3DXBuffer *pShaderBuf = NULL;

sprintf( szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
if( D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL ) == D3D_OK )
pDevice->CreatePixelShader( ( const DWORD* )pShaderBuf->GetBufferPointer(), pShader );
else
return E_FAIL;

return S_OK;
}
#8 · edited 15y ago · 15y ago
Birdshit
Birdshit
I might as well doublepost... got my first kick by admins today... I was like 15 and 0, still cant figure out how to make pixel shaded chams work but I did manage to do well with diablo + thermal goggles, takes the place of the chams that arent working

UPDATE!

I made *SOME* progress on the pixelshader chams side... Ive now achieved GETTING pixelshaders on them, but the stability is the issue now, as the shaders turn rainbow colored shortly (about 30 seconds) before the entire game crashes... I think the reason it does this is because I had to resort to using Pixel Shader 1.1 (using 2.0 or higher makes it crash immediately) can anyone help with this?

the full source (which can be dragged and dropped into an empty dll project btw, as long as you have detours 1.5 and directx sdk's):

Code:
/****************************\
D3D9 Model Recognition Logger 
		By: Strife
   Credits: DrUnKeN ChEeTaH
\****************************/

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

#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>
#include <fstream>
#include <detours.h>

using namespace std;

#define HOOK(func,addy)	o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)hk##func)

#define STRIDE		0
#define NUMVERTS	1
#define PRIMCOUNT	2
#define STARTINDEX	3
#define LOGVALUES	4

#define ES	0
#define DIP	1
#define SSS	2
#define CQ  3
//#define CPS  4

IDirect3DPixelShader9 *sRED, *sYELLOW;


void Log(char* fmt, ...);
void ModelRecLoggerMenu();

struct ModelRecLogger_t
{
	char* type;
	int   value;
	bool  isLogging;
};

ModelRecLogger_t model[5] = {
	{"Stride:",		0, false},
	{"NumVert:",	0, false},
	{"PrimCount:",	0, false},
	{"StartIndex:",	0, false},
	{"LOG ALL VALUES",	0, false}
};

unsigned int	g_uiTimer	= NULL;
unsigned int	g_uiStride	= NULL;

LPD3DXFONT		g_pFont	= NULL;
LPD3DXLINE		g_pLine = NULL;
D3DVIEWPORT9	g_ViewPort;

D3DCOLOR cRED = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR cORANGE = D3DCOLOR_ARGB(255, 255, 132, 0);


LPDIRECT3DTEXTURE9 g_pTexRed	= NULL;
LPDIRECT3DTEXTURE9 g_pTexOrange = NULL;

const BYTE red[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
};

const BYTE orange[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xFF, 0x00
};

//---------------------------------------------------------------------------------------------------------------------------------
typedef HRESULT (WINAPI* tSetStreamSource)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
tSetStreamSource oSetStreamSource;

typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
tEndScene oEndScene;

typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
tDrawIndexedPrimitive oDrawIndexedPrimitive;

typedef HRESULT (WINAPI* tCreateQuery)(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
tCreateQuery oCreateQuery;

							
//typedef HRESULT (WINAPI* tCreatePixelShader)(LPDIRECT3DDEVICE9 pDevice,CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader);
//tCreatePixelShader oCreatePixelShader;


//---DrawString--------------------------------------------------------------------------------------------------------------------



void DrawString(int x, int y, DWORD color, const char *fmt, ...)
{
	RECT FontPos = { x, y, x + 120, y + 16 };
	char buf[1024] = {'\0'};
	va_list va_alist;

	va_start(va_alist, fmt);
	vsprintf(buf, fmt, va_alist);
	va_end(va_alist);
	
	g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}

//---DrawRectangle-----------------------------------------------------------------------------------------------------------------

void DrawRectangle(float x, float y, float w, int h)
{

	D3DXVECTOR2 vLine1[2];
	D3DXVECTOR2 vLine2[2];
	D3DXVECTOR2 vLine3[2];
	D3DXVECTOR2 vLine4[2];

	vLine1[0].x = x; 
	vLine1[0].y = y; 
	vLine1[1].x = x; 
	vLine1[1].y = y+h;

	vLine2[0].x = x+w; 
	vLine2[0].y = y; 
	vLine2[1].x = x+w; 
	vLine2[1].y = y+h;

	vLine3[0].x = x; 
	vLine3[0].y = y; 
	vLine3[1].x = x+w; 
	vLine3[1].y = y;

	vLine4[0].x = x; 
	vLine4[0].y = y+h; 
	vLine4[1].x = x+w; 
	vLine4[1].y = y+h;

	g_pLine->SetWidth(2);
	g_pLine->SetAntialias(false);
	g_pLine->SetGLLines(false);
	g_pLine->Begin();
	g_pLine->Draw(vLine1, 2, 0xFF0000FF);
	g_pLine->Draw(vLine2, 2, 0xFF0000FF);
	g_pLine->Draw(vLine3, 2, 0xFF0000FF);
	g_pLine->Draw(vLine4, 2, 0xFF0000FF);
	g_pLine->End();

}

//---Hooked DirectX Functions-------------------------------------------------------------------------------------------------------

HRESULT GenerateShader(LPDIRECT3DDEVICE9 pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b )
{
    char szShader[ 64 ];
    ID3DXBuffer *pShaderBuf = NULL;	
	sprintf_s (szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
    D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL );
    if( FAILED( pDevice->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)) )return E_FAIL;


    return S_OK;
}


HRESULT WINAPI hkCreateQuery(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
{
if( Type == D3DQUERYTYPE_OCCLUSION )
{
Type = D3DQUERYTYPE_EVENT;
}

return oCreateQuery( pDevice, Type, ppQuery );
}

HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
	if(g_pTexRed == NULL)		D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&red, sizeof(red), &g_pTexRed);
	if(g_pTexOrange == NULL)	D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&orange, sizeof(orange), &g_pTexOrange);
	
	if(g_pFont == NULL) D3DXCreateFont(pDevice, 15, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana", &g_pFont);
	if(g_pLine == NULL) D3DXCreateLine(pDevice, &g_pLine);

	pDevice->GetViewport(&g_ViewPort);

	if(g_pFont != NULL && g_pLine != NULL){
		ModelRecLoggerMenu();
		if(g_uiTimer > GetTickCount()){ 
			DrawString(g_ViewPort.Width/2,g_ViewPort.Height/2, 0xFF00FF00, "Values Saved");
		}	
	}
	GenerateShader(pDevice, &sRED, 1.0f, 0.0f, 0.0f);
	GenerateShader(pDevice, &sYELLOW, 1.0f, 1.0f, 0.0f);
	return oEndScene(pDevice);
}

HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
	__asm nop

	HRESULT hRet = oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	bool bIsLogging = false;

	for(int i = 0; i < 4; i++){
		if(model[i].isLogging == true){
			bIsLogging = true;
			break;
		}
	}

	if(bIsLogging){
		if((model[STRIDE].isLogging == true ? model[STRIDE].value			: g_uiStride)	== g_uiStride &&
		   (model[NUMVERTS].isLogging == true ? model[NUMVERTS].value		: NumVertices)	== NumVertices &&
		   (model[PRIMCOUNT].isLogging == true ? model[PRIMCOUNT].value		: primCount)	== primCount &&
		   (model[STARTINDEX].isLogging == true ? model[STARTINDEX].value	: startIndex)	== startIndex)
		{
			pDevice->SetRenderState( D3DRS_ZENABLE,false );
			pDevice->SetPixelShader( sRED );
			oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
			pDevice->SetRenderState( D3DRS_ZENABLE, true );
			pDevice->SetPixelShader( sYELLOW );
		}
	}

	return hRet;
}

HRESULT WINAPI hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{
	__asm nop

	if(StreamNumber == 0){
		g_uiStride = Stride;
	}

	return oSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);
}

//-----------------------------------------------------------------------------------------------------------------------------------

void Log(char* fmt, ...)
{
	char buf[1024] = {0};
	va_list va_alist;
	ofstream output;

	va_start(va_alist, fmt);
	vsnprintf(buf, sizeof(buf), fmt, va_alist);
	va_end(va_alist);

	output.open("D3D9 Model Logger.txt", ios::app);
	if(output.fail()) return;
	output << buf << endl;
	output.close();
}

//--Credits to DrUnKeN ChEeTaH--------------------------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);} 
void DX_Init(DWORD* table)
{
	WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
	RegisterClassEx(&wc);
	HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
	LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
	D3DPRESENT_PARAMETERS d3dpp; 
	ZeroMemory( &d3dpp, sizeof(d3dpp) );
	d3dpp.Windowed = TRUE;
	d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
	LPDIRECT3DDEVICE9 pd3dDevice;
	pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
	DWORD* pVTable = (DWORD*)pd3dDevice;
	pVTable = (DWORD*)pVTable[0];

	table[CQ]   = pVTable[118];
	table[ES]	= pVTable[42];
	table[DIP]	= pVTable[82];
	table[SSS]	= pVTable[100];
    //table[CPS]	= pVTable[106];

	DestroyWindow(hWnd);
}
//------------------------------------------------------------------------------------------------------------------------------------

void ModelRecLoggerMenu()
{
	static int menuIndex = 0;
	static int incrementBy = 1;

	DrawString(10, 10, 0xFFFFFFFF, "In/Decrement By: %i", incrementBy);
		
	for(int i = 0; i < 5; i++){
		if(i == menuIndex){
			DrawRectangle(8, 23+(i*15), 140, 18);
		}
		DrawString(10, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%s", model[i].type);
		if(i != LOGVALUES){
			DrawString(100, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%i", model[i].value);
		}
	}
	
	if(GetAsyncKeyState(VK_UP)&1)	 menuIndex--;
	if(GetAsyncKeyState(VK_DOWN)&1)	 menuIndex++;
	if(GetAsyncKeyState(VK_LEFT)&1)	 model[menuIndex].value-=incrementBy;
	if(GetAsyncKeyState(VK_RIGHT)&1) model[menuIndex].value+=incrementBy;

	if(GetAsyncKeyState(VK_DELETE)&1)model[menuIndex].isLogging = !model[menuIndex].isLogging;

	if(GetAsyncKeyState(VK_INSERT)&1)model[menuIndex].value = 0;
	if(GetAsyncKeyState(VK_NEXT)&1){
		incrementBy *= 10;
		if(incrementBy > 1000){
			incrementBy = 1;
		}
	}

	if(GetAsyncKeyState(VK_END)&1){
		for(int i = 0; i < 4; i++){
			model[i].isLogging = false;
		}
	}

	if(model[LOGVALUES].isLogging == true){
		model[LOGVALUES].isLogging = false;
		g_uiTimer = GetTickCount() + 2000;

		Log("Stride: %i | NumVerts: %i | PrimCount: %i | StartIndex: %i",
			model[STRIDE].isLogging		== true ? model[STRIDE].value		: -1,
			model[NUMVERTS].isLogging	== true ? model[NUMVERTS].value		: -1,
			model[PRIMCOUNT].isLogging	== true ? model[PRIMCOUNT].value	: -1,
			model[STARTINDEX].isLogging	== true ? model[STARTINDEX].value	: -1);
	}

	if(menuIndex > 4) menuIndex = 0;
	if(menuIndex < 0) menuIndex = 4;

	if(model[menuIndex].value < 0) model[menuIndex].value = 0;
}

//------------------------------------------------------------------------------------------------------------------------------------

DWORD WINAPI MyThread(LPVOID)
{
	DWORD VTable[5] = {0};

	while(GetModuleHandle("d3d9.dll")==NULL){
		Sleep(250);
	}

	DX_Init(VTable);

	HOOK(EndScene,VTable[ES]);
	HOOK(DrawIndexedPrimitive,VTable[DIP]);
	HOOK(SetStreamSource,VTable[SSS]);
	HOOK(CreateQuery,VTable[CQ]);
	//HOOK(CreatePixelShader,VTable[CPS]);

	return 0;
}

BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH){
		CreateThread(0,0,MyThread,0,0,0);
	}

	return TRUE;
}

PROOF (taken while I feverishly did as much model rec on the NK models as I could):


FIXED VISIBLE ALTERNATE COLOR:




I maybe will just release this as a generic stride logger that uses pixel shaders to emphasize the effect... if the damned thing would stay stable... off to more testing...
#9 · edited 15y ago · 15y ago
MS
msr890
Quote Originally Posted by Birdshit View Post
I might as well doublepost... got my first kick by admins today... I was like 15 and 0, still cant figure out how to make pixel shaded chams work but I did manage to do well with diablo + thermal goggles, takes the place of the chams that arent working

UPDATE!

I made *SOME* progress on the pixelshader chams side... Ive now achieved GETTING pixelshaders on them, but the stability is the issue now, as the shaders turn rainbow colored shortly (about 30 seconds) before the entire game crashes... I think the reason it does this is because I had to resort to using Pixel Shader 1.1 (using 2.0 or higher makes it crash immediately) can anyone help with this?

the full source (which can be dragged and dropped into an empty dll project btw, as long as you have detours 1.5 and directx sdk's):

Code:
/****************************\
D3D9 Model Recognition Logger 
		By: Strife
   Credits: DrUnKeN ChEeTaH
\****************************/

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

#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <iostream>
#include <fstream>
#include <detours.h>

using namespace std;

#define HOOK(func,addy)	o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)hk##func)

#define STRIDE		0
#define NUMVERTS	1
#define PRIMCOUNT	2
#define STARTINDEX	3
#define LOGVALUES	4

#define ES	0
#define DIP	1
#define SSS	2
#define CQ  3
//#define CPS  4

IDirect3DPixelShader9 *sRED, *sYELLOW;


void Log(char* fmt, ...);
void ModelRecLoggerMenu();

struct ModelRecLogger_t
{
	char* type;
	int   value;
	bool  isLogging;
};

ModelRecLogger_t model[5] = {
	{"Stride:",		0, false},
	{"NumVert:",	0, false},
	{"PrimCount:",	0, false},
	{"StartIndex:",	0, false},
	{"LOG ALL VALUES",	0, false}
};

unsigned int	g_uiTimer	= NULL;
unsigned int	g_uiStride	= NULL;

LPD3DXFONT		g_pFont	= NULL;
LPD3DXLINE		g_pLine = NULL;
D3DVIEWPORT9	g_ViewPort;

D3DCOLOR cRED = D3DCOLOR_ARGB(255, 255, 0, 0);
D3DCOLOR cORANGE = D3DCOLOR_ARGB(255, 255, 132, 0);


LPDIRECT3DTEXTURE9 g_pTexRed	= NULL;
LPDIRECT3DTEXTURE9 g_pTexOrange = NULL;

const BYTE red[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00
};

const BYTE orange[ 58 ] = {
	0x42, 0x4D, 0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 
	0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xFF, 0x00
};

//---------------------------------------------------------------------------------------------------------------------------------
typedef HRESULT (WINAPI* tSetStreamSource)(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride);
tSetStreamSource oSetStreamSource;

typedef HRESULT (WINAPI* tEndScene)(LPDIRECT3DDEVICE9 pDevice);
tEndScene oEndScene;

typedef HRESULT (WINAPI* tDrawIndexedPrimitive)(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount);
tDrawIndexedPrimitive oDrawIndexedPrimitive;

typedef HRESULT (WINAPI* tCreateQuery)(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery);
tCreateQuery oCreateQuery;

							
//typedef HRESULT (WINAPI* tCreatePixelShader)(LPDIRECT3DDEVICE9 pDevice,CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader);
//tCreatePixelShader oCreatePixelShader;


//---DrawString--------------------------------------------------------------------------------------------------------------------



void DrawString(int x, int y, DWORD color, const char *fmt, ...)
{
	RECT FontPos = { x, y, x + 120, y + 16 };
	char buf[1024] = {'\0'};
	va_list va_alist;

	va_start(va_alist, fmt);
	vsprintf(buf, fmt, va_alist);
	va_end(va_alist);
	
	g_pFont->DrawText(NULL, buf, -1, &FontPos, DT_NOCLIP, color);
}

//---DrawRectangle-----------------------------------------------------------------------------------------------------------------

void DrawRectangle(float x, float y, float w, int h)
{

	D3DXVECTOR2 vLine1[2];
	D3DXVECTOR2 vLine2[2];
	D3DXVECTOR2 vLine3[2];
	D3DXVECTOR2 vLine4[2];

	vLine1[0].x = x; 
	vLine1[0].y = y; 
	vLine1[1].x = x; 
	vLine1[1].y = y+h;

	vLine2[0].x = x+w; 
	vLine2[0].y = y; 
	vLine2[1].x = x+w; 
	vLine2[1].y = y+h;

	vLine3[0].x = x; 
	vLine3[0].y = y; 
	vLine3[1].x = x+w; 
	vLine3[1].y = y;

	vLine4[0].x = x; 
	vLine4[0].y = y+h; 
	vLine4[1].x = x+w; 
	vLine4[1].y = y+h;

	g_pLine->SetWidth(2);
	g_pLine->SetAntialias(false);
	g_pLine->SetGLLines(false);
	g_pLine->Begin();
	g_pLine->Draw(vLine1, 2, 0xFF0000FF);
	g_pLine->Draw(vLine2, 2, 0xFF0000FF);
	g_pLine->Draw(vLine3, 2, 0xFF0000FF);
	g_pLine->Draw(vLine4, 2, 0xFF0000FF);
	g_pLine->End();

}

//---Hooked DirectX Functions-------------------------------------------------------------------------------------------------------

HRESULT GenerateShader(LPDIRECT3DDEVICE9 pDevice, IDirect3DPixelShader9 **pShader, float r, float g, float b )
{
    char szShader[ 64 ];
    ID3DXBuffer *pShaderBuf = NULL;	
	sprintf_s (szShader, "ps.1.1\ndef c0, %f, %f, %f, %f\nmov r0,c0", r, g, b, 1.0f );
    D3DXAssembleShader( szShader, sizeof( szShader ), NULL, NULL, 0, &pShaderBuf, NULL );
    if( FAILED( pDevice->CreatePixelShader((const DWORD*)pShaderBuf->GetBufferPointer(), pShader)) )return E_FAIL;


    return S_OK;
}


HRESULT WINAPI hkCreateQuery(LPDIRECT3DDEVICE9 pDevice, D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery)
{
if( Type == D3DQUERYTYPE_OCCLUSION )
{
Type = D3DQUERYTYPE_EVENT;
}

return oCreateQuery( pDevice, Type, ppQuery );
}

HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
	if(g_pTexRed == NULL)		D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&red, sizeof(red), &g_pTexRed);
	if(g_pTexOrange == NULL)	D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&orange, sizeof(orange), &g_pTexOrange);
	
	if(g_pFont == NULL) D3DXCreateFont(pDevice, 15, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Verdana", &g_pFont);
	if(g_pLine == NULL) D3DXCreateLine(pDevice, &g_pLine);

	pDevice->GetViewport(&g_ViewPort);

	if(g_pFont != NULL && g_pLine != NULL){
		ModelRecLoggerMenu();
		if(g_uiTimer > GetTickCount()){ 
			DrawString(g_ViewPort.Width/2,g_ViewPort.Height/2, 0xFF00FF00, "Values Saved");
		}	
	}
	GenerateShader(pDevice, &sRED, 1.0f, 0.0f, 0.0f);
	GenerateShader(pDevice, &sYELLOW, 1.0f, 1.0f, 0.0f);
	return oEndScene(pDevice);
}

HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE PrimType,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount)
{
	__asm nop

	HRESULT hRet = oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	bool bIsLogging = false;

	for(int i = 0; i < 4; i++){
		if(model[i].isLogging == true){
			bIsLogging = true;
			break;
		}
	}

	if(bIsLogging){
		if((model[STRIDE].isLogging == true ? model[STRIDE].value			: g_uiStride)	== g_uiStride &&
		   (model[NUMVERTS].isLogging == true ? model[NUMVERTS].value		: NumVertices)	== NumVertices &&
		   (model[PRIMCOUNT].isLogging == true ? model[PRIMCOUNT].value		: primCount)	== primCount &&
		   (model[STARTINDEX].isLogging == true ? model[STARTINDEX].value	: startIndex)	== startIndex)
		{
			pDevice->SetRenderState( D3DRS_ZENABLE,false );
			pDevice->SetPixelShader( sRED );
			oDrawIndexedPrimitive(pDevice, PrimType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
			pDevice->SetRenderState( D3DRS_ZENABLE, true );
			pDevice->SetPixelShader( sYELLOW );
		}
	}

	return hRet;
}

HRESULT WINAPI hkSetStreamSource(LPDIRECT3DDEVICE9 pDevice,UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride)
{
	__asm nop

	if(StreamNumber == 0){
		g_uiStride = Stride;
	}

	return oSetStreamSource(pDevice, StreamNumber, pStreamData, OffsetInBytes, Stride);
}

//-----------------------------------------------------------------------------------------------------------------------------------

void Log(char* fmt, ...)
{
	char buf[1024] = {0};
	va_list va_alist;
	ofstream output;

	va_start(va_alist, fmt);
	vsnprintf(buf, sizeof(buf), fmt, va_alist);
	va_end(va_alist);

	output.open("D3D9 Model Logger.txt", ios::app);
	if(output.fail()) return;
	output << buf << endl;
	output.close();
}

//--Credits to DrUnKeN ChEeTaH--------------------------------------------------------------------------------------------------------
LRESULT CALLBACK MsgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam){return DefWindowProc(hwnd, uMsg, wParam, lParam);} 
void DX_Init(DWORD* table)
{
	WNDCLASSEX wc = {sizeof(WNDCLASSEX),CS_CLASSDC,MsgProc,0L,0L,GetModuleHandle(NULL),NULL,NULL,NULL,NULL,"DX",NULL};
	RegisterClassEx(&wc);
	HWND hWnd = CreateWindow("DX",NULL,WS_OVERLAPPEDWINDOW,100,100,300,300,GetDesktopWindow(),NULL,wc.hInstance,NULL);
	LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );
	D3DPRESENT_PARAMETERS d3dpp; 
	ZeroMemory( &d3dpp, sizeof(d3dpp) );
	d3dpp.Windowed = TRUE;
	d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
	d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
	LPDIRECT3DDEVICE9 pd3dDevice;
	pD3D->CreateDevice(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&d3dpp,&pd3dDevice);
	DWORD* pVTable = (DWORD*)pd3dDevice;
	pVTable = (DWORD*)pVTable[0];

	table[CQ]   = pVTable[118];
	table[ES]	= pVTable[42];
	table[DIP]	= pVTable[82];
	table[SSS]	= pVTable[100];
    //table[CPS]	= pVTable[106];

	DestroyWindow(hWnd);
}
//------------------------------------------------------------------------------------------------------------------------------------

void ModelRecLoggerMenu()
{
	static int menuIndex = 0;
	static int incrementBy = 1;

	DrawString(10, 10, 0xFFFFFFFF, "In/Decrement By: %i", incrementBy);
		
	for(int i = 0; i < 5; i++){
		if(i == menuIndex){
			DrawRectangle(8, 23+(i*15), 140, 18);
		}
		DrawString(10, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%s", model[i].type);
		if(i != LOGVALUES){
			DrawString(100, 25+(i*15), model[i].isLogging==true?0xFF00FF00:0xFFFF0000, "%i", model[i].value);
		}
	}
	
	if(GetAsyncKeyState(VK_UP)&1)	 menuIndex--;
	if(GetAsyncKeyState(VK_DOWN)&1)	 menuIndex++;
	if(GetAsyncKeyState(VK_LEFT)&1)	 model[menuIndex].value-=incrementBy;
	if(GetAsyncKeyState(VK_RIGHT)&1) model[menuIndex].value+=incrementBy;

	if(GetAsyncKeyState(VK_DELETE)&1)model[menuIndex].isLogging = !model[menuIndex].isLogging;

	if(GetAsyncKeyState(VK_INSERT)&1)model[menuIndex].value = 0;
	if(GetAsyncKeyState(VK_NEXT)&1){
		incrementBy *= 10;
		if(incrementBy > 1000){
			incrementBy = 1;
		}
	}

	if(GetAsyncKeyState(VK_END)&1){
		for(int i = 0; i < 4; i++){
			model[i].isLogging = false;
		}
	}

	if(model[LOGVALUES].isLogging == true){
		model[LOGVALUES].isLogging = false;
		g_uiTimer = GetTickCount() + 2000;

		Log("Stride: %i | NumVerts: %i | PrimCount: %i | StartIndex: %i",
			model[STRIDE].isLogging		== true ? model[STRIDE].value		: -1,
			model[NUMVERTS].isLogging	== true ? model[NUMVERTS].value		: -1,
			model[PRIMCOUNT].isLogging	== true ? model[PRIMCOUNT].value	: -1,
			model[STARTINDEX].isLogging	== true ? model[STARTINDEX].value	: -1);
	}

	if(menuIndex > 4) menuIndex = 0;
	if(menuIndex < 0) menuIndex = 4;

	if(model[menuIndex].value < 0) model[menuIndex].value = 0;
}

//------------------------------------------------------------------------------------------------------------------------------------

DWORD WINAPI MyThread(LPVOID)
{
	DWORD VTable[5] = {0};

	while(GetModuleHandle("d3d9.dll")==NULL){
		Sleep(250);
	}

	DX_Init(VTable);

	HOOK(EndScene,VTable[ES]);
	HOOK(DrawIndexedPrimitive,VTable[DIP]);
	HOOK(SetStreamSource,VTable[SSS]);
	HOOK(CreateQuery,VTable[CQ]);
	//HOOK(CreatePixelShader,VTable[CPS]);

	return 0;
}

BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
{
	if(dwReason == DLL_PROCESS_ATTACH){
		CreateThread(0,0,MyThread,0,0,0);
	}

	return TRUE;
}

PROOF (taken while I feverishly did as much model rec on the NK models as I could):


FIXED VISIBLE ALTERNATE COLOR:




I maybe will just release this as a generic stride logger that uses pixel shaders to emphasize the effect... if the damned thing would stay stable... off to more testing...
just wanted to say thanks for working on a hack for this game.... its nice to see new coders to the community
#10 · 15y ago
Birdshit
Birdshit
I managed to get the code slightly better, runs a little smoother for a little longer but still goes rainbow after awhile... being able to use shader 3.0 required the feb2010 sdk...

been trying to log multiplayer numvertices and it seems to me why this game runs so smooth in singleplayer and so horribly in multiplayer is that the MULTIPLAYER MODELS DONT HAVE LOD'S!!!!! Ive been racing through the numvertices and the first one was 316 the last one I got was 2015 and that was like someones gun across the map I havnt even gotten into the bodies yet... so that is why this game runs so terribly on slower machines... the player models are the same detail across the map as they are up close, even though the occlusion provided by D3D does take load off the GPU the CPU still had to calculate that...

OK SO YA KNOW WHAT THIS GAME IS SO FUCKING BUGGY IT CANT HANDLE BEING HACKED WITHOUT CRASHING SO YA KNOW WHAT IM RELEASING THE SHIT SO YOU CAN EXPERIENCE HOW SHITTY THIS GAME IS CODED
#11 · edited 15y ago · 15y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Tags for this Thread

None