asm4
Problem
What will asm4("picoCTF_376ee") return? Submit the flag as a hexadecimal value (starting with '0x'). NOTE: Your submission for this question will NOT be in the normal flag format. Source located in the directory at /problems/asm4_2_0932017a5f5efe2bc813afd0fe0603aa.
Solution
Let's look at the source:
Since this challenge is more complicated than challenges
asm1
andasm2
, we will compile and run it using a different method thanasm3
.We can compile the function into a C file using the following syntax (source):
Note that jumps were ported to use labels, the input parameter was renamed and the frame setup and teardown were already taken care of by the compiler and therefore commented out in the assembly. The nops were inserted in order to make it easier to locate the inline assembly with a debugger or disassembler. An alternative was to use a dedicated assembly file as we did in
asm3
.Compile by running
gcc -masm=intel -m32 solve.c -o solve
.Run the solve.c file with
./solve
Flag
0x24d
Last updated