 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Apache81 Advanced Cheater
Reputation: 5
Joined: 19 Jun 2009 Posts: 69 Location: Somewhere in space !!!
|
Posted: Wed Aug 15, 2012 5:16 pm Post subject: Help wanted for assembler script variables |
|
|
Hi guys !!!
I need some help: I would like to assign to a variable the value I found for the base address that take to the pointer of the memory region I need to change.
I did something like this:
Code: | [ENABLE]
alloc(newmem,2048)
label(ptr)
registersymbol(ptr)
ptr: dd "filename.exe"+offset // in this case offset = DDEA3C
// all the rest of the code....
[DISABLE]
// all the original codes with the hack points
unregistersymbol(ptr)
dealloc(newmem) |
After that I've added manually 2 pointers in the table:
(1) "filename.exe"+offset + one offset (3d8)
(2) ptr + one offset (3d8)
The 1st address points to the correct memory location I need (1853de10) but the 2nd one points to another location (011dee14). As you can imagine I would like that the 2nd points to the same address of 1st.
What am I doing wrong?
I hope to be clear enough
Thanks
[EDIT]
Sorry I forgot to ask a thing: how can I find a guide with all the avaiable instruction (possibly with meaning and syntax of every function) for the assembly script laguage implemented in cheat engine?
For example I saw some script using the instruction assert (that's simple to guess what it does) and I'm wondering what others command can be used.
Thanks again  |
|
Back to top |
|
 |
jgoemat Master Cheater
Reputation: 23
Joined: 25 Sep 2011 Posts: 264
|
Posted: Wed Aug 15, 2012 8:12 pm Post subject: Wiki |
|
|
You can click on 'Gamehacking Wiki' from the main page and click on 'Cheat Engine' then 'Auto Assembler' to see most of them, I've written a couple of pages with examples. I've listed the ones I just found in the CE source below. I'm not sure exactly what you're trying to do, your code doesn't seem to be doing what you say or complete, but here's a couple of problems:
1) A label has to be on a line by itself, put the dd on a separate line
2) The dd line is thinking it is working with a string because of the quotes, you can either remove the quotes or give the address to another label
3) You never give a location to start assembling, I think you want to put 'newmem:' somewhere
Code: | [ENABLE]
alloc(newmem,2048)
label(ptr)
registersymbol(ptr)
label(addr)
"filename.exe"+DDEA3C: // auto-assembler current address now at 11DEA3C (if base 400000)
addr: // value for label addr set to current address of 11DEA3C
newmem: // auto-assembler current address now your allocated memory
ptr: // ptr label also is set to your allocated memory
dd addr // 11DEA3C stored at newmem, current address forward to newmem+4
dd filename.exe+DDEA3C // 11DEA3C stored at newmem+4, current address forward to newmem+8
|
ASSERT(address,array_of_bytes) - Stop script if bytes not found at address.
GLOBALALLOC(name,size) - If name is a symbol, verify the matched memory is allocated with the correct size or throw an error. If not a symbol, allocate memory and register name as a symbol.
INCLUDE(filename) - Include assembly language from another file
CREATETHREAD(address) - Start a new thread in the hacked process running at the specified address.
LOADLIBRARY(filename) - Inject a DLL into the hacked process (or use existing one) and register all functions so they can be used.
LUACALL(command) - Execute a LUA command.
READMEM(address,size) - Read size bytes from memory at the specified address and insert them as if they were DB bytes.
LOADBINARY(filename) - Load a file as binary data at the current location.
REGISTERSYMBOL(name) - Register the specified name as a global symbol that can be used in other scripts.
UNREGISTERSYMBOL(name) - Unregister the specified global symbol.
AOBSCAN(name,array_of_bytes) - Search the hacked process for the specified bytes and associate the address with the name as if it were a DEFINE.
DEFINE(name,value) - Define a symbol that will be replaced with another value (like a constant that can be used for readability)
LABEL(name) - Let the assembler know that name is a label and that you will have "name:" at exactly one location somehwere in the script to set the address.
ALLOC(name,size) - Allocate size bytes of memory and associate name with the address as if it were a label.
KALLOC(name,size) - I think the same as ALLOC, but uses different functions to allocate the memory?
DEALLOC(name) - Deallocate memory allocated with ALLOC or KALLOC. |
|
Back to top |
|
 |
Apache81 Advanced Cheater
Reputation: 5
Joined: 19 Jun 2009 Posts: 69 Location: Somewhere in space !!!
|
Posted: Thu Aug 16, 2012 3:48 am Post subject: |
|
|
Thank you for the reply and thanks for the auto assembler infos
Now I must apologize because I'm stupid and I've not understood your example.
You are right: I posted an incomplete "pseudo code" so it must be difficul to understand so I'm going to post the entire ptr related code.
It's for Fallout New Vegas latest Steam version.
Code: |
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
// allocazione della memoria per il code injection
alloc(newmem,2048) //2kb should be enough
// dichiarazione delle etichette
label(_playerPtr_)
// allocazione dei simboli esportati
registersymbol(_playerPtr_)
// definizione codice
newmem: //this is allocated memory, you have read,write,execute access
// variabili
_playerPtr_:
dd "FalloutNV.exe"+DDEA3C
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
// deallocazione dei simboli esportati
unregistersymbol(_playerPtr_)
// deallocazione del codice dalla memoria
dealloc(newmem) |
Sorry for the code commented in italian.
With this code I would like to store the base address that points to the player memory location in a variable that can be used in the table and in other scripts.
However I was not able to make the _playerPtr_ to store the address contained in the "FalloutNV.exe"+DDEA3C memory region.
I tried also to write:
Code: | _playerPtr_:
dd ["FalloutNV.exe"+DDEA3C] |
but I think is a syntax error also because the compiler refuses to process it.
Thanks again
P.S. If I will able to make the code work I'll post the entire table  |
|
Back to top |
|
 |
Apache81 Advanced Cheater
Reputation: 5
Joined: 19 Jun 2009 Posts: 69 Location: Somewhere in space !!!
|
Posted: Sat Aug 18, 2012 6:41 am Post subject: |
|
|
SOLVED !!!!!
Ok, it was not a script error but a pointer definition error: click on "Add Address Manually", enable the Pointer checkbox, add the offset(s) and in the space for address it is needed to write and not simply
My fault !!!! |
|
Back to top |
|
 |
|
|
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
|
|