View previous topic :: View next topic |
Author |
Message |
Marcus101RR Expert Cheater
Reputation: 2
Joined: 09 Mar 2011 Posts: 131 Location: USA, FL
|
Posted: Fri Jul 15, 2016 4:54 pm Post subject: Restore Original Code NOT Predefined |
|
|
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 |
|
 |
hhhuut Grandmaster Cheater
Reputation: 6
Joined: 08 Feb 2015 Posts: 607
|
Posted: Fri Jul 15, 2016 5:10 pm Post subject: |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Jul 15, 2016 5:13 pm Post subject: |
|
|
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 |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Fri Jul 15, 2016 5:25 pm Post subject: |
|
|
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 |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Jul 15, 2016 6:27 pm Post subject: |
|
|
All of my posts are pure gold. How could you possibly choose a favorite?!
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Fri Jul 15, 2016 11:59 pm Post subject: |
|
|
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 |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Sat Jul 16, 2016 2:22 am Post subject: |
|
|
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.
_________________
|
|
Back to top |
|
 |
Marcus101RR Expert Cheater
Reputation: 2
Joined: 09 Mar 2011 Posts: 131 Location: USA, FL
|
Posted: Sat Jul 16, 2016 1:12 pm Post subject: |
|
|
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 |
|
 |
|