|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Invictus01 How do I cheat? Reputation: 0
Joined: 11 May 2023 Posts: 7
|
Posted: Thu May 11, 2023 11:37 am Post subject: Noob here, need help |
|
|
Hi, could anyone point out what's wrong with the attached code?
Code: | alloc(newmem,$1000)
registersymbol(newmem)
define(aaa,newmem+100)
registersymbol(aaa)
label(code)
label(return)
aaa:
dd 0
newmem:
mov [aaa],[esi+00001830] |
The error i'm getting is:
Quote: | mov [00000000+100],[esi+00001830] the instruction can't be compiled |
It seemed to work just fine in Stephen's tutorial on Lua scripting on YT.
Last edited by Invictus01 on Thu May 11, 2023 11:59 am; edited 1 time in total |
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1053 Location: 0x90
|
Posted: Thu May 11, 2023 11:54 am Post subject: |
|
|
You can't use a memory to memory instruction i.e.: mov [abc],[xyz]. You must use registers to store the value you want to move. Just to give you an idea, this is an example although it may not be exactly fit for your situation in the sense that I don't know the kind of values you're dealing with. It can vary whether it's an integer, float, double etc.... The below example is for an integer.
Code: |
push rbx
mov rbx,[xpos]
mov [esi+1830],rbx
pop rbx
|
|
|
Back to top |
|
|
Invictus01 How do I cheat? Reputation: 0
Joined: 11 May 2023 Posts: 7
|
Posted: Thu May 11, 2023 12:02 pm Post subject: |
|
|
LeFiXER wrote: | You can't use a memory to memory instruction i.e.: mov [abc],[xyz]. You must use registers to store the value you want to move. Just to give you an idea, this is an example although it may not be exactly fit for your situation in the sense that I don't know the kind of values you're dealing with. It can vary whether it's an integer, float, double etc.... The below example is for an integer.
Code: |
push rbx
mov rbx,[xpos]
mov [esi+1830],rbx
pop rbx
|
|
Thanks for your answer, I have corrected the code as I have submitted it with a mistake.
What I'm actually trying to achieve, is obtaining the value stored at [esi+00001830] (that should be an address) and store it in a global symbol for futher intended use.
So basically, I'm registering a symbol and trying to allocate memory within newmem for it, then store a value so that I can reference it from the cheat table.
LE: solved it ultimately by using alloc:
Code: | alloc(aaa,128)
registersymbol(aaa) |
The error I was getting was indeed due to the fact that I tried to make operations memory to memory, so I just took the value from the first register it was stored in.
Afterwards I can just reference the symbol in the cheat table using [aaa] as address, which takes the value from the address the symbol points to.
|
|
Back to top |
|
|
m0rc0m How do I cheat? Reputation: 0
Joined: 29 May 2023 Posts: 8 Location: sysadmin
|
Posted: Wed May 31, 2023 12:54 pm Post subject: |
|
|
You are accessing 2 memory locations in the same instruction, wich is invalid.
your code:
Code: |
mov [aaa],[esi+00001830] // here you are accessing the address at aaa and at esi+1830
|
Since memory to memory instructions are not valid i sugest using a register
Valid example:
Code: |
mov rax, [esi+1830]
mov [aaa], rax
| [/b]
_________________
The end may justify the means as long as there is something that justifies the end. |
|
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
|
|