목록picoCTF 2018/Reversing (5)
Bace

0x4와 0x2d를 넣어서 return 값이 뭐냐고 한다. 주어진 소스를 봤다. .intel_syntax noprefix .bits 32 .global asm2 asm2: push ebp mov ebp,esp sub esp,0x10 mov eax,DWORD PTR [ebp+0xc] --> 0x2d mov DWORD PTR [ebp-0x4],eax mov eax,DWORD PTR [ebp+0x8] --> 0x4 movDWORD PTR [ebp-0x8],eax jmp part_b part_a: add DWORD PTR [ebp-0x4],0x1 addDWORD PTR [ebp+0x8],0x64 part_b: cmp DWORD PTR [ebp+0x8],0x1d89 jle part_a mov eax,DWORD P..

0x76을 주었을 때 어떤 값이 return 되냐고 한다. 문제에서 주어진 소스 파일을 확인해보았다. .intel_syntax noprefix .bits 32 .global asm1 asm1: pushebp movebp,esp cmpDWORD PTR [ebp+0x8],0x98 jg part_a cmpDWORD PTR [ebp+0x8],0x8 jnepart_b moveax,DWORD PTR [ebp+0x8] addeax,0x3 jmppart_d part_a: cmpDWORD PTR [ebp+0x8],0x16 jnepart_c moveax,DWORD PTR [ebp+0x8] subeax,0x3 jmppart_d part_b: moveax,DWORD PTR [ebp+0x8] subeax,0x3 jmppart_..

0xc9와 0xb0을 넣었을 때 어떤 값이 return 되냐고 물어본다. flag는 기본형식과 다르며 0x로 시작한다고 한다. 주어진 소스를 확인해보면 ebx를 eax에 복사하는 것이 보인다. 따라서 flag는 0xb0이 된다. 0xb0