1、結構體的創建及導入,結構體指針等。
以JniNativeInterface, DexHeader為例。
解析Dex的函數如下:

F5後如下:

File->load file->parser c header file,導入Dex.h
上圖中a1,右鍵轉成結構體,選擇dexheader,效果如下:

2、函數指針時的參數個數調整,不定參數等。
以__android_log_print為例,選中該函數。

Edit->operand type-> set operand type,修改參數如下:
int (__cdecl *)(int, char *, char *, char *, int *, int *),F5刷新後,效果如下:

3、thumb/arm模式的轉換
快捷鍵ALT +G,其中0x01是THUMB,0x00是ARM模式。一般4個字節ARM模式,兩個字節為THUMB模式,如:

4、函數被誤認為chunk,導致調用者函數多個入口。
以Java_by_Ericky_crackme01_JNI_EatRice為例,可以看到有兩個入口。

來到第一個入口的結束位置為BX跳轉指令, 應該讓他跳轉到第二個入口出,才正確。

所有首先要remove function tail,
選中,結尾處,然後edit->functions->remove function tail,效果:

然後再將跳轉指令BL,修改為Call,edit->others->force bl call,效果

5、C++RTTI,類名識別。
來的 JNI_OnLoad處

sub_A558為構造函數。

可以得在該函數名為9ArtLoader,

6、創建函數,設定函數結尾地址。
F5,效果如下:

解決辦法,按P,再F5。如果P沒有效果,則可以選中後再按P。
7、Elf的修復,內存dump該so及其以來文件,然後修改dump出來的基址,File-->LoadFile-->binary file。
dump命令為:
dd if=/proc/1935/mem of=/sdcard/alimsc4 skip=1578049536 ibs=1 count=3993600
8、數據復制、patch。
選中數據,然後edit->export data,即可

9、腳本,idc,IDAPython
http://magiclantern.wikia.com/wiki/IDAPython/intro
http://drops.wooyun.org/tips/11849
http://drops.wooyun.org/tips/12060
10、lsof查看被刪除的文件,cat從內存中得到被刪除的文件
root@android:/ # lsof |busybox grep com.sxiaoao.car3d3
system_se 523 system 298 /data/app/com.sxiaoao.car3d3-2.apk
com.sxiao 10370 u0_a65 44 /data/data/com.sxiaoao.car3d3/files/app_sdk103700_.jar (deleted)
com.sxiao 10370 u0_a65 48 /data/app/com.sxiaoao.car3d3-2.apk
com.sxiao 10370 u0_a65 49 /data/app/com.sxiaoao.car3d3-2.apk
10370是進程號 44是打開文件的fd 文件fd映射在/prop/pid/fd裡面
用cat命令把文件拷貝出來
1|root@android:/ # cat /proc/10370/fd/44 > /data/local/tmp/test.jar
11、arm指令模擬器
12、為什麼不能F5, 不能全信F5