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?

picoCTF 2019 writeup B1ll_Gat35

Last updated at Posted at 2025-12-18

B1ll_Gat35 (Reverse Engineering)

Can you reverse this Windows Binary?

添付ファイル
・win-exec-1.exe

とりあえず実行する。

$ ./win-exec-1.exe
Input a number between 1 and 5 digits: 3
Initializing...
Enter the correct key to get the access codes: 39393939
Incorrect key. Try again.

stringsコマンドで確認したところ、フラグフォーマットがPICOCTF{...}となっていた。

C:\Users\abush\Desktop\pico-win-problems\win-exec-1.pdb
%llu
The key is:
%s%s
%llu
PICOCTF{These are the access codes to the vault:
%s%s%s
Input a number between 1 and 5 digits:
Number too big. Try again.
Initializing...
Enter the correct key to get the access codes:
Incorrect key. Try again.
Correct input. Printing flag:

Ollydbgを使って解析する。

$ file win-exec-1.exe
win-exec-1.exe: PE32 executable (console) Intel 80386, for MS Windows

"Input a number between 1 and 5 digits:"を出力するあたりにブレイクポイントを設定し、その後はステップ実行する。
stringsコマンドの結果より、"The key is:"でkeyが出力されることが分かる。
1で初期化して、どこかに出力されるはずのkeyを探して入力すれば、フラグが出てくるはずである。

image.png
初期化処理が終わったあたりでメモリダンプ画面に"The key is: 4253360"と出てきた。
"Enter the correct key to get the access codes:"のところで入力する。ただし、必要なのはkeyではなくaccess codesなのでThe key is: 4253360と入力してみる。

image.png

フラグが得られた。

PICOCTF{These are the access codes to the vault: 1063340}

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?