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 


Problem in _asm

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun May 23, 2010 7:00 am    Post subject: Problem in _asm Reply with quote

Well, i tried to convert a script from AA to_Asm, it looks all fine to me, but it doesnt work

I debugged it many times in CE, but i can't fin it.

The CE script = working
http://pastebin.com/g3jkvMBF

My _asm script = NOT working
http://pastebin.com/eLfgpgZx

To me, they both look the same, but it's not. Could anyone help me out?


c++ _asm code

Code:
__declspec(naked) void __stdcall DupexASM()
{
        __asm
        {
         pushfd
         push eax
         push ecx
         mov eax,[Pointers::CharPid]
         test eax,eax
         je [NullPlat]
         mov eax,[eax+0x1160]
         lea ecx,[eax-0x0c]
         test ecx,ecx
         je [NullPlat]
         mov eax,[ecx+0x00000114]
         test eax,eax
         je [NullPlat]
         cmp [RunFlag],0x01
         je [DoVac]
         mov [Platform],eax
         inc [RunFlag]
         jmp [DoVac]

         DoVac:
         cmp esi,ecx
         je [Normal]
         mov edi,[Platform]
         jmp [Normal]

         NullPlat:
         mov [Platform],0x00
         mov [RunFlag],0x00
         jmp [Normal]

         Normal:
         pop ecx
         pop eax
         popfd
         mov [esi+0x00000114],edi
         //jmp [dwDupexRet]
         push dwDupexRet
         ret
      }
}


this is how i call it.

Code:
void DupexFunc()
{   
   DWORD DupexPro;
   VirtualProtect((LPVOID)dwDupex, 0x20, PAGE_EXECUTE_READWRITE, &DupexPro);
   
      *(BYTE*)dwDupex = 0xE9;
      *(DWORD*)(dwDupex + 1) = jmp(dwDupex, DupexASM);
      *(BYTE*)(dwDupex + 5) = 0x90;
}
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun May 23, 2010 11:26 am    Post subject: Re: Problem in _asm Reply with quote

Code:
mov eax,[Pointers::CharPid]

Bad.
Code:
je [NullPlat]
jmp [DoVac]
jmp [Normal]

wat... i don't even... You're lucky the compiler knows you're jumping to a label instead of the value at that label.

Generalizing, your code is disgusting.

_________________
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun May 23, 2010 1:24 pm    Post subject: Re: Problem in _asm Reply with quote

sponge wrote:
Code:
mov eax,[Pointers::CharPid]

Bad.
Code:
je [NullPlat]
jmp [DoVac]
jmp [Normal]

wat... i don't even... You're lucky the compiler knows you're jumping to a label instead of the value at that label.

Generalizing, your code is disgusting.


well at the first thing you say: You sugest to hardcode it, with the adress?

Second point is that i tried everything to make it work, but it did not work.

But the main problem is, it doesnt work
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