View previous topic :: View next topic |
Author |
Message |
CassiOwOpeia Newbie cheater
Reputation: 0
Joined: 29 Nov 2018 Posts: 18 Location: France
|
Posted: Thu Nov 29, 2018 12:03 pm Post subject: Problem with auto assemble float and double |
|
|
Hi all
I have a problem. For training I use auto assemble with Cheat Engine Tutorial.
Code: | [ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
mov [esi+00000494],(float)5000
originalcode:
//fstp dword ptr [esi+00000494]
exit:
jmp returnhere
01610006:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
01610006:
fstp dword ptr [esi+00000494]
//Alt: db D9 9E 94 04 00 00 |
I don't have problem ^^^^ with float, it work !
But with double I can't do it.
Code: | [ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(originalcode)
label(exit)
newmem: //this is allocated memory, you have read,write,execute access
mov [ebx+00000498],(double)5000
originalcode:
//fstp qword ptr [ebx+00000498]
exit:
jmp returnhere
"Tutorial-i386.exe"+24963:
jmp newmem
nop
returnhere:
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Tutorial-i386.exe"+24963:
fstp qword ptr [ebx+00000498]
//Alt: db DD 9B 98 04 00 00 |
If you can, please I would like to merge the two scripts
Thanks ^^
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Nov 29, 2018 1:38 pm Post subject: |
|
|
A double is 8 bytes, you are trying to store it into a 4 byte address. If the game doesn't make use of a double for that type, you can't force it to use one like that.
_________________
- Retired. |
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Thu Nov 29, 2018 5:52 pm Post subject: |
|
|
double is 8bytes long, and your process is 32bit so no imm64 operands.
CE will assemble "mov [ebx+00000498],(double)5000" as "00000000" thats why its not working.
double 5000 in hex is 40B3880000000000, and its stored in memory the way little-endian works.
either use FPU x87 instruction set, or use two MOV instructions. (remember to modify the offset and the source operand)
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
CassiOwOpeia Newbie cheater
Reputation: 0
Joined: 29 Nov 2018 Posts: 18 Location: France
|
Posted: Fri Nov 30, 2018 7:38 am Post subject: |
|
|
Thanks for the answer and if I write qword it work ?
|
|
Back to top |
|
 |
OldCheatEngineUser Whateven rank
Reputation: 20
Joined: 01 Feb 2016 Posts: 1586
|
Posted: Fri Nov 30, 2018 7:32 pm Post subject: |
|
|
TheFireAnubis wrote: | Thanks for the answer and if I write qword it work ? |
no qword for data movement instructions in 32bit processes, except FPU x87.
here are two examples:
Code: | mov dword ptr [ebx+00000498],00000000
mov dword ptr [ebx+0000049C],40B38800
originalcode:
fstp st(0) // you have to pop fpu register stack '0'
exit:
jmp returnhere |
Code: | label(value)
newmem:
fld qword ptr [value] // instead of loading whatever in [ebp-08], load whatever in "value"
originalcode:
// fld qword ptr [ebp-08] // replaced with "value"
// fsubr qword ptr [ebx+00000498]
exit:
jmp returnhere
value:
dq (double)5000.00 // value to be loaded |
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote: | i am a sweetheart. |
|
|
Back to top |
|
 |
|