Skip to content

Commit 9b53bc4

Browse files
committed
improvements
1 parent 22426a4 commit 9b53bc4

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
common/__pycache__/*
2-
modules/__pycache__/*
3-
modules/dev/__pycache__/*
4-
modules/formats/__pycache__/*
5-
common/lib/__pycache__/*
1+
Sickle/__pycache__/*
2+
Sickle/common/__pycache__/*
3+
Sickle/common/lib/__pycache__/*
4+
Sickle/common/formats/__pycache__/*
5+
Sickle/modules/__pycache__/*
6+
Sickle/modules/dev/__pycache__/*
-1.85 KB
Loading

Documentation/pictures/examine.png

-334 KB
Binary file not shown.

Sickle/modules/dev/diff.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ def asm_diff(self, fileobj):
8989

9090
print(colors.BOLD, colors.GREEN)
9191
tables = f"{ansi_ljust('FILE1', 26, ' ', 'l')}{ansi_ljust('FILE2', 54, ' ', 'l')}"
92-
print(tables)
93-
print(colors.BLUE)
94-
95-
print("Architecture\tAlphanumeric\tSize (bytes)\tSource\tArchitecture\tAlphanumeric\tSize (bytes)\tSource{: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")
10093

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+
10197
print(colors.BOLD, colors.GREEN)
10298
tables = f"{ansi_ljust('Disassembly', 29, ' ', 'l')}{ansi_ljust('Disassembly', 54, ' ', 'l')}"
10399
print(tables)
@@ -196,14 +192,12 @@ def disassemble_bytes(self, source_file, shellcode, sc_size):
196192

197193
# check_alpha: check if the buffer is completely alphanumeric
198194
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"
199199

200-
alpha = None
201-
try:
202-
shellcode.decode('ascii')
203-
except:
204-
alpha = False
205-
206-
return alpha
200+
return "True"
207201

208202
# raw_repr: print both binary files as strings escaping
209203
# non-printable characters

0 commit comments

Comments
 (0)