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 


AA Script - Store values

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Avoider
How do I cheat?
Reputation: 0

Joined: 10 Jul 2014
Posts: 6

PostPosted: Thu Jul 10, 2014 10:40 am    Post subject: AA Script - Store values Reply with quote

edit*
Thanks, but i already solved this problem. Smile




Hello, i searched the entire day for a solution and did not find anything, so i need your help.

I started 'learning' AA Script coding (and assembler) a few days ago and i do not get the whole registers stuff.

i have read samuri25404's guide 'A Very In Depth Tutorial on Auto Assembler'
which explains the use of EAX/AX and so on very well, but it does not explains how to use your 'own registers' to store information in a way i can understand, so i hope you can clarify and explain it a bit more.


Here is an example:

I want to change the durability (which is stored as int32 (4 bytes)) of an item to 100%.
To achieve this i subtract 100, stored in my own register, by the current durability to get the missing percent.

My problem is, that if i want to save my script (press ok) there are compiler errors:

Code:
Not all code is injectable. (Error in line 18 (sub 00000000,[ecx+1C]): This instruction can't be compiled)


I know that this is caused, because i want to access an empty register/variable (whatever this is called)
So obviously it is my own register, which causes this error and i guess it just pointing to the 'null'-address, right? (unassigned pointer?)

But i don't get what i have done wrong, i hope you can explain this whole 'own register'-stuff to me.


My code example:

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)

registersymbol(durability)
alloc(durability,4)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
//own code
mov [durability],64 //set durability variable to 100 (64 in hex)
sub durability,[ecx+1C] //subtract the current durability from the 100
mov [esp+04],durability //store the missing durability to 100%, to the address, which will be used to apply durability lose

//original code
mov edx,[esp+04] //The game puts the durability lose to the register 'edx'
push esi //doesn't matter for me, but cheat engine copied it in here

exit:
jmp returnhere

"unepic.exe"+20305:
jmp newmem
returnhere:


[DISABLE]
//code from here till the end of the code will be used to disable the cheat
unregistersymbol(durability)

dealloc(newmem)
dealloc(durability)

"unepic.exe"+20305:
mov edx,[esp+04]
push esi
//Alt: db 8B 54 24 04 56



Thanks in advance
Avoider
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