diff options
author | Iru Cai <mytbk920423@gmail.com> | 2021-05-16 14:37:53 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2021-05-16 14:37:53 +0800 |
commit | 80516deb3c10bcc5fd4d7f9d7ed01c2ebbf90988 (patch) | |
tree | c71cb498b0480332e229fe95cf596d54aec36f3d /print_tools_table.py | |
parent | 750842e7b79e017313247a42a440fd5d9eaaed41 (diff) | |
download | rich4.r2-80516deb3c10bcc5fd4d7f9d7ed01c2ebbf90988.tar.xz |
Diffstat (limited to 'print_tools_table.py')
-rw-r--r-- | print_tools_table.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/print_tools_table.py b/print_tools_table.py new file mode 100644 index 0000000..e90a4ca --- /dev/null +++ b/print_tools_table.py @@ -0,0 +1,22 @@ +import r2pipe +import opencc + +cc = opencc.OpenCC('t2s') +r = r2pipe.open() +data = r.cmdj("xj 8*13 @ 0x47fee2") +for i in range(0,13): + 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 20 @ {}".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 + ' */') |