BYTE ToExecute[] = { 0xEB, 0xFE }; // infinite loop
__asm{
lea eax, ToExecute
jmp eax ;; call eax
}
lea rax, Some_64bit_offset call rax ; jmp rax
int return1(){ return 1;}
Return1 Proc mov eax, 1 ret Return1 endp call Return1 ; not-inline
mov eax, 1 ;; inline
typedef int (__stdcall *fMyFunction)(void); //similar to int __stdcall function(void) BYTE *pData = (BYTE*)"\xDE\xAD\xBE\xEF"; //functions data fMyFunction MyFunction = (fMyFunction)pData; //cast the data pointer into a function pointer. MyFunction(); //call the function.