Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ARMv7 dynamic binary errors #131

Closed
offlinemark opened this issue Apr 12, 2017 · 12 comments
Closed

Fix ARMv7 dynamic binary errors #131

offlinemark opened this issue Apr 12, 2017 · 12 comments
Assignees

Comments

@offlinemark
Copy link
Contributor

When a dynamic binary is run on my machine, mcore doesn't even reach main, but errors a message to stderr.

@offlinemark
Copy link
Contributor Author

once all these are merged, this should be fixed ^

@offlinemark
Copy link
Contributor Author

But it appears I still have an issue executing dynamic arm binaries that use my system ld.so, and not one i compiled for debugging :/. going to rename this issue to make it more specific

@offlinemark offlinemark changed the title Fix dynamic binary error with ld.so error message Fix ARMv7 dynamic binary errors Apr 26, 2017
@hugin hugin added the arm label Nov 6, 2017
@offlinemark
Copy link
Contributor Author

Bounty

@catenacyber
Copy link
Contributor

@Mossberg do you have binaries to test ? was this fixed by #514 ?

@offlinemark
Copy link
Contributor Author

thanks for checking in on this!

the below binary is a hello world arm dynamic binary compiled from

#include <stdio.h>
int main(int argc, const char *argv[])
{
    puts("Hello, world!");
    return 0;
}
arm-linux-gnueabi-gcc helloworld.c  -o hw.arm.dyn2

i am now able to get it to successfully run in manticore 0.1.9 using this cmd

[N] (tempenv-3eb6291213cd3) mark ubuntu /m/h/c/m/e/linux (master) ❯ manticore hw.arm.dyn2 --env LD_LIBRARY_PATH=/usr/arm-linux-gnueabi/lib
2018-06-07 14:46:32,125: [85553] m.manticore:INFO: Loading program hw.arm.dyn2
2018-06-07 14:47:33,049: [85553] m.manticore:INFO: Generated testcase No. 0 - Program finished with exit status: 0
2018-06-07 14:47:33,056: [85553] m.manticore:INFO: Results in /mnt/hgfs/code/manticore/examples/linux/mcore_nbjIDh
2018-06-07 14:47:33,056: [85553] m.manticore:INFO: Total time: 60.1371490955
[I] (tempenv-3eb6291213cd3) mark ubuntu /m/h/c/m/e/linux (master) ❯ cat mcore_nbjIDh/*.stdout
Hello, world!

on my system (ubuntu 16.04) that env variable is necessary for the arm ld.so to find the arm libc

it's not fast, but at least it works, i think we can close this issue now!

hw.arm.dyn2.zip

@catenacyber
Copy link
Contributor

@Mossberg did you have to use a new capstone after capstone-engine/capstone#1163 ?

@offlinemark
Copy link
Contributor Author

offlinemark commented Jun 7, 2018 via email

@catenacyber
Copy link
Contributor

Ok your ld.so must not use arm instruction ldrd with addressing mode 3 :-)

@offlinemark
Copy link
Contributor Author

what happens for you when you run the commands above on 0.1.9?

@catenacyber
Copy link
Contributor

Can you supply me the contents of your /usr/arm-linux-gnueabi/libdirectory ?

@offlinemark
Copy link
Contributor Author

lib.zip

@catenacyber
Copy link
Contributor

So, it works for me the same, I get to hello world :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants