Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need To learn this Help Guys :D

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
NanoByte
Expert Cheater
Reputation: 1

Joined: 13 Sep 2013
Posts: 222

PostPosted: Sun May 18, 2014 5:01 am    Post subject: Need To learn this Help Guys :D Reply with quote

Code:
fstp dword ptr [esi+04] //original code which is changing the health
pushfd //save flags
pushad //save registers
cmp [esi],0 //check if ESI=0
jne +6 //if ESI is not 0, the code will jump over the next 2 lines, jumping to the "popad" instruction
mov eax,[esi+08] //copy the max health on eax
mov [esi+04],eax //copy eax to the health, so max health = health
popad //load registers
popfd //load flags


jne +6 // how does it jump over the next 2 lines when it says +6 what if i wanted to jump over 1 line would it be 3 then?

why is it not +2 since it jumps over 2 lines?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun May 18, 2014 5:15 am    Post subject: Reply with quote






mov eax,[esi+08] - three bytes \
mov [esi+04],eax - three bytes / six bytes






TIP:
better use "unlabeled labels":
Code:
fstp dword ptr [esi+04]
pushfd
pushad
cmp [esi],0
jne @f

mov eax,[esi+08]
mov [esi+04],eax

@@:
popad
popfd

_________________
Back to top
View user's profile Send private message MSN Messenger
NanoByte
Expert Cheater
Reputation: 1

Joined: 13 Sep 2013
Posts: 222

PostPosted: Sun May 18, 2014 5:24 am    Post subject: Reply with quote

Code:
fstp dword ptr [esi+04]
pushfd
pushad
cmp [esi],0
jne @f

mov eax,[esi+08]
mov [esi+04],eax

@@:
popad
popfd


how would this work if i had multiply jumps

jne @f //@f ?

line 1
line 2

@@1
bla
bla

jg @f

line 1
line 2
line 3

@@2
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun May 18, 2014 5:38 am    Post subject: Reply with quote

jm* @f will jump to the nearest @@, when moving down. (forward)

jm* @b will jump to the nearest @@, when moving up. (backward)

_________________
Back to top
View user's profile Send private message MSN Messenger
NanoByte
Expert Cheater
Reputation: 1

Joined: 13 Sep 2013
Posts: 222

PostPosted: Sun May 18, 2014 5:43 am    Post subject: Reply with quote

Ohh Nice Very Happy

Thanks Alot mate, you are the best Very Happy
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun May 18, 2014 5:59 am    Post subject: Reply with quote

Try not to code scripts like that. The scripts with only @@ will look like crap, and are hard to read.

Code:
@@:
line1
line2
line3
...

line16
je @f   

line17
line18
line19
jne @b




@@
line20
line21
line22
line23
jne @f


line24
line25


@@:
line26
line27

jmp returnhere


The example above, assume that line1-line19 is for searching through some kind of list. (it is a loop)
When it finds the object we want, jump (the jump after line 16) is taken.
Line20-line23 checks current state of object. If object state is "enabled" (this is just an example), then line24 and line25 and the rest of code are executed. If not, it jumps straight to line26.





So, use @@ only when you want to skip few lines only.

_________________
Back to top
View user's profile Send private message MSN Messenger
NanoByte
Expert Cheater
Reputation: 1

Joined: 13 Sep 2013
Posts: 222

PostPosted: Sun May 18, 2014 6:10 am    Post subject: Reply with quote

This will make scripting so much easier Thanks aloot Mate Very Happy

Loving the CE community
Back to top
View user's profile Send private message
Xblade Of Heaven
Master Cheater
Reputation: 0

Joined: 16 Oct 2005
Posts: 395
Location: DEAD

PostPosted: Sun May 18, 2014 7:50 am    Post subject: Reply with quote

why save the flags and registers here?

Code:

label(_test)

fstp dword ptr [esi+04]
pushfd
pushad
cmp [esi],0
jne _test

mov eax,[esi+08]
mov [esi+04],eax

_test:
popad
popfd


you do not need to save anything here is a simple comparison without more, or only eax.

Code:

label(_test)

push eax
cmp [esi],0
jne _test

mov eax,[esi+08]
mov [esi+04],eax
pop eax
_test:


regards

PD: Thanks for the tip mgr.inz.Player (unlabeled labels) ^^ I had no idea this.

_________________
Welcome to the Hell.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
NanoByte
Expert Cheater
Reputation: 1

Joined: 13 Sep 2013
Posts: 222

PostPosted: Sun May 18, 2014 7:59 am    Post subject: Reply with quote

Thanks for the answere but thats not my script i just saw it and wanted to learn ways to jump around code without having to make a millions labels, im just too lazy Very Happy
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Sun May 18, 2014 2:23 pm    Post subject: Reply with quote

It's a damn old script from one of my tutorials, to show how to save flags, register, make a compare etc to create a god mode.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites