Skip to content

Commit cdd550a

Browse files
committed
Fit for python3
1 parent ff22777 commit cdd550a

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

analysis_tools/opcache_disassembler.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,13 @@ def print_pseudo_code(self, ast):
240240
"""
241241

242242
for line in self.convert_branch_to_pseudo_code(ast, 'class_table', 0).split("\n"):
243-
print self.syntax_highlight(line)
243+
print(self.syntax_highlight(line))
244244

245245
for line in self.convert_branch_to_pseudo_code(ast, 'function_table', 0).split("\n"):
246-
print self.syntax_highlight(line)
246+
print(self.syntax_highlight(line))
247247

248248
for line in self.convert_branch_to_pseudo_code(ast, 'main_op_array', 0).split("\n"):
249-
print self.syntax_highlight(line)
249+
print(self.syntax_highlight(line))
250250

251251
def print_syntax_tree(self, ast):
252252
""" Print the syntax tree
@@ -270,11 +270,11 @@ def disassemble(self, file):
270270
def show_help():
271271
""" Show the help menu """
272272

273-
print "Usage : {0} [-tc] [-a(32|64)] [file]".format(sys.argv[0])
274-
print " " * 4 + "-t Print syntax tree"
275-
print " " * 4 + "-c Print pseudocode"
276-
print " " * 4 + "-n Disables colored output"
277-
print " " * 4 + "-a Architecture (-a32 for 32bit or -a64 for 64bit)"
273+
print("Usage : {0} [-tc] [-a(32|64)] [file]".format(sys.argv[0]))
274+
print(" " * 4 + "-t Print syntax tree")
275+
print(" " * 4 + "-c Print pseudocode")
276+
print(" " * 4 + "-n Disables colored output")
277+
print(" " * 4 + "-a Architecture (-a32 for 32bit or -a64 for 64bit)")
278278

279279

280280
if __name__ == "__main__":

analysis_tools/opcache_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def Z_Val(name, callback = None, unserialize = True):
2323

2424
callback_name = ""
2525
if callback == unserialize_zend_function:
26-
callback_name = "op_array"
26+
callback_name = "op_array"
2727
elif callback == unserialize_class:
2828
callback_name = "class"
2929

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
treelib
2+
construct
3+
termcolor

0 commit comments

Comments
 (0)