  | 
				
				Cheat Engine The Official Site of Cheat Engine   
				
 
				 | 
			 
		 
		 
	
		| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		TheTompa How do I cheat?
  Reputation: 0
  Joined: 02 May 2012 Posts: 4
 
  | 
		
			
				 Posted: Sat Feb 13, 2016 1:22 am    Post subject: Works in AA, but not C++ | 
				       | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	 
	
		  | 
	 
	
		atom0s Moderator
  Reputation: 205
  Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
  | 
		
			
				 Posted: Sat Feb 13, 2016 3:06 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				mov ecx, [01411060] 
 
 
You need to make sure that you define things properly. This is not being treated as hex. _________________
 - Retired.  | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		TheTompa How do I cheat?
  Reputation: 0
  Joined: 02 May 2012 Posts: 4
 
  | 
		
			
				 Posted: Sat Feb 13, 2016 1:06 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				Nice catch, works perfectly now!
 
Thanks a ton! | 
			 
		  | 
	 
	
		| 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
  | 
   
 
		 |