Need help at a PTC Function

Posts 1–9 of 9 · Page 1 of 1
Need help at a PTC Function
Hey guys, I'm currently writing a PTC function, the Address for Engine I got from
http://www.mpgh.net/forum/224-combat...12-2011-a.html
but ingame nothing happens:

Code:
#define ADR_ENGINE						0x485FF0

void CombatArms::ConsolePush(const char *szCommand) {
	__asm {
		PUSH szCommand
		MOV EAX, ADR_ENGINE
		CALL EAX
		ADD ESP, 4
	}
}
And the call is:
Code:
CombatArms *ca = new CombatArms();

while (true) {
		if (GetAsyncKeyState(VK_F10)&1) {
			ca->ConsolePush("ShowFps 1");
		}
	}
your call must be hooked or in a hooked function;
if you wrote it yourself explain the asm ;D;
ah thank you ->
sure I can explain it:
Push szCommand <- push the command on the stack
mov eax, ADR_ENGINE <- copys the address of engine to eax, cause can't call it direct
call eax <- calls the address with a e9 jump
add esp, 4 <- clears the esp-stackframe
to work:

Code:
HRESULT WINAPI myPresent(LPDIRECT3DDEVICE9 pDevice, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion)
{
	while (true) {
		if (GetAsyncKeyState(VK_F10)&1) {
			ca->ConsolePush("ShowFps 1");
		}
	}


	return pPresent(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
already get it workin, just forgot this with the hooked functin, but thanks
What on earth are you guys talking about? I feel so inferior to all of you lol
Quote Originally Posted by striderplus111 View Post
What on earth are you guys talking about? I feel so inferior to all of you lol
talking about how make hacks using console comands.

you not inferior, you only don't read about how make hacks.
So you guys are making hacks that are usable only through console? or using the console to hack the game?
using the gameconsole for some functions
Posts 1–9 of 9 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us