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

Modernize Python 2 code to get ready for Python 3 #3

Closed
wants to merge 1 commit into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented May 2, 2018

See #2 Some minimal, "safe" changes to make the code syntax compatible with both Python 2 and Python 3.

Python 3 syntax compatibility does not mean that the port is complete. More work will be require to complete the port to Python 3.

  • Not yet fixed in 3 files: python3 -c "'\UserInit'" # --> SyntaxError: (unicode error)

$ flake8 . --count --show-source --statistics --select=E901,E999,F821,F822,F823

./registry_persistence.py:35:11: E999 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 19-20: truncated \uXXXX escape
	payload = "c:\windows\system32\userinit.exe,{}".format(executable)
          ^
./cliconfig_dll_hijack.py:18:0: E999 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 162-163: malformed \N character escape
"""
^
./sysprep_dll_hijack.py:22:0: E999 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 280-281: truncated \UXXXXXXXX escape
"""
^
3     E999 SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 162-163: malformed \N character escape
3

@rootm0s
Copy link
Owner

rootm0s commented May 2, 2018

At the moment, this is not a priority. Rewriting the dll hijack functions atm. might port it to python3 later. Unless someone can send a pull-request with all the changes needed, I can merge it.

@cclauss
Copy link
Contributor Author

cclauss commented May 2, 2018

LOL... This is that PR.

@rootm0s
Copy link
Owner

rootm0s commented May 2, 2018

@cclauss Sorry, somehow missed it. I will have a look later.

@cclauss
Copy link
Contributor Author

cclauss commented May 2, 2018

Some files were completely changed by the futurize tool probably because the line endings are Windows line endings instead of Unix line endings.

@cclauss cclauss closed this May 11, 2018
@cclauss cclauss deleted the modernize-python2-code branch May 11, 2018 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants