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 


Restore Original Code NOT Predefined

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

Joined: 09 Mar 2011
Posts: 131
Location: USA, FL

PostPosted: Fri Jul 15, 2016 4:54 pm    Post subject: Restore Original Code NOT Predefined Reply with quote

Trying to edit this code for a AOB/Inject, however part of this address changes, and upon restoring the code you end up with a half assed portion.

code:
add dword ptr [ebp-64],createPotionPercent
mov eax,[04AB4A60] <-- is different sometimes
jmp return

How do you save the bytes and restore the original one, instead of using it predefined:

assert(bytes, 83 45 9C 0A A1 60 4A AB 04)

Instead:

[DISABLE]
cratePotionChance:
db 83 45 9C 0A A1 60 4A AB 04
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Fri Jul 15, 2016 5:10 pm    Post subject: Reply with quote

As for the assert, you can use wildcards ("?" or "*").

For restoring the correct original code, you can simply do a "readmem" command with the correct size.

Best provide a screenshot of the disassembler with some lines before and after the instruction where you want to inject code, so that we can understand the code better.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Jul 15, 2016 5:13 pm    Post subject: Reply with quote

Easiest solution is to just move your injection up one instruction.

Otherwise, use reassemble()
Code:
label(saveme)
registersymbol(saveme)
  ...
code:
  add dword ptr [ebp-64],0A
saveme:
  reassemble(cratePotionChance+4)
[DISABLE]
cratePotionChance:
  reassemble(saveme)
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Jul 15, 2016 5:25 pm    Post subject: Reply with quote

we need a way to favorite posts, I would like to be able to point people to zanzer's post every time it comes up
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Jul 15, 2016 6:27 pm    Post subject: Reply with quote

All of my posts are pure gold. How could you possibly choose a favorite?!
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Jul 15, 2016 11:59 pm    Post subject: Reply with quote

The reassemble function isn't documented anywhere other than a few forum posts. DB slipped that one in a few years ago. Very sneaky.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Sat Jul 16, 2016 2:22 am    Post subject: Reply with quote

I second the bookmarking/favoriting posts idea. There has been times where i thought to bookmark a post for reading later or trying something and then either couldn't find the post from search (Google search has its own biased algorithm of what it thinks is the best post and old-ass posts are sometime buried or removed from index) or i lost it in my browser bookmarks (i have thousands and its hard to remember what you bookmarked and for what).

That reassemble() method is a life-saver especially in Unity/games generating data on the fly where the code moves and aobscanning is the only solution.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
Marcus101RR
Expert Cheater
Reputation: 2

Joined: 09 Mar 2011
Posts: 131
Location: USA, FL

PostPosted: Sat Jul 16, 2016 1:12 pm    Post subject: Reply with quote

Zanzer wrote:
Easiest solution is to just move your injection up one instruction.

Otherwise, use reassemble()
Code:
label(saveme)
registersymbol(saveme)
  ...
code:
  add dword ptr [ebp-64],0A
saveme:
  reassemble(cratePotionChance+4)
[DISABLE]
cratePotionChance:
  reassemble(saveme)


I shifted the code up and it worked.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
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