News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

inline ASM to C++ code

Started by flashcoder, May 01, 2017, 11:45:44 PM

Previous topic - Next topic

flashcoder

Hello friends,

already that inline asm not is compatible with x64 compiler on MS Visual Studio ( and some others IDEs ), i'm needing pass this asm code below
to C++ to be compatible with both compilers ( x32 and x64 ).


__declspec(naked) void DllCall_stub(HMODULE hMod)
{
   _asm
   {
      push 0
      push 1
      push [esp+0Ch]
      mov eax, 0xDEADBEEF   
      call eax
      ret
   }
}

__declspec(naked) void DC_stubend(void) { }


The asm code above is part of a Manual Mapping injector ( attached in this topic) that compiles with success ( only to x86, because of this inline asm  :(  )

Someone could help me please?

thank you to all.

hutch--

Flash,

As far as I know 64 bit Microsoft C/C++ does not support inline assembler. You will need to write the assembler code with an assembler. You can use ML64 or if you are familiar with them, any of the 64 bit capable Watcom clones. If you do this in both 32 and 64 bit, you only need to swap the assembler module at build.

newrobert

write xxx.asm source code will let assembler more pure .

flashcoder

Quote from: newrobert on May 02, 2017, 07:58:00 AM
write xxx.asm source code will let assembler more pure .

@newrobert, ok.

Now how must be the structure of .asm file with this code above?

Could give a example?