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 statement?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
dEagle
Expert Cheater
Reputation: 0

Joined: 17 Jun 2006
Posts: 225
Location: CheatEngine Forum

PostPosted: Fri Apr 04, 2008 8:55 am    Post subject: If Then statement? Reply with quote

Like Visual Basic,
I wonder if i could use it here too? If so,
How?

Example,
If 04010000 eax = 100 Then
Mov eax, 99999
..or something samiliar.

Or isit just simply impossible?
Maybe using the C script?
Back to top
View user's profile Send private message
Psy
Grandmaster Cheater Supreme
Reputation: 1

Joined: 27 Mar 2008
Posts: 1366

PostPosted: Fri Apr 04, 2008 11:29 am    Post subject: Reply with quote

In assembly for CE's script it would be roughly:

4010000:
cmp eax,100
jne <next>
mov eax,99999 (<-- but that would want to be converted to hex)
<next>

You see we can use the compare to see if it equals 100, and if it does if will skip the jump and mov 99999 into eax. If it didn't equal 100, it would execute the jump and therefore miss the moving of 99999 into the eax register.

Find what CE pokes into memory (it'll convert it to bytes for you), then just use the bytes in visual basic as normal Wink
Back to top
View user's profile Send private message
dEagle
Expert Cheater
Reputation: 0

Joined: 17 Jun 2006
Posts: 225
Location: CheatEngine Forum

PostPosted: Fri Apr 04, 2008 11:45 am    Post subject: Reply with quote

But that's a code injection
in other word's
it'll replace the code at 401000 with the code u injected?
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6300

PostPosted: Fri Apr 04, 2008 12:02 pm    Post subject: Reply with quote

Yes it is a injection. If you want alter the value of eax thats what it is all about.
If you used the script engine instead it would also be an injection.
But you need to write that to a cave and jump to it.
You cant just write it at the address you found, the target will crash.

Basically replace code @ 4010000: with a jmp to a cave.
Write your code in the cave and jmp back.
Back to top
View user's profile Send private message
dEagle
Expert Cheater
Reputation: 0

Joined: 17 Jun 2006
Posts: 225
Location: CheatEngine Forum

PostPosted: Fri Apr 04, 2008 1:19 pm    Post subject: Reply with quote

Oh yeah,
i never really got into code caving.
ima read some tutorial's on this forum.
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6300

PostPosted: Fri Apr 04, 2008 1:24 pm    Post subject: Reply with quote

Here is a template of what you need to learn with pretty much.
Code:

[ENABLE]
label(yep)

codecaveaddress:
write your code
jmp yep

originaladdress:
jmp codecave
nop
yep:

[DISABLE]
originaladdress:
original code
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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