Solved Mid Function Hooking in C#?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

ranseier

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

sometimes it is hard to find all players in a game in memory but you have found a function that loops through all these players. You know that at a specific point in the function, the player address is stored in ESI. The propably easiest way to retrieve all player addresses now is a mid function hook where you store ESI.

Fleep showed us a solution using C++/ASM. Is there a way to do it in C#/ASM? I am asking because I want to show the player positions in an external window using C#.

This is the interesting part of fleeps example:
C++:
//Store where we jump back to after our hook
DWORD FlyingJmpBack = 0;
//stores the register's address
DWORD YaxisRegister = 0x0;
DWORD YAxisPtr;

//Store our player's y axis into our dword
__declspec(naked) void GetPlayerYaxis() 
{
	//Run the instructions the same as before
	//EXCEPT we take the address within ESI(Our Y axis)
	//AND later on modify it so we can fly
	//The offset of 0x3x tells us that ESI + 3C gives us
	//Y Axis, ESI is likely to point to our player base(unchecked)
	__asm MOV ECX, [ESI+0x3C]
	//Throw our address into our DWORD YaxisRegister so we can 
	//later modify the float value the address points to
	__asm MOV YaxisRegister, ESI
	__asm MOV [ESI+0x08],EDX
	//Jump back to our original code
	__asm jmp [FlyingJmpBack]
}
If it is not possible to do it entirely in C#/ASM, how would I pass YaxisRegister to my C# program everytime __declspec(naked) void GetPlayerYaxis() gets called?

Thanks!
 

Coco Pommel

Newbie
Dank Tier Donator
Oct 19, 2012
44
1,558
0
EasyHook
But it would be 100x easier just to find it in memory and use RPM, trust me.
 
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