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 Semi-Popular First Person Shooter Hacks › Crysis 2 Hacks / Cheats › Crysis 2 Help › Need Help With Chams DLL Source Code

Need Help With Chams DLL Source Code

Posts 1–11 of 11 · Page 1 of 1
WO
woodpusher637
Need Help With Chams DLL Source Code
I have no reload/infinite ammo and nametags working fine I just need some help finishing the chams. I've attempted to learn Drawindexedprimitive to complete the source listed at the top of this thread but I can't figure it out.

Before you flame me, I do realize I'm an extreme novice to this type of stuff so please work with me. Thanks.

Heres a pic:

http://img714.imageshack.us/i/chamsissue2.png/

This is what I have so far:

Code:
// Hax.cpp : Defines the exported functions for the DLL application.
//

#include "stdafx.h"
#include <wchar.h>
#include <windows.h>
#include <d3d9.h>
#include <time.h>
#include <stdlib.h>
#include <fstream>
#include <vector>    
#include <stdio.h> 
#include <time.h>
#include <tchar.h>
#include <iostream>
#pragma warning(disable:4996)
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")

#define D3DHOOK_TEXTURES
#define ThreadMake(x) CreateThread(NULL,0, (LPTHREAD_START_ROUTINE)&x,NULL,0,NULL); 
#define ThreadMakeParam(x, param) CreateThread(NULL,0, (LPTHREAD_START_ROUTINE)&x,param,0,NULL);
#define CRYSIS2CHAMS ((m_Stride == 16 && NumVertices ==  8391 && primCount == 5677) || (m_Stride == 16 &&  NumVertices == 8391 && primCount == 5677) || (m_Stride == 12  && NumVertices == 8 && primCount == 10) || (m_Stride ==  12 && NumVertices == 30 && primCount == 14) || (m_Stride  == 16 && NumVertices == 2000 && primCount == 2549) ||  (m_Stride == 16 && NumVertices == 93 && primCount == 80)  || (m_Stride == 16 && NumVertices == 2406 && primCount  == 2365) || (m_Stride == 16 && NumVertices == 2259 &&  primCount == 1846) || (m_Stride == 16 && NumVertices == 190  && primCount == 172) || (m_Stride == 16 && NumVertices  == 621 && primCount == 712) || (m_Stride == 16 &&  NumVertices == 3107 && primCount == 3372) || (m_Stride == 16  && NumVertices == 1179 && primCount == 752) || (m_Stride  == 16 && NumVertices == 898 && primCount == 990) ||  (m_Stride == 16 && NumVertices == 3040 && primCount ==  2882) || (m_Stride == 16 && NumVertices == 5272 &&  primCount == 5595) || (m_Stride == 16 && NumVertices == 13248  && primCount == 13263) || (m_Stride == 16 && NumVertices  == 59 && primCount == 83) || (m_Stride == 16 &&  NumVertices == 120 && primCount == 28) || (m_Stride == 16  && NumVertices == 2124 && primCount == 657) || (m_Stride  == 16 && NumVertices == 466 && primCount == 185) ||  (m_Stride == 16 && NumVertices == 8572 && primCount ==  5694) || (m_Stride == 16 && NumVertices == 11127 &&  primCount == 9012) || (m_Stride == 16 && NumVertices == 2456  && primCount == 999) || (m_Stride == 16 && NumVertices  == 3414 && primCount == 2369))
#define CRYSIS2CHAMSOTHER (m_Stride == 16 && NumVertices == 260 && primCount == 434)
#define REMOVALS (m_Stride == 16 && NumVertices == 204  && primCount == 207 || (m_Stride == 16 && NumVertices ==  636 && primCount == 659) || (m_Stride == 16 &&  NumVertices == 349 && primCount == 243) || (m_Stride == 16  && NumVertices == 794 && primCount == 688) || (m_Stride  == 12 && NumVertices == 8 && primCount == 10))
#define BEEP_ACTIVATED Beep(2000, 500);
#define BEEP_DEACTIVATED Beep(1000, 500);
#define NULL 0;

void Initialize();
void ToggleAmmo();
void ToggleTagHack();
void ToggleChamsHack();
void Write2Asm(void*, BYTE*, int);

DWORD pAmmo;
DWORD pTagHack;

IDirect3DPixelShader9* texGreen;
IDirect3DPixelShader9* texYellow;


