fd

Solution
Given a C file. Let's do some basic checking on it.


Based on the source code given, we can see there are 2 lines that are very interesting.
Line 10
atoi()function in C converts a string to an integerit takes
argv[1]as its argument and substract it with 0x1234 which is 4660 in decimalthe result is stored in variable
fd
Between the lines, we can see there is a read() function which takes file descriptor, some buffer and number of bytes. We need to make the file descriptor equals 0 so that we can write a string to the program and pass the if statement in Line 13.
So we input 4660 which then it will substract with 0x1234 and returns 0. Then write LETMEWIN to the program.

Yeah. Nice challenge btw 👍
Flag
mommy! I think I know what a file descriptor is!!
Last updated