Solved Mid Function Hooking

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

ranseier

Jr.Coder
Full Member
Nobleman
Sep 26, 2015
53
303
3
Hi,

I want to get all players coords in a game using mid function hooking.
In the first step I just want to show addresses I have found but the game keeps crashing with the a message like "security error" when I inject the DLL in RemoteDLL. It looks like this hook is detected somehow but maybe I am doing something completly wrong.

These addresses I want to overwrite:

00A8C0BB F3:0F1176 6C MOVSS DWORD PTR DS:[ESI+6C],XMM6
00A8C0C0 F3:0F1146 70 MOVSS DWORD PTR DS:[ESI+70],XMM0

This means I need to get 8 bytes, isn't it?

C++:
void InitiateHooks()
{
	DWORD coordsAddy = FindPattern("DeadFrontier.exe", "\xF3\x0F\x11\x76\x6C\xF3\x0F\x11\x46\x70", "xxxxxxxxxx");
	MsgBoxAddy(coordsAddy);

	CoordsJmpBack = coordsAddy + 0x8;

	PlaceJMP((BYTE*)coordsAddy, (DWORD)GetPlayerCoords, 8);
	
	MsgBoxAddy(CoordsRegister);
}
C++:
//Store where we jump back to after our hook
DWORD CoordsJmpBack = 0;
//stores the register's address
DWORD CoordsRegister = 0x0;
DWORD CoordsPtr;

__declspec(naked) void GetPlayerCoords()
{

	__asm MOVSS CoordsRegister, XMM6

	__asm MOVSS DWORD PTR DS : [ESI + 0x6C], XMM6
	__asm MOVSS DWORD PTR DS : [ESI + 0x70], XMM0

	//Jump back to our original code
	__asm jmp[CoordsJmpBack]
}
The Functions.h comes from Fleeps tutorials. I can post it too, if you want.

MsgBoxAddy(coordsAddy); shows a valid address. but always the same. regardless of game restarts.
MsgBoxAddy(CoordsRegister); shows "00" and the game crashes with "security error".

Am I doing something totally wrong here?

Thanks
 

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,745
40,528
316
Hi,

I want to get all players coords in a game using mid function hooking.
In the first step I just want to show addresses I have found but the game keeps crashing with the a message like "security error" when I inject the DLL in RemoteDLL. It looks like this hook is detected somehow but maybe I am doing something completly wrong.

These addresses I want to overwrite:

00A8C0BB F3:0F1176 6C MOVSS DWORD PTR DS:[ESI+6C],XMM6
00A8C0C0 F3:0F1146 70 MOVSS DWORD PTR DS:[ESI+70],XMM0

This means I need to get 8 bytes, isn't it?

C++:
void InitiateHooks()
{
	DWORD coordsAddy = FindPattern("DeadFrontier.exe", "\xF3\x0F\x11\x76\x6C\xF3\x0F\x11\x46\x70", "xxxxxxxxxx");
	MsgBoxAddy(coordsAddy);

	CoordsJmpBack = coordsAddy + 0x8;

	PlaceJMP((BYTE*)coordsAddy, (DWORD)GetPlayerCoords, 8);
	
	MsgBoxAddy(CoordsRegister);
}
C++:
//Store where we jump back to after our hook
DWORD CoordsJmpBack = 0;
//stores the register's address
DWORD CoordsRegister = 0x0;
DWORD CoordsPtr;

__declspec(naked) void GetPlayerCoords()
{

	__asm MOVSS CoordsRegister, XMM6

	__asm MOVSS DWORD PTR DS : [ESI + 0x6C], XMM6
	__asm MOVSS DWORD PTR DS : [ESI + 0x70], XMM0

	//Jump back to our original code
	__asm jmp[CoordsJmpBack]
}
The Functions.h comes from Fleeps tutorials. I can post it too, if you want.

MsgBoxAddy(coordsAddy); shows a valid address. but always the same. regardless of game restarts.
MsgBoxAddy(CoordsRegister); shows "00" and the game crashes with "security error".

Am I doing something totally wrong here?

Thanks
The patchlength is wrong. It should be 10 (0x0A) bytes and not 8.
 

ranseier

Jr.Coder
Full Member
Nobleman
Sep 26, 2015
53
303
3
Its working now.

It will still take some time until I can show something since I have moved from C# to C++ due to dll injection and stuff like that. C++ and ASM is pretty new to me.

C++:
//Store where we jump back to after our hook
DWORD CoordsJmpBack = 0;
float yAxis;
float xAxis;

__declspec(naked) void GetPlayerCoords()
{
	__asm MOVSS DWORD PTR DS : yAxis, XMM6
	__asm MOVSS DWORD PTR DS : xAxis, XMM4

	__asm MOVSS DWORD PTR DS : [ESI + 0x6C], XMM6
	__asm MOVSS DWORD PTR DS : [ESI + 0x70], XMM0

	//Jump back to our original code
	__asm jmp[CoordsJmpBack]
}
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods