dirtycow / dirtycow.github.io

Dirty COW
https://dirtycow.ninja
3.35k stars 940 forks source link

How do you compile this code please? Any example.. (Trying to compile for arm64-v8a) #47

Open droidvoider opened 7 years ago

droidvoider commented 7 years ago

Edit: Fairly certain this isn't for Android and won't compile as such.. gcc -pthread dirtyc0w.c -o dirtyc0w gcc -pthread -pie dirtyc0w.c -o dirtyc0w gcc -pthread -fpie dirtyc0w.c -o dirtyc0w gcc -pthread -pie -fpie dirtyc0w.c -o dirtyc0w (not executable: 64-bit ELF file)

Unless you know I'm wrong I believe this is designed for a different OS.

lxzh commented 6 years ago

gcc -o dirtyc0w dirtyc0w.c -lpthread

jobinrjohnson commented 6 years ago

You have to use a cross compiler inorder to compile for Android. When you compile it using gcc it will give you an amd64 binary not arm64. Both architectures are mutually exclusive and something built for arm64 won't work on the other and vice-versa. So you have to use a toolchain.

https://developer.android.com/ndk/guides/standalone_toolchain.html