Solved C++ Reading value of register from a different part in memory

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Nullingz

Newbie
Dank Tier Donator
Aug 2, 2015
3
82
0
I've been following all of Fleep's tutorials on the Guided Hacking YouTube channel, and finally decided to try to make something myself.
There is a value that is set in the ESI register at the address: 0x130C313 with instruction: mov eax,[esi]

I use this code to get the value of ESI from C++:
C++:
DWORD pBasePointer;
void ASDF()
{
	__asm{
		mov dword ptr [pBasePointer],esi
	};
}
Which defines pBasePointer, but its not the same value as it is when I add a breakpoint on 0x130C313 and look at the ESI register.
I am guessing this is because my ASM is ran much later (or earlier) in memory, where the value of ESI either has been overwritten, or not been set to what I want yet.
Is there any way to get the value of ESI at the point that its set at 0x130C313 in C++?
 
Last edited:

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,298
37,938
269
C++:
declspecnaked function here:
mov localVariable, esi
replaced code here , for example
push esi
sub eax
mov eax
jmp MyHookLocation+5
Just have your hook function do the same instructions
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,298
37,938
269
Hook at that point and grab esi then, making sure to rewrite the code you overwrote
 

Nullingz

Newbie
Dank Tier Donator
Aug 2, 2015
3
82
0
Hook at that point and grab esi then, making sure to rewrite the code you overwrote
Thanks, I did that and it works, but seems to crash the game before I get a chance to replace the code.
I either replace the code to quickly for my hook to grab the value of ESI, or I grab the value of ESI, then the game crashes.
What would you suggest doing?
 
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