VC++6.0 ASM코드를 직접 대입하는 방법
//ASM코드를 직접 대입하는 방법
/*
15: void test_asm()
16: {
00401050 push ebp
00401051 mov ebp,esp
00401053 sub esp,40h
00401056 push ebx
00401057 push esi
00401058 push edi
00401059 lea edi,[ebp-40h]
0040105C mov ecx,10h
00401061 mov eax,0CCCCCCCCh
00401066 rep stos dword ptr [edi]
17: __asm {randasm}
00401068 dec edx
00401069 inc ebx
0040106A dec ebx
18: dec_edx;
0040106B dec edx
19: dec_edx;
0040106C dec edx
20: }
0040106D pop edi
0040106E pop esi
0040106F pop ebx
00401070 add esp,40h
00401073 cmp ebp,esp
00401075 call __chkesp (00401740)
0040107A mov esp,ebp
0040107C pop ebp
0040107D ret
*/
#define dec_edx __asm _emit 0x4A
#define inc_ebx __asm _emit 0x43
#define dec_ebx __asm _emit 0x4B
#define randasm __asm _emit 0x4A __asm _emit 0x43 __asm _emit 0x4B
void test_asm()
{
//__asm {randasm}
dec_edx;
inc_ebx;
dec_ebx;
}