TCPサーバの接続情報と、ELFファイル flag_loader が与えられた。
flag_loader を
check1, check2, check3を順に実行する。sleep 関数を呼び出す。flag.txt の内容を出力する。
Information to connect to a TCP server and a ELF file flag_loader were given.
Decompiling flag_loader via
check1, check2, check3 in this order.sleep with the 32-bit product of the return values of the three functions.flag.txt.
以下のプログラムを用い、
各関数で die(); が呼ばれず、かつsleep関数に渡す積が小さくなるような入力を
ビットベクトルはそのまま比較すると符号付き整数とみなされるので、z3.BV2Int を用い、符号なし整数として比較するようにした。
I created this progran to obtain the input not to have the functions execute die(); and make the product to pass to the function sleep small via
Bit vectors are considered as signed when directly compared, so I used z3.BV2Int to have it compare them as unsigned integers.
I obtained the flag by entering the obtained data to the server.
このプログラムは、以下のように用いる。
check1関数に入力する文字列を求める。check1関数に渡した文字列と、check2関数で出力された数値を引数として実行し、check2関数に入力する数値を求める。check1関数に渡した文字列と、check2関数に入力した数値と、check3関数で出力された数値を引数として実行し、check3関数に入力する数値を求める。The usage of this program is:
check1.check1 and the integer printed from the function check2 to obtain integers to enter to the function check2.check1, the integers entered to the function check2, and the integer printed from the function check3 to obtain integers to enter to the function check3.