2021年11月4日

FART脱壳机的使用与进阶(3)_FART重新编译去特征过x加密和数字壳

作者 huruwo

文件修改对比

下载AOSP 8.0.1的源码 和 虚拟机里面的源码进行对比

发现6个改动的文件分别如下:

核心改动相关文件目录

frameworks/base/core/java/android/app/ActivityThread.java

libcore/dalvik/src/main/java/dalvik/system/DexFile.java

art/runtime/art_method.cc

art/runtime/native/dalvik_system_DexFile.cc

art/runtime/native/java_lang_reflect_Method.cc

interpreter.cc

各自的作用如下

ActivityThread.java 启动fart线程 并调用主动修复

fartthread();

getClassField 等一系列方法 获取并反射调用

art_method.cc 方法调用做修复 codeItem

codeitem_end

DexFile.java 构建DexFile对象

dumpMethodCode

isBackedByOatFile

dalvik_system_DexFile 提供主动调用的方法

DexFile_dumpMethodCode

GetDexOptNeeded

java_lang_reflect_Method 提供反射调用的方法

jobject2ArtMethod

Method_getDefaultValue

interpreter.cc 另外一个Dex文件脱壳点

调用 dumpdexfilebyExecute 在
static inline JValue Execute{} 方法中

去掉FART相关特征

几个有点意思的检测点

去掉所有FART关键字

包括方法 包括路径里面的参数
比如经典的 data/fart 文件夹

避免启动闪退

去掉启动休眠自启动 留给

避免检测一些特征类主动调用导致的闪退

编译问题

******************************
You have tried to change the API from what has been previously approved.

To make these errors go away, you have two choices:
   1) You can add "@hide" javadoc comments to the methods, etc. listed in the
      errors above.

   2) You can update current.txt by executing the following command:
         make update-api

      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************

在新增的类头上新增
/ {@hide} /

注释即可

总结