void Hotkeys()
{
	while(true)
	{
		if (GetAsyncKeyState(VK_F4))
		{
			ToggleAmmo();
		}

		if (GetAsyncKeyState(VK_F3))
		{
			ToggleTagHack();
		}

		if (GetAsyncKeyState(VK_F2))
		{
			ToggleChamsHack();
		}
		Sleep(500);
	}
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
		Beep(5000, 1000);
		Initialize();
		ThreadMake(Hotkeys);
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

void Initialize()
{
	DWORD CrysisBase = (DWORD)GetModuleHandle(L"CryGameCrysis2");
	pAmmo = (CrysisBase + 0x4225D);
	pTagHack = (CrysisBase + 0xF50C2);

	//WCHAR tempChar[256];
	//swprintf(tempChar, 256, L"0x%X", pAmmoOffset);
	//MessageBox(NULL, tempChar,  L"Info", MB_OK | MB_ICONASTERISK);
}

void ToggleAmmo()
{
	static bool hack_activated = false;

	if(hack_activated)
	{
		Write2Asm((void*)pAmmo,(PBYTE)"\x89\x70\x04",3);
		hack_activated = false;
		BEEP_DEACTIVATED
	} 
	else
	{
		Write2Asm((void*)pAmmo,(PBYTE)"\x90\x90\x90",3);
		hack_activated = true;
		BEEP_ACTIVATED
	}
}

void ToggleTagHack()
{
	static int hack_state = 0;
	
	switch(hack_state)
	{
		case 0:
			Write2Asm((void*)pTagHack,(PBYTE)"\xB3\x01",2);			
			hack_state++;
			BEEP_ACTIVATED
			break;	
		case 1:
			Write2Asm((void*)pTagHack,(PBYTE)"\xB3\x02",2);			
			hack_state++;
			BEEP_ACTIVATED
			break;	
		case 2:
			Write2Asm((void*)pTagHack,(PBYTE)"\x8A\xD8",2);			
			hack_state = 0;
			BEEP_DEACTIVATED
			break;	
	}

}
void Write2Asm(void* pxAddress, BYTE * MyBytes,  int size)
{
	unsigned long Protection;
	VirtualProtect((void*)pxAddress, size, PAGE_READWRITE, &Protection);
	memcpy((void*)pxAddress, (const void*)MyBytes, size);
	VirtualProtect((void*)pxAddress, size, Protection, 0);
}


typedef HRESULT (WINAPI* CreateDevice_Prototype)        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
typedef HRESULT (WINAPI* Reset_Prototype)               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef HRESULT (WINAPI* EndScene_Prototype)            (LPDIRECT3DDEVICE9);
typedef HRESULT (WINAPI* DrawIndexedPrimitive_Prototype)(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);

CreateDevice_Prototype         CreateDevice_Pointer         = NULL;
Reset_Prototype                Reset_Pointer                = NULL;
EndScene_Prototype             EndScene_Pointer             = NULL;
DrawIndexedPrimitive_Prototype DrawIndexedPrimitive_Pointer = NULL;

HRESULT WINAPI Direct3DCreate9_VMTable    (VOID);
HRESULT WINAPI CreateDevice_Detour        (LPDIRECT3D9, UINT, D3DDEVTYPE, HWND, DWORD, D3DPRESENT_PARAMETERS*, LPDIRECT3DDEVICE9*);
HRESULT WINAPI Reset_Detour               (LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
HRESULT WINAPI EndScene_Detour            (LPDIRECT3DDEVICE9);
HRESULT WINAPI DrawIndexedPrimitive_Detour(LPDIRECT3DDEVICE9, D3DPRIMITIVETYPE, INT, UINT, UINT, UINT, UINT);



void ToggleChamsHack()
{
	static bool hack_activated = false;

	if(hack_activated)
	{

		HRESULT WINAPI DrawIndexedPrimitive(D3DPRIMITIVETYPE Type, INT BaseVertexIndex, 
        UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
		{

			UINT m_Stride;
			UINT m_pD3Ddev;
			UINT OffsetInBytes;
			LPDIRECT3DDEVICE9 StreamData;


			if(m_pD3Ddev->GetStreamSource(0,&StreamData,&OffsetInBytes,&m_Stride) == D3D_OK) 
			{
				StreamData->Release();
			}

			if (REMOVALS && removals)   
			{
				return null;
			}

			if(CRYSIS2CHAMS)				
			{
				DWORD dwOldZEnable = D3DZB_TRUE; 
				m_pD3Ddev->SetTexture(0, texYellow);
				m_pD3Ddev->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable);
				m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
				m_pD3Ddev->DrawIndexedPrimitive(Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
				m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, dwOldZEnable);
				m_pD3Ddev->SetTexture(0, texGreen);
			}

			return m_pD3Ddev->DrawIndexedPrimitive(Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
		}
	}
}
#1 · edited 15y ago · 15y ago
MA
masterupload
cplusplus.com - The C++ Resources Network


How are you goin to include files that aren't even on the Project Solution
#2 · edited 15y ago · 15y ago
WO
woodpusher637
See that's one of my issues, I'm not even sure how to setup everything I need/don't need to finish this. I've been using ideas from multiple forums to compile a general idea of what I'm looking for. I need assist with what to #include and what not to #include as well as, specifically, what I need to finish the chams (which has been giving me errors on compile, mainly because I'm almost positive I don't even have them setup right).

As of now the only issue going on is the Chams part, the other two are working perfect.

Thanks for the reply,
Hit me back with any more information you can give.

Cheers.
#3 · 15y ago
MA
masterupload
I suggest you learn c++ is the only way you will get it right and will understand the concept
#4 · 15y ago
WO
woodpusher637
I didn't ask for suggestions, I asked for some help. I can learn or "get it right" from constructive criticism, not self-scrutiny. If you're willing to assist in this matter, feel free to comment.


Also, I've limited down the solution a bit for those who are truly willing to help; I'll post in a few.

Cheers.
#5 · 15y ago
hooch
hooch
You could at least give me credits. It's 90% my code.
#6 · 15y ago
WO
woodpusher637
Take it, I never said I wrote all of it... not to mention, I clearly stated I used the code from the top of the thread. l2r
#7 · edited 15y ago · 15y ago
BA
banek192
for chams you need D3D base. if you make with strides and etc.
#8 · 15y ago
WO
woodpusher637
Figured it out, thanks all.

/closed
#9 · 15y ago
MA
masterupload
Learn Cplusplus
#10 · 15y ago
WO
woodpusher637
/closed means /closed.

Thanks for trying though.
#11 · 15y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Tags for this Thread

None