From 8994b9b5ca20aabaad1538367e72af0e5020d259 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Tue, 10 Jul 2018 21:58:33 +0000 Subject: [PATCH] Make hexdump match the one in fluffy --- netarch/__init__.py | 109 +++++++++++++++++++++++--------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/netarch/__init__.py b/netarch/__init__.py index 0666039..8b76b4e 100644 --- a/netarch/__init__.py +++ b/netarch/__init__.py @@ -3,59 +3,62 @@ import sys import struct -stdch = (u'␀·········␊··␍··' - u'················' - u' !"#$%&\'()*+,-./' - u'0123456789:;<=>?' - u'@ABCDEFGHIJKLMNO' - u'PQRSTUVWXYZ[\]^_' - u'`abcdefghijklmno' - u'pqrstuvwxyz{|}~·' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················') +stdch = ( + '␀·········␊··␍··' + '················' + ' !"#$%&\'()*+,-./' + '0123456789:;<=>?' + '@ABCDEFGHIJKLMNO' + 'PQRSTUVWXYZ[\]^_' + '`abcdefghijklmno' + 'pqrstuvwxyz{|}~·' + '················' + '················' + '················' + '················' + '················' + '················' + '················' + '················' +) -decch = (u'␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏' - u'␐␑␒␓␔␕␖␗␘␙␚·····' - u'␠!"#$%&\'()*+,-./' - u'0123456789:;<=>?' - u'@ABCDEFGHIJKLMNO' - u'PQRSTUVWXYZ[\]^_' - u'`abcdefghijklmno' - u'pqrstuvwxyz{|}~␡' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················' - u'················') - - - -cgach = (u'␀☺☻♥♦♣♠•◘○◙♂♀♪♫☼' - u'►◄↕‼¶§▬↨↑↓→←∟↔▲▼' - u' !"#$%&\'()*+,-./' - u'0123456789:;<=>?' - u'@ABCDEFGHIJKLMNO' - u'PQRSTUVWXYZ[\]^_' - u'`abcdefghijklmno' - u'pqrstuvwxyz{|}~⌂' - u'ÇüéâäàåçêëèïîìÄÅ' - u'ÉæÆôöòûùÿÖÜ¢£¥₧ƒ' - u'áíóúñѪº¿⌐¬½¼¡«»' - u'░▒▓│┤╡╢╖╕╣║╗╝╜╛┐' - u'└┴┬├─┼╞╟╚╔╩╦╠═╬╧' - u'╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀' - u'αßΓπΣσµτΦΘΩδ∞φε∩' - u'≡±≥≤⌠⌡÷≈°∙·√ⁿ²■¤') +decch = ( + '␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏' + '␐␑␒␓␔␕␖␗␘␙␚·····' + '␠!"#$%&\'()*+,-./' + '0123456789:;<=>?' + '@ABCDEFGHIJKLMNO' + 'PQRSTUVWXYZ[\]^_' + '`abcdefghijklmno' + 'pqrstuvwxyz{|}~␡' + '················' + '················' + '················' + '················' + '················' + '················' + '················' + '················' +) +cgach = ( + '□☺☻♥♦♣♠•◘○◙♂♀♪♫☼' + '►◄↕‼¶§▬↨↑↓→←∟↔▲▼' + ' !"#$%&\'()*+,-./' + '0123456789:;<=>?' + '@ABCDEFGHIJKLMNO' + 'PQRSTUVWXYZ[\]^_' + '`abcdefghijklmno' + 'pqrstuvwxyz{|}~⌂' + 'ÇüéâäàåçêëèïîìÄÅ' + 'ÉæÆôöòûùÿÖÜ¢£¥₧ƒ' + 'áíóúñѪº¿⌐¬½¼¡«»' + '░▒▓│┤╡╢╖╕╣║╗╝╜╛┐' + '└┴┬├─┼╞╟╚╔╩╦╠═╬╧' + '╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀' + 'αßΓπΣσµτΦΘΩδ∞φε∩' + '≡±≥≤⌠⌡÷≈°∙·√ⁿ²■¤' +) def unpack(fmt, buf): @@ -94,9 +97,9 @@ class HexDumper: self.output.write(' '.join(self.hexes[:8])) self.output.write(' ') self.output.write(' '.join(self.hexes[8:])) - self.output.write(' |') + self.output.write(' ┆') self.output.write(''.join(self.chars)) - self.output.write('|\n') + self.output.write('┆\n') self.hexes = [] self.chars = []