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 


Auto Assembler doesnt do lea instructions?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Corruptor
Advanced Cheater
Reputation: 3

Joined: 10 Aug 2011
Posts: 84

PostPosted: Sun May 31, 2026 8:00 am    Post subject: Auto Assembler doesnt do lea instructions? Reply with quote

32 bit application, im on 7.6.

Tried to do a small injection to gather some info, but it keeps showing errors.

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
globalalloc(scratchpad,4096)
label(data_array)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
// id in ESI
// value to enqueue in [esp+c]
mov eax, [scratchpad]
lea edi, [data_array + eax * 8]
mov [edi], esi
mov esi, [esp+c]
mov [edi+4], esi
//inc counter
inc eax
cmp eax, 510
jbe originalcode
xor eax,eax
mov [scratchpad], eax

originalcode:
pop edi
and eax,esi
pop esi
ret

exit:
jmp returnhere

scratchpad:
db 00 00 00 00
data_array:
db 00 00 00 00

"X2.exe"+AA939:
jmp newmem
returnhere:

[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
dealloc(scratchpad)
"X2.exe"+AA939:
db 5F 23 C6 5E C3
//pop edi
//and eax,esi
//pop esi
//ret


the error pops up in the lea instruction in line 14, which looks fine to me.
oddly enough, i cant seem to get any lea instruction to get accepted exept for the most barebone ones. e.g just
Code:
lea edi, [edi + eax]

gets rejected,
Code:
lea edi, [edi + 4]

gets rejected, i have to go all the way down to
Code:
lea edi, [edi]

before it gets accepted. Im fairly certain these are legal instructions, online assemblers eat them too. Whats going on here?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Sun May 31, 2026 8:48 am    Post subject: Reply with quote

try removing the extra spaces
_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corruptor
Advanced Cheater
Reputation: 3

Joined: 10 Aug 2011
Posts: 84

PostPosted: Sun May 31, 2026 9:08 am    Post subject: Reply with quote

holy shit it worked. now i feel silly. Embarassed
thank you for the quick reply.
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