Asm-3 PicoCTF Challenge
Reverse-Engineering PicoCTF's come follow along and reverse some as well
Asm-3 PicoCTF Challenge
Challenge
Test.S :
1
2
3
4
5
6
7
8
9
10
11
12
asm3:
<+0>: push ebp
<+1>: mov ebp,esp
<+3>: xor eax,eax
<+5>: mov ah,BYTE PTR [ebp+0x9]
<+8>: shl ax,0x10
<+12>: sub al,BYTE PTR [ebp+0xe]
<+15>: add ah,BYTE PTR [ebp+0xf]
<+18>: xor ax,WORD PTR [ebp+0x12]
<+22>: nop
<+23>: pop ebp
<+24>: ret
Cleaning The GAS Up
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.intel_syntax noprefix
.global asm3
/* Needed To Clean This Up */
asm3:
push ebp
mov ebp,esp
xor eax,eax
mov ah,BYTE PTR [ebp+0x9]
shl ax,0x10
sub al,BYTE PTR [ebp+0xe]
add ah,BYTE PTR [ebp+0xf]
xor ax,WORD PTR [ebp+0x12]
nop
pop ebp
ret
C program to retrieve the flag!
1
2
3
4
5
6
7
8
#include <stdio.h>
int asm3(int, int, int);
int main(int argc, char* argv[]) {
printf("0x%x\n", asm3(0xd2c26416,0xe6cf51f0,0xe54409d5));
return 0;
}
Badda Bing Badda Boo
This post is licensed under CC BY 4.0 by the author.