jekirl / poketrainer

The original Pokemon Go bot
Other
119 stars 56 forks source link

WindowsError 193 / Not a valid Win32 Application #423

Open piprees opened 8 years ago

piprees commented 8 years ago

So when using the encrypt.dll, i get this error just after "Starting RPC login sequence (app simulation)" File "D:\Projects\poketrainer-3vil\pgoapi\pgoapi.py", line 261, in call request.activate_signature(self.get_signature_lib()) File "D:\Projects\poketrainer-3vil\pgoapi\rpc_api.py", line 86, in activate_signature ctypes.cdll.LoadLibrary(lib_path) File "D:\Bin\Python\lib\ctypes\__init__.py", line 443, in LoadLibrary return self._dlltype(name) File "D:\Bin\Python\lib\ctypes\__init__.py", line 365, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is not a valid Win32 application

Any ideas?


Edit: Doesn't seem to be isolated: https://github.com/keyphact/pgoapi/issues/7

jekirl commented 8 years ago

I don't have windows so I can't say for sure...but from reading that it looks like you might need to build a 32bit version of the encrypt.dll manually

xssc commented 8 years ago

This error mean that the dll is 32 bit, not that the dll needs to be.

piprees commented 8 years ago

If the file is different per system, then i'll need to compile it. That seems to be the jist of it from reading other posts.

beeedy commented 8 years ago

Same issue with the DLL not working on a 64-bit OS. Is it possible to get a link to a 64-bit compiled version?

piprees commented 8 years ago

That would be handy, i'm having a right 'mare trying to get this thing compiled. VS trial expired hah!

beeedy commented 8 years ago

I've been trying for awhile as well. Windows is far from my native tongue. Any reason this hasn't been ported to python to make everyone's lives less difficult?

piprees commented 8 years ago

@beeedy Ok, so I managed to get this to compile. First, install Visual Studio community edition. Then, add "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin" to your path Download one of the unknown6 repos from github and open a command prompt in the c_code directory run "cl" in the command prompt to verify is working. If it isn't, or throws an error, you may need to ensure your path variables are set properly. (Search "System Environment Variables" from the start menu) If cl is working fine, run these commands right after each other: D:\Projects\Unknown6-master\c_code>vcvars32 D:\Projects\Unknown6-master\c_code>build_dll.bat

Your encrypt.dll should build. Move that file into the poketrainer directory (next to pokecli.py) and from the command prompt enter: python pokecli.py -e encrypt.dll -i 0

Should work.

EDIT: Still not resolving the issue for me, let me know if you manage to solve this :c

beeedy commented 8 years ago

@teh3vil ahh thank you, it was the system variables that appear to have been throwing me off. If this quick lil' run down could be stickied some how I think more than just myself would find it of use

piprees commented 8 years ago

So, i managed to get it to build and all, but still getting the "This is not a valid win32 application" error when trying to load it. File "D:\Bin\Python\lib\ctypes\__init__.py", line 443, in LoadLibrary return self._dlltype(name) File "D:\Bin\Python\lib\ctypes\__init__.py", line 365, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is not a valid Win32 application


Update: Going deeper... https://mail.python.org/pipermail/tutor/2013-October/097965.html Might be because we're using 64bit versions of python? I can't remember exactly if I installed 32 or 64bit, i think the installer handled that, but worth checking. Will do in the morning.

piprees commented 8 years ago

Nailed It! Re-installed python 32bit and used the encrypt.dll that is being distributed around with the instructions above. Seems like you have to be running 32bit python for it to work. Could definitely be considered we re-write the readme to add specific instructions regarding this.