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 


Works in AA, but not C++

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

Joined: 02 May 2012
Posts: 4

PostPosted: Sat Feb 13, 2016 1:22 am    Post subject: Works in AA, but not C++ Reply with quote

I got the following code in Auto Assemble which sends a packet:
(The address 004002B8 already contains my 2 byte packet. 0x48, 0x00)

Code:

    script=[[
        fullaccess(00400500,4)
        alloc(packet_send, 1024)
        CreateThread(packet_send)

        packet_send:
        pushad
        mov ecx,[01411060]
        push 02
        lea eax,[004002B8]
        push eax
        call 0048C210
        popad
        ret
    ]]
    autoAssemble(script)




Here's the C++ version of it:
Code:

   DWORD buffer_address = 0x4002B8;
   DWORD send_address = 0x048C210;

   __asm {
      pushad
      mov ecx, [01411060]
      push 02
      lea eax, [buffer_address]
      push eax
      call 0x048C210
      popad
      ret
   }




The script works fine in Auto Assemble, but in C++ nothing happens (Not even a crash)
I've checked the registers (EAX, EBP, ECX) and they're all correct. The send function is also called successfully.
Am I missing something?

Very grateful for help!
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Feb 13, 2016 3:06 am    Post subject: Reply with quote

mov ecx, [01411060]

You need to make sure that you define things properly. This is not being treated as hex.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
TheTompa
How do I cheat?
Reputation: 0

Joined: 02 May 2012
Posts: 4

PostPosted: Sat Feb 13, 2016 1:06 pm    Post subject: Reply with quote

Nice catch, works perfectly now!
Thanks a ton!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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