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

undefined reference to `__mmap2' in mmap.c #41

Open
mahmouxd opened this issue Apr 14, 2017 · 1 comment
Open

undefined reference to `__mmap2' in mmap.c #41

mahmouxd opened this issue Apr 14, 2017 · 1 comment

Comments

@mahmouxd
Copy link

When building, all the files get compiled (of course with some tweaking). But, the linker gives this error:

./obj/local/arm64-v8a/libexploit.a(mmap.o): In function `mmap':
/root/Dev/android_run_root_shell/libexploit/mmap.c:55: undefined reference to `__mmap2'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
@dadreamer
Copy link

Well, I ran into this today also. It seems that the recent NDK packages already have mmap definition. So do the following:

  1. comment this line:
    extern void* __mmap2(void*, size_t, int, int, int, size_t);
  2. rename mmap func in mmap.c to something, say, mmap_tmp;
  3. change __mmap2 to mmap2 in the func's body.
    Or you might comment the whole func. It's allowed 'cause the exploit would stick to native mmap instead of custom one.

That's not the last error there so get ready to fix the things after. ;)

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

No branches or pull requests

2 participants