Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

WindowsError 193 / Not a valid Win32 Application #423

Open
piprees opened this issue Aug 7, 2016 · 10 comments
Open

WindowsError 193 / Not a valid Win32 Application #423

piprees opened this issue Aug 7, 2016 · 10 comments

Comments

@piprees
Copy link

piprees commented Aug 7, 2016

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:
pogodevorg/pgoapi#7

@jekirl
Copy link
Owner

jekirl commented Aug 7, 2016

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
Copy link

xssc commented Aug 7, 2016

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

@piprees
Copy link
Author

piprees commented Aug 7, 2016

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
Copy link
Contributor

beeedy commented Aug 7, 2016

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
Copy link
Author

piprees commented Aug 7, 2016

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

@beeedy
Copy link
Contributor

beeedy commented Aug 7, 2016

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
Copy link
Author

piprees commented Aug 8, 2016

@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
Copy link
Contributor

beeedy commented Aug 8, 2016

@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
Copy link
Author

piprees commented Aug 8, 2016

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
Copy link
Author

piprees commented Aug 8, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants