Changeset 13
- Timestamp:
- 11/11/12 13:10:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bin/bletchley-analyze
r9 r13 32 32 parser.add_argument('input_file', nargs='?', default=None, 33 33 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 34 parser.add_argument('-e', dest='encoding_chain', type=str, default=None, 35 help='Comma-separated sequence of formats used to encode the tokens, beginning with the last one applied. (default: auto-detect)') 36 parser.add_argument('-b', dest='block_size', type=int, default=8, 37 help='The block size displayed and used in highlighting (default: 8)') 34 38 parser.add_argument('-p', dest='output_lines', type=int, default=10, 35 39 help='Number of lines of input to display in decoded form.') … … 76 80 77 81 for i in range(0,len(hex),line_size): 78 line = '%. 8X: ' % i82 line = '%.4X: ' % i 79 83 80 84 if len(hex[i:]) < line_size: … … 111 115 return encoding,block_sizes 112 116 117 specified_encodings = [] 118 if options.encoding_chain != None: 119 specified_encodings = options.encoding_chain.split(',') 113 120 114 121 encoding_chain = [] … … 118 125 print('Beginning analysis after decoding by chain: %s' % ','.join(encoding_chain)) 119 126 encoding,block_sizes = analyze(blobs) 120 group_size = 4121 if len(block_sizes) > 0 and min(block_sizes) in (8,16):122 group_size = min(block_sizes) 127 if len(specified_encodings) > 0: 128 encoding = specified_encodings.pop(0) 129 123 130 124 131 blobs_to_print = blobs[:options.output_lines] 125 132 print('First %d Values:' % len(blobs_to_print)) 126 133 127 printColoredHexDump(blobs_to_print, group_size)134 printColoredHexDump(blobs_to_print, options.block_size) 128 135 129 136 if encoding != None:
Note: See TracChangeset
for help on using the changeset viewer.