Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
wetw0rk committed Nov 25, 2019
1 parent 22426a4 commit 9b53bc4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
common/__pycache__/*
modules/__pycache__/*
modules/dev/__pycache__/*
modules/formats/__pycache__/*
common/lib/__pycache__/*
Sickle/__pycache__/*
Sickle/common/__pycache__/*
Sickle/common/lib/__pycache__/*
Sickle/common/formats/__pycache__/*
Sickle/modules/__pycache__/*
Sickle/modules/dev/__pycache__/*
Binary file modified Documentation/pictures/asm_compare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Documentation/pictures/examine.png
Binary file not shown.
24 changes: 9 additions & 15 deletions Sickle/modules/dev/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,11 @@ def asm_diff(self, fileobj):

print(colors.BOLD, colors.GREEN)
tables = f"{ansi_ljust('FILE1', 26, ' ', 'l')}{ansi_ljust('FILE2', 54, ' ', 'l')}"
print(tables)
print(colors.BLUE)

print("Architecture\tAlphanumeric\tSize (bytes)\tSource\tArchitecture\tAlphanumeric\tSize (bytes)\tSource{:s}".format(colors.END).expandtabs(15))
print("{:s}\t{}\t{:d}\t{:s}\t{:s}\t{}\t{:d}\t{:s}".format(
self.arch, alpha, original[2], original[0],
self.arch, alpha2, modified[2], modified[0]
).expandtabs(15))
print(f"{tables}{colors.BLUE}\n")

print(f"{'Architecture':<15}{'Alphanumeric':<15}{'Size (bytes)':<15}{'Source':<17}{'Architecture':<15}{'Alphanumeric':<15}{'Size (bytes)':<15}{'Source'}{colors.END}")
print(f"{self.arch:<15}{alpha:<15}{original[2]:<15}{original[0]:<17}{self.arch:<15}{alpha2:<15}{modified[2]:<15}{modified[0]}")

print(colors.BOLD, colors.GREEN)
tables = f"{ansi_ljust('Disassembly', 29, ' ', 'l')}{ansi_ljust('Disassembly', 54, ' ', 'l')}"
print(tables)
Expand Down Expand Up @@ -196,14 +192,12 @@ def disassemble_bytes(self, source_file, shellcode, sc_size):

# check_alpha: check if the buffer is completely alphanumeric
def check_alpha(self, shellcode):
for i in range(len(shellcode)):
test = str.isalpha(chr(shellcode[i]))
if test == False:
return "False"

alpha = None
try:
shellcode.decode('ascii')
except:
alpha = False

return alpha
return "True"

# raw_repr: print both binary files as strings escaping
# non-printable characters
Expand Down

0 comments on commit 9b53bc4

Please sign in to comment.