使用Android studio 逆向代码时,市场遇到变量是一个数组,其实数组中内容包含字符串,但是Android studio无法识别,可能因为android studio string是默认unicode格式吧,学艺不精,不知道怎么操作才能把字符显示出来。期望有知道的留言告诉我呀。。
就写了个脚本,把数组复制出来然后提取处之后,自己转换一下吧。
复制出来的数组是这样的:
0 = -91 (0xA5)
1 = 105 (0x69)
2 = -83 (0xAD)
3 = 30 (0x1E)
4 = 17 (0x11)
5 = 72 (0x48)
6 = -113 (0x8F)
7 = 39 (0x27)
8 = 104 (0x68)
9 = -26 (0xE6)
10 = -82 (0xAE)
11 = -80 (0xB0)
12 = -16 (0xF0)
13 = -84 (0xAC)
14 = 24 (0x18)
15 = -97 (0x9F)
16 = -34 (0xDE)
17 = 118 (0x76)
18 = 8 (0x8)
19 = 31 (0x1F)
20 = 40 (0x28)
21 = -5 (0xFB)
22 = 104 (0x68)
23 = -125 (0x83)
24 = 44 (0x2C)
25 = -104 (0x98)
26 = 17 (0x11)
27 = -107 (0x95)
28 = -102 (0x9A)
29 = 51 (0x33)
30 = -23 (0xE9)
31 = 41 (0x29)
32 = 2 (0x2)
33 = -59 (0xC5)
34 = -68 (0xBC)
35 = 50 (0x32)
36 = 13 (0xD)
37 = -29 (0xE3)
38 = 67 (0x43)
39 = -45 (0xD3)
40 = 83 (0x53)
41 = 8 (0x8)
42 = -88 (0xA8)
43 = -76 (0xB4)
44 = 107 (0x6B)
45 = -69 (0xBB)
46 = 84 (0x54)
47 = 106 (0x6A)
48 = -9 (0xF7)
49 = -66 (0xBE)
50 = 114 (0x72)
51 = -8 (0xF8)
52 = 107 (0x6B)
53 = 81 (0x51)
54 = -49 (0xCF)
55 = 47 (0x2F)
56 = 91 (0x5B)
57 = 105 (0x69)
58 = 82 (0x52)
59 = 23 (0x17)
60 = 53 (0x35)
61 = 44 (0x2C)
62 = -62 (0xC2)
63 = -98 (0x9E)
64 = -9 (0xF7)
65 = -45 (0xD3)
66 = 54 (0x36)
67 = -32 (0xE0)
68 = -16 (0xF0)
69 = 125 (0x7D)
70 = 29 (0x1D)
71 = 50 (0x32)
72 = -48 (0xD0)
73 = -51 (0xCD)
74 = 18 (0x12)
75 = 25 (0x19)
76 = 120 (0x78)
77 = 12 (0xC)
78 = 118 (0x76)
79 = 29 (0x1D)
80 = -10 (0xF6)
81 = 84 (0x54)
82 = 106 (0x6A)
83 = -99 (0x9D)
84 = 30 (0x1E)
85 = -103 (0x99)
86 = -123 (0x85)
87 = -98 (0x9E)
88 = -5 (0xFB)
89 = 27 (0x1B)
90 = -127 (0x81)
91 = 48 (0x30)
92 = -107 (0x95)
93 = -107 (0x95)
94 = -63 (0xC1)
95 = 67 (0x43)
96 = 44 (0x2C)
97 = -58 (0xC6)
98 = 69 (0x45)
99 = 64 (0x40)
100 = 24 (0x18)
101 = 24 (0x18)
102 = -79 (0xB1)
103 = -20 (0xEC)
104 = -116 (0x8C)
105 = 97 (0x61)
106 = 119 (0x77)
107 = 103 (0x67)
108 = 32 (0x20)
109 = -81 (0xAF)
110 = 125 (0x7D)
111 = 34 (0x22)
112 = 89 (0x59)
113 = -40 (0xD8)
114 = -121 (0x87)
115 = 120 (0x78)
116 = 116 (0x74)
117 = 42 (0x2A)
118 = -17 (0xEF)
119 = -56 (0xC8)
120 = 44 (0x2C)
121 = 17 (0x11)
122 = -38 (0xDA)
123 = 33 (0x21)
124 = 22 (0x16)
125 = -7 (0xF9)
126 = -91 (0xA5)
127 = -65 (0xBF)
128 = 89 (0x59)
129 = 102 (0x66)
130 = 50 (0x32)
131 = 5 (0x5)
132 = -116 (0x8C)
133 = 87 (0x57)
134 = -86 (0xAA)
135 = 115 (0x73)
136 = -120 (0x88)
137 = -109 (0x93)
138 = -102 (0x9A)
139 = 49 (0x31)
140 = -7 (0xF9)
141 = 71 (0x47)
142 = -104 (0x98)
143 = 59 (0x3B)
144 = -70 (0xBA)
145 = 56 (0x38)
146 = 75 (0x4B)
147 = 9 (0x9)
148 = 72 (0x48)
149 = 46 (0x2E)
150 = -16 (0xF0)
151 = 105 (0x69)
152 = 18 (0x12)
153 = -9 (0xF7)
154 = 33 (0x21)
155 = 0 (0x0)
156 = -110 (0x92)
157 = -59 (0xC5)
158 = 11 (0xB)
159 = -51 (0xCD)
160 = 15 (0xF)
161 = -46 (0xD2)
162 = -60 (0xC4)
163 = -51 (0xCD)
164 = 50 (0x32)
165 = 38 (0x26)
166 = -92 (0xA4)
167 = -79 (0xB1)
168 = 7 (0x7)
169 = -77 (0xB3)
170 = 59 (0x3B)
171 = 0 (0x0)
172 = -90 (0xA6)
173 = 45 (0x2D)
174 = -125 (0x83)
175 = 87 (0x57)
176 = -62 (0xC2)
177 = -62 (0xC2)
178 = -49 (0xCF)
179 = 115 (0x73)
180 = 26 (0x1A)
181 = 95 (0x5F)
182 = -8 (0xF8)
183 = 109 (0x6D)
184 = -5 (0xFB)
185 = 61 (0x3D)
186 = -44 (0xD4)
187 = 32 (0x20)
188 = -66 (0xBE)
189 = -59 (0xC5)
190 = 49 (0x31)
191 = 122 (0x7A)
192 = -105 (0x97)
193 = -99 (0x9D)
194 = -52 (0xCC)
195 = 54 (0x36)
196 = -10 (0xF6)
197 = 52 (0x34)
198 = 115 (0x73)
199 = 42 (0x2A)
200 = -109 (0x93)
201 = -31 (0xE1)
202 = 108 (0x6C)
203 = -42 (0xD6)
204 = -5 (0xFB)
205 = -22 (0xEA)
206 = -6 (0xFA)
207 = -1 (0xFF)
208 = -106 (0x96)
209 = 73 (0x49)
210 = -57 (0xC7)
211 = 75 (0x4B)
212 = 91 (0x5B)
213 = 35 (0x23)
214 = -105 (0x97)
215 = -61 (0xC3)
216 = 7 (0x7)
217 = 70 (0x46)
218 = 60 (0x3C)
219 = -57 (0xC7)
220 = -116 (0x8C)
221 = -113 (0x8F)
222 = -69 (0xBB)
223 = -37 (0xDB)
224 = 93 (0x5D)
225 = -105 (0x97)
226 = -123 (0x85)
227 = -67 (0xBD)
228 = 82 (0x52)
229 = -16 (0xF0)
230 = 24 (0x18)
231 = -121 (0x87)
232 = -72 (0xB8)
233 = -17 (0xEF)
234 = -1 (0xFF)
235 = -42 (0xD6)
236 = 116 (0x74)
237 = -97 (0x9F)
238 = 23 (0x17)
239 = 112 (0x70)
240 = -27 (0xE5)
241 = -50 (0xCE)
242 = 6 (0x6)
243 = -73 (0xB7)
244 = -29 (0xE3)
245 = 121 (0x79)
246 = -56 (0xC8)
247 = -93 (0xA3)
248 = 77 (0x4D)
249 = 56 (0x38)
250 = -87 (0xA9)
251 = 123 (0x7B)
252 = -81 (0xAF)
253 = 62 (0x3E)
254 = -98 (0x9E)
255 = 63 (0x3F)
256 = -78 (0xB2)
257 = 123 (0x7B)
258 = 64 (0x40)
259 = -109 (0x93)
260 = -116 (0x8C)
261 = 31 (0x1F)
262 = 65 (0x41)
263 = -22 (0xEA)
264 = -4 (0xFC)
265 = 103 (0x67)
266 = -5 (0xFB)
267 = -78 (0xB2)
268 = 71 (0x47)
269 = -112 (0x90)
270 = -37 (0xDB)
271 = 50 (0x32)
272 = 24 (0x18)
273 = -61 (0xC3)
274 = -59 (0xC5)
275 = -81 (0xAF)
276 = -61 (0xC3)
277 = -22 (0xEA)
278 = -35 (0xDD)
279 = 95 (0x5F)
280 = -25 (0xE7)
281 = -118 (0x8A)
282 = -92 (0xA4)
283 = -86 (0xAA)
284 = 34 (0x22)
285 = -88 (0xA8)
286 = -59 (0xC5)
287 = 15 (0xF)
288 = 25 (0x19)
289 = -97 (0x9F)
290 = 79 (0x4F)
291 = -126 (0x82)
292 = -38 (0xDA)
293 = 20 (0x14)
294 = 119 (0x77)
295 = 32 (0x20)
296 = 0 (0x0)
297 = 60 (0x3C)
298 = -29 (0xE3)
299 = 14 (0xE)
300 = -95 (0xA1)
301 = -27 (0xE5)
302 = -2 (0xFE)
303 = 43 (0x2B)
304 = 61 (0x3D)
305 = 82 (0x52)
306 = 39 (0x27)
307 = -36 (0xDC)
308 = -40 (0xD8)
309 = 9 (0x9)
310 = 113 (0x71)
311 = 19 (0x13)
312 = 22 (0x16)
313 = 35 (0x23)
314 = -116 (0x8C)
315 = -116 (0x8C)
316 = -60 (0xC4)
317 = -104 (0x98)
318 = 52 (0x34)
319 = -109 (0x93)
320 = 21 (0x15)
321 = 71 (0x47)
322 = -104 (0x98)
323 = -11 (0xF5)
324 = -53 (0xCB)
325 = -95 (0xA1)
326 = 15 (0xF)
327 = -28 (0xE4)
328 = -95 (0xA1)
329 = 125 (0x7D)
330 = 109 (0x6D)
331 = -8 (0xF8)
332 = 36 (0x24)
333 = -41 (0xD7)
334 = 97 (0x61)
335 = 43 (0x2B)
336 = 81 (0x51)
337 = -40 (0xD8)
338 = -39 (0xD9)
339 = -95 (0xA1)
340 = -21 (0xEB)
341 = 19 (0x13)
342 = 26 (0x1A)
343 = 0 (0x0)
344 = -93 (0xA3)
345 = -27 (0xE5)
346 = -48 (0xD0)
347 = -126 (0x82)
348 = 56 (0x38)
349 = -111 (0x91)
350 = 55 (0x37)
351 = -97 (0x9F)
352 = 72 (0x48)
353 = 57 (0x39)
354 = 66 (0x42)
355 = -15 (0xF1)
356 = -41 (0xD7)
357 = -32 (0xE0)
358 = -102 (0x9A)
359 = -126 (0x82)
360 = 83 (0x53)
361 = -113 (0x8F)
362 = 6 (0x6)
363 = -60 (0xC4)
364 = -76 (0xB4)
365 = -35 (0xDD)
366 = -39 (0xD9)
367 = -103 (0x99)
368 = -127 (0x81)
369 = -113 (0x8F)
370 = -23 (0xE9)
371 = -95 (0xA1)
372 = -56 (0xC8)
373 = 8 (0x8)
374 = 9 (0x9)
375 = 19 (0x13)
376 = 113 (0x71)
377 = 106 (0x6A)
378 = 41 (0x29)
379 = 35 (0x23)
380 = 27 (0x1B)
381 = -122 (0x86)
382 = 51 (0x33)
383 = 124 (0x7C)
384 = -93 (0xA3)
需要先提取出0x**的数字部分,然后再转换一下:
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 10 14:58:46 2019
@author: liuti
"""
import re
pattern = '0x[A-Za-z0-9_]*'
f = open('probuff.txt')
fw = open('writebuff.txt','w')
fc = open('ascii.txt','w')
contents = f.readlines()
for line in contents:
s1 = re.search(pattern,line)
#print(s1.group())
char = int(s1.group(),16)
if char>32 and char < 127:
#fc.write(chr(char))
pass
print(chr(char))
fc.write(chr(char))
fw.write(s1.group()+',')
#print(char)
#print(type(s1.group))
f.close()
fw.close()
fc.close()
上面代码可以取出里面的0x**,如果是可见字符的话还会转换。