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

Fixed type error on py36 under Windows #277

Merged
merged 1 commit into from
May 22, 2019

Conversation

SR4ven
Copy link
Collaborator

@SR4ven SR4ven commented May 21, 2019

Following error comes up when running boofuzz on python 3.6/Windows 10.

C:\Users\admin\Documents\boofuzz\examples>python3.6 ftp-simple.py
Traceback (most recent call last):
  File "ftp-simple.py", line 49, in <module>
    main()
  File "ftp-simple.py", line 13, in main
    connection=SocketConnection("127.0.0.1", 80, proto='tcp')),
  File "c:\users\admin\documents\boofuzz\boofuzz\socket_connection.py", line 85, in __init__
    self.MAX_PAYLOADS["udp"] = helpers.get_max_udp_size()
  File "c:\users\admin\documents\boofuzz\boofuzz\helpers.py", line 123, in get_max_udp_size
    lib = ctypes.WinDLL('Ws2_32.dll'.encode('ascii'))
  File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not bytes

This fix is backward compatible to python 2.7
Too bad Travis doesn't support testing python under Windows.

Some references:
https://docs.python.org/3/library/ctypes.html#ctypes.WinDLL
The following were related to a similar error in python 2.7.13
pymedusa/Medusa#1843
https://bugs.python.org/issue29082

@jtpereyda jtpereyda merged commit 3f2a478 into jtpereyda:master May 22, 2019
@SR4ven SR4ven deleted the win_py36_fix branch May 22, 2019 08: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