让我们假设手机是根的,并且可以安装arm二进制文件。我可以使用Android Studio与printf
输出控制台二进制文件吗?
是否有一个循序渐进的指南来编写和编译这样的二进制文件与传统的C程序int main()
与Android Studio或Android.mk
文件的创建
GitHub上有一些项目这样做:
https://github.com/strazzere/android-unpacker/tree/master/native-unpacker
和
https://github.com/Shabbypenguin/DexPwn
#include <stdio.h>
int main() {
printf("Hello, worldn");
return 0;
}
:
~/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-linux-android21 helloworld.c -o helloworld
adb push helloworld /data/local/tmp/helloworld
adb shell /data/local/tmp/helloworld