Example #1
0
 def _format(data):
     for offset, hexa, s in strutils.hexdump(data):
         yield [
             ("offset", offset + " "),
             ("text", hexa + "   "),
             ("text", s)
         ]
Example #2
0
 def _format(data):
     for offset, hexa, s in strutils.hexdump(data):
         yield [
             ("offset", offset + " "),
             ("text", hexa + "   "),
             ("text", s)
         ]
Example #3
0
 def dump(self, data, hexdump):
     if hexdump:
         for line in strutils.hexdump(data):
             self("\t%s %s %s" % line)
     else:
         for i in strutils.clean_bin(data).split("\n"):
             self("\t%s" % i)
Example #4
0
 def dump(self, data, hexdump):
     if hexdump:
         for line in strutils.hexdump(data):
             self("\t%s %s %s" % line)
     else:
         for i in strutils.clean_bin(data).split("\n"):
             self("\t%s" % i)
Example #5
0
 def dump(self, data, hexdump):
     if hexdump:
         for line in strutils.hexdump(data):
             self("\t%s %s %s" % line)
     else:
         data = data.decode("ascii", "replace").replace(u"\ufffd", u".")
         for i in strutils.escape_control_characters(data).split(u"\n"):
             self(u"\t%s" % i)
Example #6
0
 def dump(self, data, hexdump):
     if hexdump:
         for line in strutils.hexdump(data):
             self("\t%s %s %s" % line)
     else:
         data = strutils.native(
             strutils.escape_control_characters(
                 data.decode("ascii", "replace").replace(u"\ufffd", u".")))
         for i in data.split("\n"):
             self("\t%s" % i)
Example #7
0
def test_hexdump():
    assert list(strutils.hexdump(b"one\0" * 10))