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 


Question: How too wildcard aobscan restore original code?

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

Joined: 08 Sep 2008
Posts: 15
Location: The Netherlands

PostPosted: Tue Dec 10, 2013 12:48 am    Post subject: Question: How too wildcard aobscan restore original code? Reply with quote

Well for a certain game I play I made an auto assembly script that searches for the vision value (using a aobscan wildcard) and changes it to a value (-15) to raise the sight of the character/race (it's a race that sees more with less vision).

But since I don't know the Original value of the vision that the character has and you cannot (or atleast I have not found out how, google has not told me as well Sad)

(sorry about this freaking ugly code I'm kind off new to aobscan)
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
aobscan(_vision2,00 00 00 00 FF FF 00 02 ?? 00 00 00 05 00 00 00 0D )
label(vision2)
registersymbol(vision2)
_vision2:
vision2:
db 00 00 00 00 FF FF 00 02 F1 FF FF FF F3 FF FF FF 0D
 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
aobscan(_vision2,00 00 00 00 FF FF 00 02 F1 FF FF FF F3 FF FF FF 0D )
label(vision2)
_vision2:
vision2:
db 00 00 00 00 FF FF 00 02 03 00 00 00 05 00 00 00 0D
unregistersymbol(vision2)

This does work however:

My question about this is, is it possible to make cheatengine or autoassembly know what the wildcard or complete first scan aobscan code (DB that I search for) was so it can restore it to the value it was before it was changed? I mean the way I do it now is just unregistering the symbol and changing the value back to 3 and once I switch area's ingame the value restores itself to what it should be, however I'm looking for a way to restore the value to what it was before the change (if that is possible).

Thanks for the help I would also appreciate it if there are any tutorials about this to toss them out to me (I haven't been able to found them unforunatly). Like I said I'm kind of new to the aobscan scene however so far I'm having more fun with it than searching for pointers so I'm looking to be able to do more with it (as the code will not likely break on game updates and stuff like that, steam anyone).
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Dec 10, 2013 6:53 am    Post subject: Reply with quote

You can use readmem(address, size) for this

E.g.:
Code:

[Enable]
Alloc(originalbytes, 17)
Registersymbol(originalbytes)
Aobscan(something, 11 22 33 44 55 66 ?? ?? ?? ?? bb cc dd ee ff 00 11)
Registersymbol(something)

originalbytes:
Readmem(something, 17)

something+6:
db 77 88 99 aa

[Disable]
Something:
Readmem(originalbytes, 17)


Unregistersymbol(originalbytes)
Unregistersymbol(something)
Dealloc(originalbytes)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Barrin
Newbie cheater
Reputation: 0

Joined: 08 Sep 2008
Posts: 15
Location: The Netherlands

PostPosted: Tue Dec 10, 2013 7:40 am    Post subject: Reply with quote

So if I look at that example it would become something like (according to the above example and the assembly I gave:
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
Alloc(originalbytes, 17)
Registersymbol(originalbytes)
aobscan(vision, 00 00 00 00 FF FF 00 02 ?? 00 00 00 05 00 00 00 0D)
registersymbol(vision)

originalbytes:
Readmem(vision, 17)

vision+8:
db F1 FF FF FF F3 FF FF FF
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
Vision:
Readmem(originalbytes, 17)

Unregistersymbol(originalbytes)
Unregistersymbol(vision)
Dealloc(originalbytes)


I think that I need to alloc vision as well however somehow as I get a, Not all code is injectable. Error on Line 9 (Readmem( 00000000, 17)): The memory at 00000000 could not be fully read) Are you sure you wan't to edit it to this. That error makes me think it does not know what the heck the either the originalbytes or vision are which is my assumption again.

I could also be I'm way over my head for this still. I do however want to thank you for the readmem suggestion (now I only need to figure how to properly use this). I did see this in some topics but had no idea how it could be applied with a normal change value.

edit: forgot the value should starts with an index of 0 while I read a topic over that today, edited code again....
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Dec 10, 2013 9:06 am    Post subject: Reply with quote

I can't test it here right now, so there can be some errors in my script (e.g. don't put a space between the comma in aobscan)

Also make sure you use ce 6.3

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Barrin
Newbie cheater
Reputation: 0

Joined: 08 Sep 2008
Posts: 15
Location: The Netherlands

PostPosted: Tue Dec 10, 2013 10:21 am    Post subject: Reply with quote

Dark Byte wrote:
I can't test it here right now, so there can be some errors in my script (e.g. don't put a space between the comma in aobscan)

Also make sure you use ce 6.3


Don't worry about it to much tho I mean I'm only learning (am using CE 6.3) so I'll fiddle about with the script a bit in the hope of getting it to work eventually. If I do I'll post here again (or update this post with the assembly that is working). It wouldn't even be that much of a problem if I played one of the 2 other races (where vision needs to register positivly so I don't need to replace the wildcard with F1 FF FF FF F3 FF FF FF to get a value of -15 or something like that).

Edit:
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
Alloc(originalbytes, 22)
Registersymbol(originalbytes)
aobscan(vision,FF FF 00 ?? ?? 00 00 00 ?? 00 00 00 0D 00 FF FF FF FF FF FF FF FF)
registersymbol(vision)

originalbytes:
Readmem(vision, 22)

vision+4:
db E7 FF FF FF E9 FF FF FF

[DISABLE]
//code from here till the end of the code will be used to disable the cheat
Vision:
Readmem(originalbytes, 22)

Unregistersymbol(originalbytes)
Unregistersymbol(vision)
Dealloc(originalbytes)

Still gives the error but does restore the address to how it should be (when disabled) and does modify the address to the specified value (when enabled) in the script (so like you said the comma in the aobscan *stupid mistake* was a error in this script).

This does makes me wonder tho why Not all code is injectable. Error on Line 9 (Readmem( 00000000, 17)): The memory at 00000000 could not be fully read) Are you sure you wan't to edit it to this. appears when I okay the auto-assembly script.

Edit2:
Apperantly the 05 also changes when the value is 0 so I made that a wildcard as well, now the script should work no matter what the value is on starting the game (depending on equipment you wear).

Edit3:
Apperantly the code I had at the start at first changed so yeah I understand why readmem got errors on finding that updated the table again for that. However now I get a not all code is injectable error, this is because the new script does not work, ah well back to the drawing board Razz. Aka find out what part of the memory bytes are actually static so I can place a correct db BYTES out of that...

So you did teach me to use readmem correctly I however was using a too large (or not static enough) string to edit the address I will fix this sometime if I have time Very Happy. I would rep you if I could (but I can't) you have my sincere thanks since I did learn something about Cheat Engine again Smile.

Edit4:
I should probably use the address I can nop too modify vision... (the address that when nopped totally disables vision *aka vision is always 0*). it's time to hit the books again on auto assembly, memory allocation and modification using auto assembly. Can probably find this in the tutorial section.

Edit5:
Modified the code again, just added 2 more wildcards, seems like it should always work like this. Again will only be able to tell if it works after further testing but I have more hope in it working than before. Even though it's still telling me Not all code is injectable. Error on Line 9 (Readmem( 00000000, 22)): The memory at 00000000 could not be fully read) Are you sure you wan't to edit it to this. Do not give me such a message if the AA script works and injects without problems as well as restores without problems.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Dec 11, 2013 7:16 am    Post subject: Reply with quote

Just ignore that message that it's unreadable if activating/deactivating works. It's just a syntax check, and because of that the result of aobscan is skipped, but looks like readmem isn't skipped, so it complains about that. (As long as the actual activation works it's fine)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message 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