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 


Label bug or did I miss something?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Tearlow
Newbie cheater
Reputation: 0

Joined: 02 Dec 2009
Posts: 14

PostPosted: Thu Jan 26, 2012 1:40 pm    Post subject: Label bug or did I miss something? Reply with quote

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
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

Joined: 09 May 2003
Posts: 25952
Location: The netherlands

PostPosted: Thu Jan 26, 2012 2:35 pm    Post subject: Reply with quote

Code:

_infhp:

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
View user's profile Send private message MSN Messenger
Tearlow
Newbie cheater
Reputation: 0

Joined: 02 Dec 2009
Posts: 14

PostPosted: Thu Jan 26, 2012 3:57 pm    Post subject: Reply with quote

Dark Byte wrote:
Code:

_infhp:

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 Smile
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 112

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Fri Jan 27, 2012 2:28 am    Post subject: Reply with quote

But you can use

infhp+10:

without any problem.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Tearlow
Newbie cheater
Reputation: 0

Joined: 02 Dec 2009
Posts: 14

PostPosted: Fri Jan 27, 2012 4:33 am    Post subject: Reply with quote

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