1

Background

In my endeavor to RE my router, I'm trying to emulate a router's firmware inside a QEMU MIPS system. I have debian-mips installed to a virtual disk that runs just fine. Its a MIPS32 Big Endian system. I don't have any issue with the debian system. I have extracted the root file-system and uploaded it to the debian-mips system.

Issue

My issue is when I attempt to run any of the binaries from the router firmware:

root@debian-mips:~/firm# chroot . ./bin/busybox.old 
./bin/busybox.old: can't load library 'libcms_boardctl.so'

However, I know it's there:

root@debian-mips:~/firm# ls -l ./lib/public/
total 1512
-rwxrwxrwx 1 root root    7280 Jun 28 18:27 libcms_boardctl.so
-rwxrwxrwx 1 root root   11320 Jun 28 18:27 libcms_msg.so
-rwxrwxrwx 1 root root  148944 Jun 28 18:27 libcms_util.so
-rwxrwxrwx 1 root root 1083432 Jun 28 18:27 libcrypto.so.0.9.8
-rwxrwxrwx 1 root root  275712 Jun 28 18:27 libssl.so.0.9.8

Maybe my google-fu is lacking, but there is not much information on the internet about chrooting MIPS environments. Thank you for your time.

Edit add'l file info:

root@debian-mips:~/firm# file public/libcms_boardctl.so 
public/libcms_boardctl.so: ELF 32-bit MSB shared object, MIPS, MIPS32 version 1 (SYSV), dynamically linked, corrupted section header size
0

Well I'm not sure why this is the answer but inside /lib are two directories: ./lib/public and ./lib/private

Simply running the command cp -r ./lib/public/* ./lib/private/* ./lib will allow your binaries to function properly.

Hopefully this question will help anyone who comes across my issue in the future as I could not find another instance of this event occurring. If someone has more information why this happens please leave me a comment :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.