blob: 83bcfa35ad83a52a54d9cf370938c1d7dd53dbfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import r2pipe
import opencc
cc = opencc.OpenCC('t2s')
r = r2pipe.open()
data = r.cmdj("xj 240 @ 0x47fdf2")
for i in range(0,30):
addr = data[i*8+0] + (data[i*8+1]<<8) + (data[i*8+2]<<16) + (data[i*8+3]<<24)
_4 = data[i*8+4]
_5 = data[i*8+5]
_6 = data[i*8+6]
_7 = data[i*8+7]
hexs = r.cmdj("xj 10 @ {}".format(addr))
hexstr = ""
cbytes = bytearray([])
for i in hexs:
if i == 0:
break
hexstr += f'\\x{i:02x}'
cbytes.append(i)
big5str = cc.convert(cbytes.decode(encoding='big5'))
print("{ " + f'"{hexstr}", {_4}, {_5}, {_6}, {_7}' + ' }, /* ' + big5str + ' */')
|