0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

picoGym Exclusive writeup GDB baby step 4

Posted at

GDB baby step 4 (Reverse Engineering)

main calls a function that multiplies eax by a constant. The flag for this challenge is that constant in decimal base. If the constant you find is 0x1000, the flag will be picoCTF{4096}. Debug this.

添付ファイル
・debugger0_d

とりあえずgdbでアセンブリを確認。

0x000000000040112f <+19>:    mov    DWORD PTR [rbp-0x4],0x28e
0x0000000000401136 <+26>:    mov    DWORD PTR [rbp-0x8],0x0
0x000000000040113d <+33>:    mov    eax,DWORD PTR [rbp-0x4]
0x0000000000401140 <+36>:    mov    edi,eax
0x0000000000401142 <+38>:    call   0x401106 <func1>
0x0000000000401147 <+43>:    mov    DWORD PTR [rbp-0x8],eax
0x000000000040114a <+46>:    mov    eax,DWORD PTR [rbp-0x4]

を呼び出している。func1のアセンブリを確認。

0x0000000000401106 <+0>:     endbr64 
0x000000000040110a <+4>:     push   rbp
0x000000000040110b <+5>:     mov    rbp,rsp
0x000000000040110e <+8>:     mov    DWORD PTR [rbp-0x4],edi
0x0000000000401111 <+11>:    mov    eax,DWORD PTR [rbp-0x4]
0x0000000000401114 <+14>:    imul   eax,eax,0x3269
0x000000000040111a <+20>:    pop    rbp
0x000000000040111b <+21>:    ret

imal eax,eax,0x3269とあるので、フラグは0x3269を10進数にしたもの。

picoCTF{12905}

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?