LoginSignup
0
0

More than 3 years have passed since last update.

picoCTF 2019 asm1 - Points: 200

Posted at

問題

image.png

解いてみた

asm1(0x610)は何を返しますか?
つまり引数0x610でasm1を実行したときに最終的にeaxに何が入ってますか?という問題だと思います。
eaxが戻り値。

問題を見てみます。

image.png

<+0>:   push   ebp
<+1>:   mov    ebp,esp
<+3>:   cmp    DWORD PTR [ebp+0x8],0x3b9
<+10>:  jg     0x50f <asm1+34>

引数0x610と0x3b9を比較しています。
0x610>0x3b9なのでasm1+34にジャンプする。

<+34>:  cmp    DWORD PTR [ebp+0x8],0x477
<+41>:  jne    0x520 <asm1+51>

引数0x610と0x477を比較しています。
0x610≠0x477なのでasm1+51にジャンプする。

<+51>:  mov    eax,DWORD PTR [ebp+0x8]
<+54>:  add    eax,0x11
<+57>:  pop    ebp
<+58>:  ret    

eaxに引数0x610を代入。
eax(0x610)に0x11を足す。

これが答え。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0