정올 어셈블 문제 - 배열관련 - 아직 완변하지 않음
어셈블리2018. 6. 14. 16:52
# include <stdio.h>
# define SIZE 10
int main(void)
{
char cData[SIZE] = { 0, };
char* Prompt = "%c ";
int temp = 0x0;
int indx = 0x0;
__asm
{
mov ecx, 0xa;
mov dword ptr[temp], ecx;
L:
// scanf("%c", cData + i);
mov dword ptr[temp], ecx;
mov ebx, dword ptr[indx];
lea edi, dword ptr[cData + ebx];
push edi;
push dword ptr[Prompt];
call dword ptr[scanf];
pop ebx;
pop ebx;
mov ebx, dword ptr[indx];
add ebx, 0x1;
mov dword ptr[indx], ebx;
//
mov ecx, dword ptr[temp];
loop L;
}
for (int i = 0; i < SIZE; i = i+2)
{
printf("%c", *(cData + i));
}
printf("\n");
}
'어셈블리' 카테고리의 다른 글
정올_문제_ (2) | 2018.06.22 |
---|---|
xor (0) | 2018.06.14 |
어셈블리 (push / pop) (0) | 2018.06.14 |
2018_05_30_키트리_침해대응 (0) | 2018.05.29 |
2018_05_30_01 (0) | 2018.05.29 |