package dt.capstone_arm64;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import capstone.Capstone;
/**
* 示例: 使用capstone反汇编引擎反编译64位汇编代码;
* <p>
* <p>
* 程序输出:
* CAPSTONE-X86-64: =========== X86-64 反汇编引擎使用 =========开始==
* CAPSTONE-X86-64: 4096 push rbp
* CAPSTONE-X86-64: 4097 mov rax, qword ptr [rip + 0x13b8]
* CAPSTONE-X86-64: =========== X86-64 反汇编引擎使用 =========结束==
* CAPSTONE-ARM-64: =========== ARM-64 反汇编引擎使用 =========开始==
* CAPSTONE-ARM-64: 4096 ldr x1, [x20]
* CAPSTONE-ARM-64: 4100 mov x0, x19
* CAPSTONE-ARM-64: 4104 bl #0xccc
* CAPSTONE-ARM-64: 4108 movz w0, #0xa
* CAPSTONE-ARM-64: =========== ARM-64 反汇编引擎使用 =========结束==
*/
public class MainActivity extends AppCompatActivity {
/***********************************************************************************************
[ARM-64 汇编代码]
.text:0000000000001164 81 02 40 F9 LDR X1, [X20]
.text:0000000000001168 E0 03 13 AA MOV X0, X19
.text:000000000000116C 31 FF FF 97 BL sub_E30
.text:0000000000001170 40 01 80 52 MOV W0, #0xA
**********************************************************************************************/
private byte[] ARM64_CODE = {(byte) 0x81, 0x02, 0x40, (byte) 0xF9, (byte) 0xe0, 0x03, 0x13, (byte) 0xAA,
0x31, (byte) 0xFF, (byte) 0xFF, (byte) 0x97, 0x40, 0x01, (byte) 0x80, 0x52};
private byte[] X86_CODE = {0x55, 0x48, (byte) 0x8b, 0x05, (byte) 0xb8, 0x13, 0x00, 0x00};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* [X86-64 反汇编引擎使用] */
Capstone cs_x86 = new Capstone(Capstone.CS_ARCH_X86, Capstone.CS_MODE_64);
Capstone.CsInsn[] allInsn = cs_x86.disasm(X86_CODE, 0x1000);
Log.e("CAPSTONE-X86-64", "=========== X86-64 反汇编引擎使用 =========开始==");
for (int i = 0; i < allInsn.length; i++) {
Log.e("CAPSTONE-X86-64", allInsn[i].address + " " + allInsn[i].mnemonic + " " + allInsn[i].opStr);
}
Log.e("CAPSTONE-X86-64", "=========== X86-64 反汇编引擎使用 =========结束==");
/* [ARM-64 反汇编引擎使用] */
Capstone cs_arm64 = new Capstone(Capstone.CS_ARCH_ARM64, Capstone.CS_MODE_ARM);
Capstone.CsInsn[] allInsn_arm64 = cs_arm64.disasm(ARM64_CODE, 0x1000);
Log.e("CAPSTONE-ARM-64", "=========== ARM-64 反汇编引擎使用 =========开始==");
for (int i = 0; i < allInsn_arm64.length; i++) {
Log.e("CAPSTONE-ARM-64", allInsn_arm64[i].address + " " + allInsn_arm64[i].mnemonic + " " + allInsn_arm64[i].opStr);
}
Log.e("CAPSTONE-ARM-64", "=========== ARM-64 反汇编引擎使用 =========结束==");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
capstone_arm64.zip (79个子文件)
capstone_arm64
gradlew.bat 2KB
gradlew 5KB
gradle.properties 747B
.gradle
2.14.1
tasks
_app_compileDebugJavaWithJavac
localJarClasspathSnapshot
localJarClasspathSnapshot.bin 20KB
localJarClasspathSnapshot.lock 17B
localClassSetAnalysis
localClassSetAnalysis.lock 17B
localClassSetAnalysis.bin 21KB
taskArtifacts
fileHashes.bin 142KB
cache.properties.lock 17B
taskArtifacts.bin 61KB
fileSnapshotsToTreeSnapshotsIndex.bin 22KB
fileSnapshots.bin 785KB
cache.properties 31B
app
proguard-rules.pro 953B
src
main
res
mipmap-xxxhdpi
ic_launcher.png 10KB
ic_launcher_round.png 14KB
drawable
mipmap-hdpi
ic_launcher.png 3KB
ic_launcher_round.png 4KB
values
colors.xml 214B
strings.xml 80B
styles.xml 394B
mipmap-xxhdpi
ic_launcher.png 8KB
ic_launcher_round.png 10KB
mipmap-mdpi
ic_launcher.png 2KB
ic_launcher_round.png 2KB
mipmap-xhdpi
ic_launcher.png 5KB
ic_launcher_round.png 6KB
layout
activity_main.xml 809B
java
dt
capstone_arm64
MainActivity.java 3KB
AndroidManifest.xml 734B
app.iml 12KB
.gitignore 8B
build.gradle 1KB
libs
capstone.jar 110KB
arm64-v8a
libjnidispatch.so 100KB
libcapstone.so 3.09MB
jna.jar 1.04MB
gradle
wrapper
gradle-wrapper.jar 52KB
gradle-wrapper.properties 237B
.idea
gradle.xml 626B
runConfigurations.xml 564B
misc.xml 2KB
vcs.xml 167B
copyright
profiles_settings.xml 76B
modules.xml 365B
compiler.xml 686B
workspace.xml 164KB
libraries
javawriter_2_1_1.xml 330B
jsr305_2_0_1.xml 330B
support_annotations_25_3_1.xml 519B
support_v4_25_3_1.xml 420B
support_vector_drawable_25_3_1.xml 652B
rules_0_5.xml 562B
javax_annotation_api_1_2.xml 358B
runner_0_5.xml 567B
hamcrest_library_1_3.xml 342B
espresso_idling_resource_2_2_2.xml 694B
support_core_utils_25_3_1.xml 627B
jna.xml 209B
animated_vector_drawable_25_3_1.xml 657B
hamcrest_core_1_3.xml 526B
junit_4_12.xml 477B
support_compat_25_3_1.xml 607B
support_core_ui_25_3_1.xml 612B
appcompat_v7_25_3_1.xml 597B
capstone.xml 219B
support_media_compat_25_3_1.xml 637B
support_fragment_25_3_1.xml 617B
hamcrest_integration_1_3.xml 354B
constraint_layout_solver_1_0_0.xml 349B
espresso_core_2_2_2.xml 639B
constraint_layout_1_0_0.xml 460B
javax_inject_1.xml 324B
exposed_instrumentation_api_publish_0_5.xml 712B
capstone_arm64.iml 868B
.gitignore 127B
local.properties 522B
settings.gradle 16B
build.gradle 521B
共 79 条
- 1
资源评论
- CAINAIFA2020-06-29已经下载过的资源再次下载还要积分,真是坑
pinggle
- 粉丝: 353
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功