# include <stdio.h>


int main(void) {

char buf[100] = { 0, };

char* promptResult = "buf => %s\n";

__asm {

mov eax, 0x6c6c6568; // little endian

lea edi, dword ptr[buf];

stos dword ptr[edi];


mov eax, 0x6f77206f; // little endian

stos dword ptr[edi];


mov eax, 0x646c72; // little endian

stos dword ptr[edi];

//////////////////////////////////////////

lea edi, dword ptr[buf];

push edi;

push promptResult;

call dword ptr[printf];

pop ebx;

pop ebx;


xor eax, eax;

leave;

retn;

}

}

'어셈블리' 카테고리의 다른 글

배열 어셈블리  (0) 2017.09.28
인라인 어셈 함수 인자 전달  (0) 2017.09.27
overflow 어셈블리  (0) 2017.09.27
어셈블리 크기 비교  (0) 2017.09.27
어셈블리 div  (0) 2017.09.26