fd
Mommy! what is a file descriptor in Linux?
Let's figure out how the program works.
The program checks to see if we have passed to arguments or not.
It the converts our second argument into an integer using atoi
, subtracts 0x1234 from it and then stores the value in fd
.
It then reads 32 bytes from the file descriptor fd
into the buffer buf
.
If the string that is read is "LETMEWIN", it cats out the flag.
Knowing all this, we have to provide the second argument such that when subtracted by 0x1234
the answer is 0
(0 is the file descriptor for STDIN).
0x1234
in decimal is 4660
.
When we provide the arguments the program reads input from STDIN.
Last updated