Assembly In VC++

I am using the inline assembly function of C++ . Although less powerful but is very useful in for beginners writing assembly code.
I am learning assembly language because I want to know whether a code is running inside virtual machine like VM player or not. I will use the vm-Backdoor for this purpose. Vm-BackDoor it the way a virtual machine Communicates with the host system.



;name the file test.c
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
#include

int power2(int num,int power);

int main(void)
{
printf ("# times 2 to the power of 5 is %d\n",power2(3,5));
}

int power2(int num,int power)
{
_asm
{
mov eax, num
mov ecx, power
shl eax, cl
}
}

;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
;compile using vc++ command line cl test.c

0 comments:

Post a Comment