Remove specific library in Mach-O and ELF binaries (using LIEF library)
Budget: $30 – $250 USD
Hello,
1) I need a specific function in C/C++ (using MSVC 2022)
2) The function will receive a path to a Mach-O or ELF file and a library name:
RemoveLibrary(std::string path_file, std::string library_name);
3) The function will remove the dynamic linking with "library_name". Of course, all the code that calls that library has been already patched, so the library is not required anymore. So it can be deleted. After that, the application can be executed normally and the removed (dynamic) library is not required anymore
You can use the LIEF library to parse/manipulate the ELF and Mach-O file. I think that LIEF has already functions to remove a library or help you with that.
For your testing, I have created some simple files which links with two dynamic libraries "mylib.so and mylib2.so". So you can test it, removing any of those libraries.
In the compiled files that I ship (main_elf and main_macho) you would need to patch (NOP) the instruction that calls the function in the library that is going to be removed ("call MyLibFunction"), so you can test your function to remove a specific library to link and run the output file.
If you have any questions, let me know!
Thanks!
A.
1) I need a specific function in C/C++ (using MSVC 2022)
2) The function will receive a path to a Mach-O or ELF file and a library name:
RemoveLibrary(std::string path_file, std::string library_name);
3) The function will remove the dynamic linking with "library_name". Of course, all the code that calls that library has been already patched, so the library is not required anymore. So it can be deleted. After that, the application can be executed normally and the removed (dynamic) library is not required anymore
You can use the LIEF library to parse/manipulate the ELF and Mach-O file. I think that LIEF has already functions to remove a library or help you with that.
For your testing, I have created some simple files which links with two dynamic libraries "mylib.so and mylib2.so". So you can test it, removing any of those libraries.
In the compiled files that I ship (main_elf and main_macho) you would need to patch (NOP) the instruction that calls the function in the library that is going to be removed ("call MyLibFunction"), so you can test your function to remove a specific library to link and run the output file.
If you have any questions, let me know!
Thanks!
A.