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 


IF THEN in c.e?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Jase
How do I cheat?
Reputation: 0

Joined: 15 Jun 2010
Posts: 2

PostPosted: Tue Jun 15, 2010 8:40 am    Post subject: IF THEN in c.e? Reply with quote

Hello, new here, longtime C.E user. Never really tried using many of the options that come with C.E since i'm a bit noobish when it comes to languages, but i'm prepared to learn any if necessary.

Well, the question is, is there a way to do "If" and "Then" sort of commands in C.E? Say I have Address 00599220 which has the value of 55, Is it possible for C.E to detect that 00599220 is 55, then start running a script that forces a different address to change value to yet ANOTHER address? Im really making my question complicated... I'll just write my scenario.

In the game I am hacking, i'm trying to make it so when my character is performing a certain move, it will make another object to constantly position onto my player, until he isn't performing the move anymore. Is this easy/possible to do? If so, any guides?

I am sorry for being such a prick by coming on here and immediately asking for help... I suppose it's not all bad since im not directly asking for hacks for a game, but rather to learn how to do it myself. I dunno, thanks in advance guys!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25875
Location: The netherlands

PostPosted: Tue Jun 15, 2010 9:04 am    Post subject: Reply with quote

Do a code injection in the game at an often called routine (e.g render routine or even in the routine that changes the initial value) and in there do the value change.

e.g:
Code:

alloc(yourcode,1024)
label(originalcode)
label(jumpback)

hookedroutine:
jmp yourcode
nop
nop
jumpback:

yourcode:
cmp [00599220],#55  //is the value 55 ?
jne originalcode  //if not, exit the injection
mov [anotheraddress],#100000 //else set another address to 100000

originalcode:
db 11 22 33 44 55 66 77
jmp jumpback


_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Jase
How do I cheat?
Reputation: 0

Joined: 15 Jun 2010
Posts: 2

PostPosted: Tue Jun 15, 2010 4:13 pm    Post subject: Reply with quote

Dark Byte wrote:
Do a code injection in the game at an often called routine (e.g render routine or even in the routine that changes the initial value) and in there do the value change.

e.g:
Code:

alloc(yourcode,1024)
label(originalcode)
label(jumpback)

hookedroutine:
jmp yourcode
nop
nop
jumpback:

yourcode:
cmp [00599220],#55  //is the value 55 ?
jne originalcode  //if not, exit the injection
mov [anotheraddress],#100000 //else set another address to 100000

originalcode:
db 11 22 33 44 55 66 77
jmp jumpback



Thanks for reply! Helps tonns!
Sorry to be inept, but i'm struggling still... Generally, get confused on what bits and pieces to replace and alter. Sorry for knowing nothing, but I really want to learn.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

Joined: 09 May 2003
Posts: 25875
Location: The netherlands

PostPosted: Wed Jun 16, 2010 12:39 pm    Post subject: Reply with quote

It's easiest to just to the code injection template in the auto assembler window, it fills in most of the stuff you need
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
bhpianist
Cheater
Reputation: 1

Joined: 17 Apr 2010
Posts: 38

PostPosted: Tue Jun 22, 2010 10:50 pm    Post subject: Reply with quote

Jase wrote:

Thanks for reply! Helps tonns!
Sorry to be inept, but i'm struggling still... Generally, get confused on what bits and pieces to replace and alter. Sorry for knowing nothing, but I really want to learn.


Code:
cmp [00599220],#55  //is the value 55 ?
jne originalcode  //if not, exit the injection


That checks to see if the value at 00599220 is equal to 55 . The jne means, if it's not equal then jump to "originalcode" which is below. If it is equal, then it'll continue and:
Code:
mov [anotheraddress],#100000 //else set another address to 100000

move 100000 into another address, but both paths will eventually trickle down to the "originalcode", which jumps back to the original code.
Back to top
View user's profile Send private message MSN Messenger
Teh1337Bix
Cheater
Reputation: 3

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Sun Jun 27, 2010 2:20 am    Post subject: Reply with quote

originalcode doesn't jump back. jmp jumpback does. Original code just holds the code that was overwritten to get fit the jmp to the injection in.
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