Solved Hook works but not works

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
Soo I decided to learn how to hook and it kinda worked... I'll explain:

1- I followed Solaire's hooking video and I basically did everything as he did. I followed the rules, at least 5 bytes for the jmp, don't leave any bytes left, and if it overrides anything make sure to include that in your code.

2- What's happening. Well, I hooked my desired function and it indeed changed the instruction to a jmp. Okay, now it's suppose to run my code, but it does nothing at all, it behaves like the function is empty which makes me think that it's running my code, I'll link some pictures so you can see better what's going on. (It doesn't decreases my ammo btw, and I tested putting the add in CH and it increased my ammo)

This one is my main code, I'm hooking a 6 byte instruction and the address is correct.
This is solaire's hook function

Here is the spot i'm trying to hook, as you can there are 6 bytes
And this is the spot hooked, as you can see, nothing wrong over here

If know what I've done wrong and can help me I'd be very thankful.
 

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,294
37,938
269
your code adds 14 to esi, old code added 0x1414, also the preceding 0s are unnecessary.

[ASM]
add [esi+1414h], edi
[/ASM]

is fine
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
your code adds 14 to esi, old code added 0x1414, also the preceding 0s are unnecessary.

[ASM]
add [esi+1414h], edi
[/ASM]

is fine
Ohh I didn't see 1414 lol, srry for this question :(

Btw i just added the zeros 'cause it wasn't working so I tried everything, but I should've checked the most basic thing... Thank you 4 the observation

Edit: Still doesn't work, any other idea?

Edit2: I followed the code in CH and I found this, the offset shouldn't be 1414?
 
Last edited:

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
add [esi+1414], edi
needs to be
add [esi+0x1414], edi
in your hook code. Compiler is reading 1414 as decimal unless you tell it to read it as hex with 0x. Simple mistake.
Try following your hook in cheat engine and checking out what the offset in that instruction is before putting the '0x', it'll probably display:
add [esi+586], edi

Ah I just saw you actually did follow your hook and saw it was 586 confirming what I said before is actually the issue :)
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
1,678
13
Yeah, fixed thank you guys! I thought that the compiler would not need the 0x because the code is in the __asm tag, but seems it need it :p
 
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