.text:00000D28 PUSH {R4-R7,LR}
2..text:00000D2A SUB SP, SP, #0x14 ; 开闭空间
3..text:00000D2C MOVS R6, R2 ; R6 = data
4..text:00000D2E LDR R2, [R0] ; R2 = Env地址; 从这里可以看出下面肯定有一条语句是 R2+###,为什么? 哈哈
5..text:00000D30 STR R3, [SP,#8] ; Sp+8 = key1; 把key1的值放到Sp+8里面,
6..text:00000D32 MOVS R3, #0x2AC ; R3 = 0x2ac; 看到这里我知道R2+###语句马上就要来了,###=0x2ac
7..text:00000D36 LDR R3, [R2,R3] ; R3 = Env地址+0x2ac; 他果然来了; 这是一个Env指针的方法:GetArrayLength
8..text:00000D38 MOVS R1, R6 ; R1 = data;
9..text:00000D3A MOVS R5, R0 ; R5 = Env指正
10..text:00000D3C BLX R3 ; 调用getarrayLength, 获取Data的长度,长度放到R0 = data.length
11..text:00000D3E LDR R3, [R5] ; R3 = Env地址, 同理,我知道下面会有一个语句是R3+###
12..text:00000D40 MOVS R4, #0x2E4 ; 坚定了我的想法
13..text:00000D44 STR R0, [SP,#0xC] ; Sp+0xc = data.length
14..text:00000D46 LDR R3, [R3,R4] ; R3 = GetCharArrayElements方法
15..text:00000D48 MOVS R0, R5 ; R0 = Env指针
16..text:00000D4A MOVS R1, R6 ; R1 = data
17..text:00000D4C MOVS R2, #0 ; R2 = 0
18..text:00000D4E BLX R3 ; 调用GetCharArrayElements方法,获取一个指向data数组元素第0个字节的指针; R0 = *data[0]
19..text:00000D50 STR R0, [SP] ; Sp+0 = *data[0]
20..text:00000D52 CMP R0, #0
21..text:00000D54 BEQ loc_DC4 ; 当R0 == 0 跳转到loc_dc4
22..text:00000D56 LDR R3, [R5] ; R3 = Env地址
23..text:00000D58 MOVS R0, R5 ; R0 = Env
24..text:00000D5A LDR R1, [SP,#8] ; R1 = key1
25..text:00000D5C LDR R3, [R3,R4] ; R3 = GetCharArrayElements方法
26..text:00000D5E MOVS R2, #0 ; R2= 0
27..text:00000D60 BLX R3 ; 调用GetCharArrayElements方法;R0 = *key1[0]
28..text:00000D62 STR R0, [SP,#4] ; Sp+4 = *key1[0]
29..text:00000D64 CMP R0, #0
30..text:00000D66 BEQ loc_D6E
31..text:00000D68 LDR R4, [SP] ; R4 = *data[0]
32..text:00000D6A MOVS R7, #0
33..text:00000D6C B loc_D9C ; R3 = data.length
34..text:00000D6E ; ---------------------------------------------------------------------------
35..text:00000D6E
36..text:00000D6E loc_D6E ; CODE XREF: Java_com_tencent_mobileqq_utils_SecurityUtile_encrypt+3Ej
37..text:00000D6E LDR R2, [R5]
38..text:00000D70 MOVS R3, #0x304
39..text:00000D74 LDR R4, [R2,R3]
40..text:00000D76 MOVS R1, R6
41..text:00000D78 MOVS R0, R5
42..text:00000D7A LDR R2, [SP,#0x28+var_28]
43..text:00000D7C LDR R3, [SP,#0x28+var_24]
44..text:00000D7E BLX R4
45..text:00000D80 LDR R6, [SP,#0x28+var_24]
46..text:00000D82 B loc_DC6
47..text:00000D84 ; ---------------------------------------------------------------------------
48..text:00000D84
49..text:00000D84 loc_D84 ; CODE XREF: Java_com_tencent_mobileqq_utils_SecurityUtile_encrypt+78j
50..text:00000D84 MOVS R0, R7 ; R0 = 0
51..text:00000D86 LDR R1, [SP,#0x28] ; R1 = key2;
52..text:00000D88 BLX __aeabi_idivmod ; 求余运算!; R0 = 0 % key2;
53..text:00000D8C LDR R3, [SP,#4] ; R3 = *key1[0]指向key数组第0个元素的指针
54..text:00000D8E LSLS R1, R1, #1 ; R1 = 求余的结果 * 2^1
55..text:00000D90 ADDS R7, #1 ; R7 = R7 +1 ;
56..text:00000D92 LDRH R2, [R1,R3] ; R2 = key1[R1]
57..text:00000D94 LDRH R3, [R4] ; R3 = *data[0]第一个元素
58..text:00000D96 EORS R3, R2 ; R3 = R3 异或 R2;
59..text:00000D98 STRH R3, [R4] ; R4的地址 = R3 异或 R2
60..text:00000D9A ADDS R4, #2 ; R4 = 2
61..text:00000D9C
62..text:00000D9C loc_D9C ; CODE XREF: Java_com_tencent_mobileqq_utils_SecurityUtile_encrypt+44j
63..text:00000D9C LDR R3, [SP,#0xC] ; R3 = data.length
64..text:00000D9E CMP R7, R3 ; 通过分析我知道了, data.length有多长, 就循环几次
65..text:00000DA0 BLT loc_D84 ; if( 0 < data.length ){loc_D84}
66..text:00000DA2 LDR R3, [R5] ; R3 = Env地址
67..text:00000DA4 MOVS R7, #0x304
68..text:00000DA8 LDR R4, [R3,R7] ; R4 = ReleaseCharArrayElements方法
69..text:00000DAA MOVS R0, R5 ; R0 = Env
70..text:00000DAC MOVS R1, R6 ; R1 = data
71..text:00000DAE LDR R2, [SP] ; R2 = *data[0]
72..text:00000DB0 MOVS R3, #0
73..text:00000DB2 BLX R4 ; 调用ReleaseCharArrayElements方法.目的在于释放通过GetCharArrayElements方法获取到的指针, 提醒计算机这个指针以后不会在访问了.
74..text:00000DB4 LDR R3, [R5] ; R3 = Env地址
75..text:00000DB6 MOVS R0, R5 ; R0 = Env指针
76..text:00000DB8 LDR R1, [SP,#8] ; R1 = key1
77..text:00000DBA LDR R4, [R3,R7] ; R4 = ReleaseCharArrayElements方法
78..text:00000DBC LDR R2, [SP,#4] ; R2 = *key1[0];指向key1数组元素第0个元素的指针
79..text:00000DBE MOVS R3, #0
80..text:00000DC0 BLX R4 ; 同理,释放*key[0]
81..text:00000DC2 B loc_DC6