本人小学文化自学的单片机编程,主要是LINUX下边用GCC-ARM-NONE-EABI这套工具链编写STM32汇编程序。 我是小白刚入单片机的门,看手机很火也想学但是不懂英语跟C语言啊,看英文手册全靠机械翻译。
为了练习下看汇编的能力随便到一个安卓机顶盒的文件里找个ELF可执行文件反汇编,然后写几个注释。
注意啊我才学汇编而且只有单片机编程经验没接触安卓跟IOS啊。。。
@
@ +-------------------------------------------------------------------------+
@ | This file has been generated by The Interactive Disassembler (IDA) |
@ | Copyright (c) 2014 Hex-Rays, <support@hex-rays.com> |
@ | License info: 48-3057-7374-2C |
@ | Zhou Tao, Jiangsu Australia Sinuo Network Technology Co., Ltd. |
@ +-------------------------------------------------------------------------+
@
@ Input MD5 : 340B1B1D5F8B6CF0CAE711109BBCC3A4
@ Input CRC32 : 8CC15A1A
@ ---------------------------------------------------------------------------
@ File Name : Z:\[韁輛秶]毞鏗+D6邧瞄+LetvUI+2.3+悕馨\system\bin\xcmidware
@ Format : ELF for ARM (Executable)
@ Imagebase : 8000
@ Interpreter '/system/bin/linker'
@ Needed Library 'libc.so'
@ Needed Library 'libutils.so'
@ Needed Library 'liblog.so'
@ Needed Library 'libcutils.so'
@ Needed Library 'libstdc++.so'
@ Needed Library 'libm.so'
@
@ EABI version: 5
@
@ Processor : ARM
@ ARM architecture: ARMv7-A
@ Target assembler: GNU assembler
@ Byte sex : Little endian
.syntax unified
@ ===========================================================================
@ Segment type: Pure code
.section .plt@ CODE
@ .org 0x91D8
.code 32
STR LR, [SP,#-4]!
LDR LR, =(_GLOBAL_OFFSET_TABLE_ - 0x91E8)
ADD LR, PC, LR @ _GLOBAL_OFFSET_TABLE_
LDR PC, [LR,#8]!
@ ---------------------------------------------------------------------------
off_91E8: .long _GLOBAL_OFFSET_TABLE_ - 0x91E8 @ DATA XREF: .plt:000091DCr @ 定义一个_GLOBAL_OFFSET_TABLE_的标签地址 0x91e8
@ [0000000C BYTES: COLLAPSED FUNCTION __libc_init. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION __android_log_print. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION puts. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION memcpy. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION sleep. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION printf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION memset. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_create. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION bsd_signal. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION exit. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION system. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION __stack_chk_fail. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION socket. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION bind. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION close. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION usleep. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION listen. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION malloc. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION accept. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_exit. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION recv. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strcpy. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION send. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strlen. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION snprintf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strcat. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION write. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION gettimeofday. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION open. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strncpy. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION ioctl. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION gethostbyname. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION connect. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION realloc. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strdup. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION __errno. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strerror. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fwrite. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION opendir. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION readdir. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION closedir. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION read. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fprintf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strcmp. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION free. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION memmove. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION calloc. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION inotify_init. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION inotify_add_watch. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION poll. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strtok. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION sprintf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION getaddrinfo. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fopen. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION freeaddrinfo. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fclose. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strstr. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION atoi. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION perror. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION getpid. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION sendto. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fseek. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION ftell. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fread. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION access. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION rewind. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION vfprintf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fputc. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_mutex_lock. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_mutex_unlock. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_mutex_init. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION getenv. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION clock_gettime. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_cond_timedwait. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_cond_wait. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_cond_broadcast. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_mutex_trylock. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pthread_cond_init. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION pipe. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION lseek. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strtol. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION stat. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION fscanf. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strncmp. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ [0000000C BYTES: COLLAPSED FUNCTION strchr. PRESS KEYPAD CTRL-"+" TO EXPAND]
@ ===========================================================================
@ Segment type: Pure code
.text @文本段
@ .org 0x95F0
.code 32
@ =============== S U B R O U T I N E =======================================
.globl start @定义程序起始点。 .globl 表示外部程序可以访问这个标签
start:
MOV R0, SP @ 把堆栈指针保存到R0
MOV R1, #0 @ R1清零
ADR R2, sub_9604 @ 把sub_9604的地址放到R2
ADR R3, off_9608 @ 把off_9608指向的地址放到R3
B __libc_init @ 跳转到__libc_init
@ End of function start
@ =============== S U B R O U T I N E =======================================
@ Attributes: thunk
sub_9604: @ DATA XREF: start+8o
B sub_148FC @ 跳转到sub_148FC
@ End of function sub_9604
@ ---------------------------------------------------------------------------
@ 下面是文字池,数据有时候反汇编不准
off_9608: .long unk_18000 @ DATA XREF: start+Co
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long unk_18018
.align 0x10
.byte 7
byte_9621: .byte 0x4B, 0, 0xBF @ DATA XREF: sub_9B0C+20o
@ .got:off_181A8o
.long 0x4907A200
.long 0xF84D2003
.long 0x189BED08
.long 0x18594A05
.long 0xF7FF189A
.long 0xF85DEDE0
.long 0x4770EB08
.long 0xEC58
.long 0xFFFFC684
.long 0xFFFFC690
.code 16
@ =============== S U B R O U T I N E =======================================
sub_964C: @ CODE XREF: sub_9B0C:loc_9C20p
@ sub_9B0C+16Ap
var_A8 = -0xA8
var_A0 = -0xA0
var_9C = -0x9C
dest = -0x98
var_94 = -0x94
var_90 = -0x90
var_8C = -0x8C
var_88 = -0x88
var_84 = -0x84
var_80 = -0x80
var_7C = -0x7C
s = -0x78
var_74 = -0x74
var_70 = -0x70
var_6C = -0x6C
var_68 = -0x68
var_64 = -0x64
var_60 = -0x60
format = -0x5C
var_58 = -0x58
var_54 = -0x54
var_50 = -0x50
var_4C = -0x4C
var_48 = -0x48
var_44 = -0x44
var_40 = -0x40
var_3C = -0x3C
var_38 = -0x38
var_34 = -0x34
var_30 = -0x30
var_2C = -0x2C
@ FUNCTION CHUNK AT 00011E84 SIZE 0000005C BYTES
PUSH.W {R4-R11,LR} @ 把R4-R11和LR保存到堆栈
LDR.W R4, =(_GLOBAL_OFFSET_TABLE_ - 0x9668) @ GLOBAL_OFFSET_TABLE_的地址-0x9668放到R4
SUB SP, SP, #0x84 @ 堆栈给局部变量留出空间
LDR.W R12, =0xFFFFFEEC @ R12 = 0XFFFFFEEC
ADD.W R10, SP, #0xA8+var_38 @ SP+0XA8+VAR38保存到R10
LDR.W LR, =0xFFFFFEF0 @ LR=0XFFFFFEF0 这个显然不对, 可能前边文字池反汇编错了等于这个不是要返回就跑飞么
NOP
ADR R0, 0x9668 @ R0=0X9668
STR.W R12, [SP,#0xA8+var_7C] @ 把R12放到SP+0XA8+VAR7C
ADDS R4, R4, R0 @R4+R0 = R4 _GLOBAL_OFFSET_TABLE_
STR.W R10, [SP,#0xA8+dest]@ R10放到SP+A8+DEST
STR.W LR, [SP,#0xA8+var_68] @ 吧反回地址保存到堆栈(我们前面返回地址是错的。。 )
BL sub_F650 @ 跳转SUB F650
LDR.W R9, [SP,#0xA8+var_7C]R9读出堆栈里的一个数据
MOVS R3, #0 @ R3清零
LDR R1, [SP,#0xA8+dest] @ 用R1取出堆栈里的一个数据
STR R3, [SP,#0xA8+var_9C]@把R3的数据储存到堆栈
LDR.W R0, [R4,R9] @ R0取出R4+R9指向地址的数据
ADDS R2, R1, #4 @ R1+R4= R2
STR R2, [SP,#0xA8+var_88] @把R2保存到堆栈
BL sub_106F4 @ 跳转sub_106F4
LDR R7, [SP,#0xA8+var_88] @ R7取出堆栈里的数据
LDR.W R1, =(aDeviceHasFound - 0x18280)@ R1= aDeviceHasFound - 0x18280的地址
LDR.W R9, [SP,#0xA8+var_9C] @ R9取出堆栈的数据
ADDS R6, R7, #4 @ R6+R7=R6
STR R6, [SP,#0xA8+var_84] @R6保存到堆栈
ADDS R2, R4, R1 @ R4+R1=R2
LDR R7, [SP,#0xA8+var_84] R7取出堆栈的数据
LDR.W R8, =0xFFFFFEF4 @下边这些大同差不多,分析堆栈存取数据画个图比较好,就像电梯上下走电梯就是指针
LDR R5, =0xFFFFFEF8
ADDS R6, R7, #4
LDR R0, [SP,#0xA8+var_9C]
LDR.W R12, =0xFFFFFEFC
LDR R3, =0xFFFFFF00
STR.W R9, [SP,#0xA8+var_8C]
STR.W R9, [SP,#0xA8+var_70]
LDR.W R9, =0xFFFFFF04
STR.W R8, [SP,#0xA8+var_64]
STR R5, [SP,#0xA8+var_90]
STR R0, [SP,#0xA8+var_94]
STR.W R12, [SP,#0xA8+var_58]
STR R2, [SP,#0xA8+s]
STR R3, [SP,#0xA8+var_50]
LDR.W R10, =0xFFFFFF08
LDR.W R8, =0xFFFFFF0C
LDR R5, =0xFFFFFF10
LDR R0, =0xFFFFFF14
LDR.W R12, =0xFFFFC7F4
LDR R1, =0xFFFFFF18
LDR R2, =0xFFFFFF1C
LDR R3, =0xFFFF1A8D
STR.W R10, [SP,#0xA8+var_80]
STR.W R8, [SP,#0xA8+var_4C]
STR R6, [SP,#0xA8+var_74]
STR R5, [SP,#0xA8+var_6C]
STR R0, [SP,#0xA8+var_60]
STR.W R12, [SP,#0xA8+var_48]
STR R1, [SP,#0xA8+var_44]
STR R2, [SP,#0xA8+var_40]
STR R3, [SP,#0xA8+var_3C]
loc_96FA: @ CODE XREF: sub_964C+36Aj
@ sub_964C+3A6j ...
LDR R7, [SP,#0xA8+var_7C]
LDR R6, [SP,#0xA8+var_68]
LDR R5, [R4,R7]
LDR.W R10, [R4,R6]
LDR R0, [R5]
MOV R1, R10
BL sub_10590
SUBS.W R8, R0, #0
BLE loc_97B6 @ 这个是不是R8小于等于R0就跳转啊?
LDR.W R11, [SP,#0xA8+var_64] @ 又是堆栈懒得看了,不就是保存返回地址传递全局变量和储存临时变量么,反正就当做电梯。。
MOVS R5, #0
LDR R6, =0xFFFFFF20
LDR.W R7, [R4,R11] @ R7储存到R4+R11的指向的地址
B loc_973C @ 跳转
@ ---------------------------------------------------------------------------
loc_9720: @ CODE XREF: sub_964C+11Cj
@ sub_964C+128j
LDR R2, [R4,R6] @ R2取出R4+R6地址的数据
LDR.W LR, [R2,#0x14] @ LR取出R2+0X14地址的数据
CMP LR, R3 @LR和R3比较
BEQ.W loc_9974 @ 等于就跳转loc_9974
@不等于当然就接着往下运行啦
LDR R2, [R4,R6] @ R2取出R4+R6指向地址的数据
LDR R0, [R2,#0x24] @ R0取出R2+0X24
CMP R0, R3 @ R0和R3比较
BEQ.W loc_998E @ 等于就跳转loc_998E
loc_9736: @ CODE XREF: sub_964C+106j
@ sub_964C+33Ej ...
ADDS R5, #1 @ R5+1
CMP R8, R5 @R8和R5比较
BLE loc_97B6 @ 小于等于就跳转loc_97B6
loc_973C: @ CODE XREF: sub_964C+D2j
@ sub_964C+168j
LDR.W R3, [R10] @R3取出R10指向地址的数据
LDR.W R11, [R4,R9] @ R11取出R4+R9地址的数据
LDR.W R0, [R3,R5,LSL#2] @ R0取出R5左移2位+R3地址的数据
MOV R1, R11 @ R11放到R1
STR R0, [R7] @ R0放到R7的地址
BL sub_10B30 @跳转 sub_10B30
CMP R0, #0 @ R0是不是等于0
BLT loc_9736 @ 小于0跳转
LDR R0, [R7] @ R7地址的数据放到R0
BL sub_100DC @ 跳转sub_100DC
LDR R2, [R4,R6] @ R4+R6地址的数据放到R2
LDRH.W R3, [R11,#8] @ R3取出R11+8地址的数据
LDRH.W R1, [R11,#0xA] @ 取个16位的数据 R11+0XA地址里面的
LDR R0, [R2,#4] @ R2+4地址里面的数据放到R0
CMP R0, R3@ R0和R3比较
BNE loc_9720 @ 不等于跳转loc_9720
LDR R2, [R2] @ R2取出R2指向地址的数据
CMP R2, R1 @ R2和R1比较
IT eq @ 是不是等于
MOVEQ.W R11, #0 @ 等于执行我
BNE loc_9720 @ 不等于跳转loc_9720
loc_9776: @ CODE XREF: sub_964C+334j
@ sub_964C+34Ej
LDR R0, [SP,#0xA8+s] @堆栈指针偏移地址的数据存到R0
MOV R5, R8 @ R5+R8
BLX puts @跳转puts
LDR R0, [SP,#0xA8+var_90] @根据堆栈指针计算的偏移地址里面的数据存到R0
LDR R3, [SP,#0xA8+var_88] 同上存到 R3具体偏移多少自己计算
MOV.W LR, #0 @ LR清零
LDR R2, [SP,#0xA8+var_74] @ 整天搞堆栈啊自己计算
ADDS R5, #1 @ R5+1
LDR.W R12, [R4,R0] @ R4+R0地址里面的数据存到R12
STR.W LR, [R3] @ 把LR保存到R3
LDR R0, [SP,#0xA8+dest] @ 根据堆栈指针计算的偏移地址里面的数据存到R0
LDR R3, [SP,#0xA8+var_84]@根据堆栈指针计算的偏移地址里面的数据存到R3
LDR R1, [R4,R6] @ R4+R6地址里面的数据存到R1
STR.W LR, [R2] @ LR保存到R2指向昂的地址
MOVS R2, #0x10 @ 0X10存到R2
STR.W LR, [R12] @ LR存到R12的地址
ADD.W R1, R1, R11,LSL#4 @ R11左移4位后加R1= R1
STR.W LR, [R0] @LR 存到R0指向的地址
STR.W LR, [R3] @ LR存到R3指向的地址
BLX memcpy @ 跳转memcpy
CMP R8, R5 @ R8和R5比较
BGT loc_973C @ 大于跳转loc_973C
loc_97B6: @ CODE XREF: sub_964C+C4j
sub_964C+EEj
LDR R5, [SP,#0xA8+var_90] @ 计算偏移地址里面的数据存到R5
LDR R6, [R4,R5] @ R4+R5地址里面的数据放到R6
LDR R5, [R6] @ R6地址里面的数据放到R5
CMP R5, #0 @ R5和0比较
BNE.W loc_999C @不等于跳转loc_999C
BL sub_C278 @等于0跳转sub_C278
LDR R0, [SP,#0xA8+var_58] @堆栈指针偏移地址里面的数据放到R0
LDR R6, [R4,R0] @ R4+R0地址的数据放到R6
MOVS R0, #2 @ 2放到R0
STR R5, [R6] @ R5放到R6的指向的地址
BLX sleep @ 跳转sleep
LDR R5, [SP,#0xA8+var_2C] @ 通过指针地址计算偏移后的地址里面的数据放到R5
LDR.W R12, [SP,#0xA8+var_50]@@ 通过指针地址计算偏移后的地址里面的数据放到R12
CMP R5, #3 @ R5和3比较
LDR.W R2, [R4,R12] @ R4+R12指向地址的数据放到R2
STR R5, [R2] @ R5放到R2指向的地址
BEQ.W loc_99F4 @ 如果R5等于3跳转
loc_97E4: @ CODE XREF: sub_964C+3ACj
@ sub_964C+3C4j ...
LDR.W LR, [SP,#0xA8+var_7C] @ 计算指针偏移地址里面的数据放到LR
MOVS R7, #3 @3放到R7
LDR R0, [SP,#0xA8+var_80] @ 不说堆栈的了
LDR R1, [SP,#0xA8+var_4C]
LDR.W R2, [R4,LR] @ R4+LR地址的数据放到R2
LDR R5, [R4,R0]
LDR R6, [R4,R1]
LDR.W R12, [SP,#0xA8+var_30]
LDR R0, [R2]
LDRH.W R1, [SP,#0xA8+var_34]
LDRH.W R2, [SP,#0xA8+var_38]
STR.W R12, [R5]
STR R7, [R6]
BL sub_1093C
LDR R3, [SP,#0xA8+var_6C]
LDR R1, [R5]
LDR R6, [R4,R3]
STR R0, [R6]
BL sub_100E0
CMP R0, #1
BEQ.W loc_9A46
loc_9820: @ CODE XREF: sub_964C+414j
@ sub_964C+420j
LDR R1, [SP,#0xA8+var_6C]
LDR.W R12, [SP,#0xA8+var_80]
LDR R2, [R4,R1]
LDR.W R6, [R4,R12]
LDR R0, [R2]
LDR R1, [R6]
BL sub_10344
MOV R3, R0
CMP R0, #0
BNE.W loc_99C8
loc_983C: @ CODE XREF: sub_964C+38Aj
LDR.W LR, [SP,#0xA8+var_64]
LDR R0, [SP,#0xA8+var_60]
LDR.W R3, [R4,LR]
LDR R1, [R4,R0]
LDR R0, [R3]
BL sub_11180
MOV R3, R0 @ int
CMP R0, #0
BNE.W loc_99B8
loc_9856: @ CODE XREF: sub_964C+37Aj
LDR.W LR, [SP,#0xA8+var_68]
MOVS R1, #1 @ int
LDR.W R5, [R4,LR]
LDR R0, [R5] @ ptr
BL sub_10558
LDR R2, [SP,#0xA8+var_60]
LDR R6, [SP,#0xA8+var_80]
LDR R3, [R4,R2]
LDR R0, [R4,R6]
LDR R7, [R3]
LDR.W R12, [R0]
LDR R5, [R7,#0xC]
LDR.W R7, [R5,R12,LSL#3]
LDRB R1, [R7,#4]
CMP R1, #0 @ R1和0比较
BEQ loc_9900 @ 如果等于0 跳转
LDR R0, =(aReadEpAddr0xXB - 0x18280)
MOVS R6, #0
LDR.W R12, =(aXcmidware - 0x18280)
MOV R8, R6
LDR.W R11, =(a0EpAddr0xXBuff - 0x18280)
ADDS R1, R4, R0 @ "read ep-addr=0x%x; buffsize=%d\n"
LDR R3, =(aWriteEpAddr0xX - 0x18280)
ADD.W R10, R4, R12 @ "xcmidware"
STR R1, [SP,#0xA8+format]
ADD R11, R4 @ "0 ep-addr=0x%x;buffsize=%d\n"
STR R4, [SP,#0xA8+var_54]
ADDS R5, R4, R3 @ "write ep-addr=0x%x;buffsize=%d\n"
B loc_98BE
@ ---------------------------------------------------------------------------
loc_98A0: @ CODE XREF: sub_964C+294j
LDRH R2, [R4,#4] @ R4+4地址里面的数据放到R2
ADD.W R8, R8, #1 @ R8+1=R8
BLX printf @ 跳转printf
LDRH.W R12, [R4,#4] @ R4+4地址里面数据的低16位放到R12
STR.W R12, [SP,#0xA8+var_9C] @ 保存R12到堆栈
ADDS R6, #0x14 @ R6+0X14
LDRB R3, [R4,#2] @R4+2地址里面的数据的低8位放到R3
STR R3, [SP,#0xA8+var_94] @ 把R3保存到堆栈
LDRB R2, [R7,#4] @ R7+4地址里面数据的低8位放到R2
CMP R2, R8 @ R2和R8比较
BLE loc_98FE @ 小于等于跳转loc_98FE
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课