From ae5362ee71880cee2a986da15b47a5aa4c4368ce Mon Sep 17 00:00:00 2001 From: itsme Date: Tue, 6 Jul 2021 22:50:59 +0200 Subject: crodump: added verbose dump, which prints all unreferenced datablocks. added --increment to scan for KOD shifts. support hex stdin data. added --struonly option. --- hexdump.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hexdump.py') diff --git a/hexdump.py b/hexdump.py index c119b16..aeb8c88 100644 --- a/hexdump.py +++ b/hexdump.py @@ -1,9 +1,16 @@ import struct -from binascii import b2a_hex +from binascii import b2a_hex, a2b_hex """ Simple hexdump, 16 bytes per line with offset. """ +def unhex(data): + if type(data)==bytes: + data = data.decode('ascii') + data = data.replace(' ', '') + data = data.strip() + return a2b_hex(data) + def ashex(line): return " ".join("%02x" % _ for _ in line) def aschr(b): -- cgit v1.2.3