ELFファイルが与えられた。
main関数があった。
A ELF file was given.
Decompiling the ELF file via main.
この関数は、以下の処理をしていた。
fgets関数で入力を読み取る。checkのデータをmemfrob関数で処理したものと比較する。
memfrob関数について調べたところ、各バイトに42をXORする関数のようである。
Man page of MEMFROB
さらに、checkの内容も、Ghidraの表示を参考にELFファイル中から発見することができた。
これらの情報を用い、以下のプログラムでflagを求めた。
This function does:
fgets.check processed via the function memfrob.
I studied about the function memfrob and found that the function takes exclusive-or of each bytes wth 42.
memfrob(3) - Linux manual page
Also I found the contents of check from the ELF file, referring to what Ghidra displays.
Using these information, I obtained the flag via this program: