jump condition question

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
User avatar
Kalas
Expert Cheater
Expert Cheater
Posts: 551
Joined: Fri Mar 03, 2017 9:49 am
Reputation: 134

jump condition question

Post by Kalas »

Hey!

I'm kinda new to jump conditions so I wanted to make sure I understand this following code correctly:

Code: Select all

 code:
 pushf
 cmp [r12+20],esi
 jl originalcode
 popf
 jmp return

originalcode:
  popf
  mov [r12+20],esi
  jmp return
The instruction is for Health, It writes when you loose and gain health. (I saw Stephan Chapman video about this but I still don't understand how It works)
Last edited by Kalas on Wed Oct 18, 2017 7:46 am, edited 1 time in total.

Bloodybone
Table Makers
Table Makers
Posts: 288
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 133

Re: jump condition question

Post by Bloodybone »

jl is jump if less that means jump if [r12+20] is smaler than esi. I watched the tutorial also so what happens is if the player gets hit esi is smaller than [r12+20] so don't jump and if it is bigger like if you use an health potion esi is bigger than [r12+20] so jump.

User avatar
Kalas
Expert Cheater
Expert Cheater
Posts: 551
Joined: Fri Mar 03, 2017 9:49 am
Reputation: 134

Re: jump condition question

Post by Kalas »

Oh I think I got it now, still have doubts.

So if I get hit jump to return which means do nothing, and if I gain health so run the instruction as normal. Thank you so much!

Bloodybone
Table Makers
Table Makers
Posts: 288
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 133

Re: jump condition question

Post by Bloodybone »

Kalas wrote:
Tue Oct 17, 2017 8:55 pm
Oh I think I got it now, still have doubts.

So if I get hit jump to return which means do nothing, and if I gain health so run the instruction as normal. Thank you so much!
What doubts do you have?

User avatar
Kalas
Expert Cheater
Expert Cheater
Posts: 551
Joined: Fri Mar 03, 2017 9:49 am
Reputation: 134

Re: jump condition question

Post by Kalas »

I don't get it, If +20 is lower then esi jump to code, shouldn't it jump to return?

User avatar
Kalas
Expert Cheater
Expert Cheater
Posts: 551
Joined: Fri Mar 03, 2017 9:49 am
Reputation: 134

Re: jump condition question

Post by Kalas »

Oh hang on, It's never going to take health but it checks if it is lower then esi it's going to jump to code and allow to gain health.

Bloodybone
Table Makers
Table Makers
Posts: 288
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 133

Re: jump condition question

Post by Bloodybone »

[r12+20] is the pointer to player health and esi is new player health so if new player health(esi) is smaller then current player health [r12+20] then jump to return and if esi is bigger like current player health is 40 and esi is after drinking the health potion 50 then jump to originalcode
Last edited by Bloodybone on Tue Oct 17, 2017 9:13 pm, edited 1 time in total.

Bloodybone
Table Makers
Table Makers
Posts: 288
Joined: Thu Aug 03, 2017 6:19 am
Reputation: 133

Re: jump condition question

Post by Bloodybone »

Kalas wrote:
Tue Oct 17, 2017 9:09 pm
Oh hang on, It's never going to take health but it checks if it is lower then esi it's going to jump to code and allow to gain health.
yes thats it.

User avatar
Kalas
Expert Cheater
Expert Cheater
Posts: 551
Joined: Fri Mar 03, 2017 9:49 am
Reputation: 134

Re: jump condition question

Post by Kalas »

Sweet thanks!

Post Reply

Who is online

Users browsing this forum: No registered users