Let's get dynamic
Last updated
Was this helpful?
Last updated
Was this helpful?
Can you tell what this file is reading? chall.S
First, compile the program: gcc -g chall.S -o chall
. The -g
flag compiles with debugging symbols.
If we run the program and enter some text, we get Correct! You entered the flag.
, which doesn't seem correct.
I decompiled the chall
binary using Ghidra to look at a c representation. There is a memcmp
instruction which looks like it compares our input to the flag.
We can run the binary in gdb with gdb chall
to debug it. I placed a breakpoint at the memcmp
statement with b memcmp
and then ran the program with r
. We reach the breakpoint and now we can look at the source index and destination index registers, which are rsi
and rdi
respectively. We can view the source index as a string like so: printf "%s\n", $rsi
, which prints the flag.
GDB output:
picoCTF{dyn4m1c_4n4ly1s_1s_5up3r_us3ful_14bfa700}