C语言 我可以在Android原生二进制文件中使用printf吗?



让我们假设手机是根的,并且可以安装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;
}

:

  1. ~/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-linux-android21 helloworld.c -o helloworld
  2. adb push helloworld /data/local/tmp/helloworld
  3. adb shell /data/local/tmp/helloworld

最新更新