Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some changes to make vol.py compatible with Python 3.x #801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions vol.py
Expand Up @@ -115,9 +115,9 @@ def print_info():
for c, n in sorted(categories.items()):
lower = (c == commands.Command)
plugins = registry.get_plugin_classes(c, lower = lower)
print "\n"
print "{0}".format(n)
print "-" * len(n)
print ("\n")
print ("{0}".format(n))
print ("-" * len(n))

result = []
max_length = 0
Expand All @@ -130,7 +130,7 @@ def print_info():
max_length = max(len(clsname), max_length)

for (name, doc) in result:
print "{0:{2}} - {1:15}".format(name, doc, max_length)
print ("{0:{2}} - {1:15}".format(name, doc, max_length))

def main():

Expand Down Expand Up @@ -181,19 +181,19 @@ def main():
debug.error("Please specify a location (-l) or filename (-f)")

command.execute()
except exceptions.VolatilityException, e:
print e
except exceptions.VolatilityException as e:
print (e)

if __name__ == "__main__":
config.set_usage(usage = "Volatility - A memory forensics analysis platform.")
config.add_help_hook(list_plugins)

try:
main()
except Exception, ex:
except Exception as ex:
if config.DEBUG:
debug.post_mortem()
else:
raise
except KeyboardInterrupt:
print "Interrupted"
print ("Interrupted")