| View previous topic :: View next topic |
| Author |
Message |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Sat Jun 21, 2014 6:39 pm Post subject: AOB - Toggleable script: restore original "??" byt |
|
|
Hi there, i'm making a script that modifies bytes, in my aobscan i have an unknown byte "??" that i want to nop.
The problem is when i want to restore that byte, i can't because i don't know the original byte.
Here's my script: (Credit to Rydian for his amazing tutorial about aobs)
| Code: |
[ENABLE]
aobscan(spr, ?? 05 0F 57 C0)
label(_spr)
registersymbol(_spr)
spr:
_spr:
db 90 90
// new aob: 90 90 0F 57 C0
[DISABLE]
_spr:
db <what_goes_here> 05
// new aob: <what_goes_here> 05 0F 57 C0
unregistersymbol(_spr)
|
I thought i would use symbols to store the original array of bytes and restore it later, but i'm still learning, i would like to know if it's possible and how to do it. Thx
_________________
Rhaa Stregum Vitae  |
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Sun Jun 22, 2014 12:48 am Post subject: |
|
|
| Code: | [ENABLE]
aobscan(spr, ?? 05 0F 57 C0)
registersymbol(spr)
alloc(original_bytes,5)
registersymbol(original_bytes)
original_bytes:
readmem(spr,5)
spr:
db 90 90
[DISABLE]
spr:
readmem(original_bytes,5);
unregistersymbol(spr)
unregistersymbol(original_bytes) |
_________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
Stregum Advanced Cheater
Reputation: 0
Joined: 17 Jun 2014 Posts: 56 Location: We make baguettes there !
|
Posted: Sun Jun 22, 2014 4:50 am Post subject: |
|
|
Well, thanks DaSpamer, i guess i'm not enough smart to think about readmem :p
(Actually i learned something, keep up the good help and tips)
_________________
Rhaa Stregum Vitae  |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sun Jun 22, 2014 7:56 am Post subject: |
|
|
There's other way:
| Code: | [ENABLE]
aobscan(spr, ?? 05 0F 57 C0)
registersymbol(spr)
label(original_byte)
registersymbol(original_byte)
[spr]:
original_byte:
spr:
db 90 90
[DISABLE]
spr:
db original_byte
db 05 0F 57 C0
unregistersymbol(spr)
unregistersymbol(original_byte) |
This will set usersymbol "original_byte" to 570F05XX:
| Code: |
[spr]:
original_byte: |
And this will take only "XX" from "570F05XX"
Of course, when you are using 64bit CE, usersymbols will be "8877665544332211" instead of "44332211".
But, it doesn't matter, db will only take "11", dw will take "2211", dd will take "44332211".
_________________
|
|
| Back to top |
|
 |
|