| View previous topic :: View next topic |
| Author |
Message |
Tearlow Newbie cheater
Reputation: 0
Joined: 02 Dec 2009 Posts: 14
|
Posted: Thu Jan 26, 2012 1:40 pm Post subject: Label bug or did I miss something? |
|
|
EDIT: How the hell did this end up in Auto ASM Tutorials, this should been in Cheat Engine section. Could someone move it?
I hope this topic really fits here...
Either way, I think I may have stumbled upon a bug of sorts, that is- Unless I did something wrong...
| Code: | [ENABLE]
aobscan(infhp, 29 86 54 01 00 00 C6 86 ?? ?? ?? ?? ??)
label(_infhp)
registersymbol(_infhp)
infhp:
_infhp:
db 90 90 90 90 90 90
[DISABLE]
_infhp:
db 29 86 54 01 00 00
unregistersymbol(_infhp) |
Simple enough, Symbols are used to save some time so we don't need to do another aobscan to disable. And this code should work just fine if you try to use it. But with a minor change like _infhp+10: the compiler tells me _infhp label has not yet been defined.
Sure, I know I could use infhp+10: instead but should labels not be defined even if I move them a few bytes?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25952 Location: The netherlands
|
Posted: Thu Jan 26, 2012 2:35 pm Post subject: |
|
|
at that point _infhp gets defined based on the current write pointer, set bythe previous line.
Before that point _infhp is not defined so a calculation on it is not possible
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Tearlow Newbie cheater
Reputation: 0
Joined: 02 Dec 2009 Posts: 14
|
Posted: Thu Jan 26, 2012 3:57 pm Post subject: |
|
|
| Dark Byte wrote: |
at that point _infhp gets defined based on the current write pointer, set bythe previous line.
Before that point _infhp is not defined so a calculation on it is not possible |
That makes sense, thanks for clearing that up for me
|
|
| Back to top |
|
 |
Geri Moderator
Reputation: 112
Joined: 05 Feb 2010 Posts: 5627
|
Posted: Fri Jan 27, 2012 2:28 am Post subject: |
|
|
But you can use
infhp+10:
without any problem.
_________________
|
|
| Back to top |
|
 |
Tearlow Newbie cheater
Reputation: 0
Joined: 02 Dec 2009 Posts: 14
|
Posted: Fri Jan 27, 2012 4:33 am Post subject: |
|
|
| Geri wrote: | But you can use
infhp+10:
without any problem. |
infhp is a aobscan though- I meant the label. So... Nope. Not if you require to define it. Let me show you by adding Auto ASM code that you can try yourself.
| Code: | [ENABLE]
aobscan(infhp, 29 86 54 01 00 00 C6 86 ?? ?? ?? ?? ??)
label(_infhp)
registersymbol(_infhp)
infhp:
_infhp:
db 90 90 90 90 90 90
[DISABLE]
_infhp:
db 29 86 54 01 00 00
unregistersymbol(_infhp) |
This code works fine, It's my example from above. But while im defining _infhp I need it moved by a few bytes so we do _infhp+10:
| Code: | [ENABLE]
aobscan(infhp, 29 86 54 01 00 00 C6 86 ?? ?? ?? ?? ??)
label(_infhp)
registersymbol(_infhp)
infhp:
_infhp+10:
db 90 90 90 90 90 90
[DISABLE]
_infhp:
db 29 86 54 01 00 00
unregistersymbol(_infhp) |
This is now invalid. If I need it moved the bytes that is required I would have to count from AoBScan's location, in other words infhp+10: then add the labels location after. This is obviously if I want everything in a single script. If I'd split them into two scripts I could inc/dec from _infhp as It's already defined by say...
Code 1
| Code: | [ENABLE]
aobscan(infhp, 29 86 54 01 00 00 C6 86 ?? ?? ?? ?? ??)
label(_infhp)
registersymbol(_infhp)
infhp:
_infhp:
[DISABLE]
unregistersymbol(_infhp) |
This will work like a.. Say enable script to allow others the use of it.
Code 2: This will use _infhp and is then able to move it as needed.
| Code: | [ENABLE]
_infhp+10:
db 90 90 90 90 90 90
[DISABLE]
_infhp+10:
db 29 86 54 01 00 00 |
Now, if you enable the first code snippet you can enable the second and it will work. Sorry though if I repeated myself a few times as I cannot proofread right now.
|
|
| Back to top |
|
 |
|