DarkCTF 2020: Rev/so_much

Rev/so_much

207 points

strcmp printf File

Solution

I’ve used ghidra to have a look into the decompiled code.

so much1

After quick examination I’ve came to conclusion that the code base on strcmp function. I’ve decided to override this function with my own implementation.

Prepared below code:

#define _GNU_SOURCE
int strcmp ( char * str1, char * str2 )  
{  
return 0;  
}
int main()  
{  
return 0;  
}

Compiled it and executed the program with LD_PRELOAD.

gcc -ldl -fpic -nostartfiles -shared mystrcmp.c -o mystrcmp.so  
sudo LD_PRELOAD=./mystrcmp.so ./so_much anything

so much2

darkCTF{w0ws0m4ny_funct10ns}

Privacy Policy
luc © 2021