ELFファイルpasscode2が与えられた。
entry関数から__libc_start_main関数がFUN_00101175関数などを引数として呼び出されていた。
FUN_00101175関数は以下のものである。
A ELF file passcode2 was given.
Decompiling via entry is calling the function __libc_start_main with the function FUN_00101175 as one of the arguments.
This is the function FUN_00101175:
この関数は、入力を読み込んだ後、その長さが0xbであり、かつ各バイトがlocal_124の対応する要素に0x2aをXORした値と一致していれば、
入力データをflag{と}の間に入れて出力するようであった。
objdumpでpasscode2を逆アセンブルすると、
以下のように-0x11c(%rbp)を起点とする領域のデータに0x2aをXORしているので、
local_124は-0x11c(%rbp)に対応することが読み取れた。
This function reads input and checks if the length of the input is 0xb and each bytes in the input are equal to the corresponding element oflocal_124, exclusive-ored with 0x2a.
If the input passes the check, it prints the input data between flag{ and }.
I disassembled passcode2 via objdump in local_124 corresponds to -0x11c(%rbp) because exclusive-or with 0x2a is calculated for
data starts from -0x11c(%rbp) like this:
さらに、以下の部分で-0x11c(%rbp)にデータを設定している。
Also, this part sets some data to -0x11c(%rbp).
このデータを読み取り、0x2aをXORすると、25.Sep.2014となった。
25.Sep.2014をflag{と}の間に入れることで、flagが得られた。
I read the data and applied exclusive-or with 0x2a. This resulted in 25.Sep.2014.
I obtained the flag by putting 25.Sep.2014 between flag{ and }.