Make hexdump match the one in fluffy

This commit is contained in:
Neale Pickett 2018-07-10 21:58:33 +00:00
parent 7305d42800
commit 8994b9b5ca
1 changed files with 56 additions and 53 deletions

View File

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