@@ -89,15 +89,11 @@ def asm_diff(self, fileobj):
89
89
90
90
print (colors .BOLD , colors .GREEN )
91
91
tables = f"{ ansi_ljust ('FILE1' , 26 , ' ' , 'l' )} { ansi_ljust ('FILE2' , 54 , ' ' , 'l' )} "
92
- print (tables )
93
- print (colors .BLUE )
94
-
95
- print ("Architecture\t Alphanumeric\t Size (bytes)\t Source\t Architecture\t Alphanumeric\t Size (bytes)\t Source{:s}" .format (colors .END ).expandtabs (15 ))
96
- print ("{:s}\t {}\t {:d}\t {:s}\t {:s}\t {}\t {:d}\t {:s}" .format (
97
- self .arch , alpha , original [2 ], original [0 ],
98
- self .arch , alpha2 , modified [2 ], modified [0 ]
99
- ).expandtabs (15 ))
92
+ print (f"{ tables } { colors .BLUE } \n " )
100
93
94
+ print (f"{ 'Architecture' :<15} { 'Alphanumeric' :<15} { 'Size (bytes)' :<15} { 'Source' :<17} { 'Architecture' :<15} { 'Alphanumeric' :<15} { 'Size (bytes)' :<15} { 'Source' } { colors .END } " )
95
+ print (f"{ self .arch :<15} { alpha :<15} { original [2 ]:<15} { original [0 ]:<17} { self .arch :<15} { alpha2 :<15} { modified [2 ]:<15} { modified [0 ]} " )
96
+
101
97
print (colors .BOLD , colors .GREEN )
102
98
tables = f"{ ansi_ljust ('Disassembly' , 29 , ' ' , 'l' )} { ansi_ljust ('Disassembly' , 54 , ' ' , 'l' )} "
103
99
print (tables )
@@ -196,14 +192,12 @@ def disassemble_bytes(self, source_file, shellcode, sc_size):
196
192
197
193
# check_alpha: check if the buffer is completely alphanumeric
198
194
def check_alpha (self , shellcode ):
195
+ for i in range (len (shellcode )):
196
+ test = str .isalpha (chr (shellcode [i ]))
197
+ if test == False :
198
+ return "False"
199
199
200
- alpha = None
201
- try :
202
- shellcode .decode ('ascii' )
203
- except :
204
- alpha = False
205
-
206
- return alpha
200
+ return "True"
207
201
208
202
# raw_repr: print both binary files as strings escaping
209
203
# non-printable characters
0 commit comments