tejado / pgoapi

Pokemon Go API lib
Other
1.4k stars 445 forks source link

OSError: dlopen(encrypt.dll, 6): image not found #181

Open neohunter opened 8 years ago

neohunter commented 8 years ago

On OSX El Capitan with pyenv

With HEAD:

2016-08-06 19:21:39,969 [    pgoapi] [ INFO] Adding 'GET_MAP_OBJECTS' to RPC request including arguments
Traceback (most recent call last):
  File "pokecli.py", line 133, in <module>
    main()
  File "pokecli.py", line 128, in main
    response_dict = api.get_map_objects(latitude =position[0], longitude = position[1], since_timestamp_ms = timestamps, cell_id = cell_ids)
  File "/Users/arnoldroa/dev/externals/pogo/pgoapi/pgoapi/pgoapi.py", line 121, in function
    return request.call()
  File "/Users/arnoldroa/dev/externals/pogo/pgoapi/pgoapi/pgoapi.py", line 209, in call
    request.activate_signature(lib_path)
  File "/Users/arnoldroa/dev/externals/pogo/pgoapi/pgoapi/rpc_api.py", line 82, in activate_signature
    ctypes.cdll.LoadLibrary(lib_path)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(encrypt.dll, 6): image not found
morphau commented 8 years ago

Same on windows : File "C:\Python27\lib\ctypes\__init__.py", line 440, in LoadLibrary return self._dlltype(name) File "C:\Python27\lib\ctypes\__init__.py", line 362, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 126] Le module spÚcifiÚ est introuvable

What encrypt.dll we should use ?

kiddkai commented 8 years ago

From the announcement:

To clarify, we didn't get a C&D and took down the repo to prevent legal issues before release. Code to actually implement what we have found is being worked on. Only encrypt.c, rewrites of encrypt.c, and compiled versions of encrypt.c are copyrighted by Niantic and we cannot legally distribute it in any way, even if rewritten. We have thus taken down the repo while we figure out a solution to this. This does not mean that we will not release. We will come up with a solution to the copyright issue, please be patient.

scottie commented 8 years ago

A little birdy told me until further updates come one could stumble upon such files needed at sites like.... Windows EXE: https://www.sendspace.com/file/bq0hcn Source: http://pastebin.com/raw/fCSw0Fz4

Ubuntu 14 64:

apt-get install g++ build-essential
curl http://pastebin.com/raw/fCSw0Fz4 -o encrypt.c
echo '#define __STDC_LIMIT_MACROS' | cat - encrypt.c > temp && mv temp encrypt.c
g++ -shared -fPIC encrypt.c
mv a.out encrypt.dll
cp encrypt.dll /usr/local/lib/encrypt.dll
export LD_LIBRARY_PATH=/usr/local/lib
python pokecli.py  -a ptc -u blah -p blah --location 'London'

Put encrypt here: Linux: /usr/local/lib ?? Windows: system32 ???

This is just here for learning purpose i dont know who uploaded files, a member of the community on the communication channels. I am simply sharing public knowledge one can find anywhere.

nequito commented 8 years ago

@scottie Where shall we place that dll??

valmedia commented 8 years ago

I got AttributeError: ./encrypt.dll: undefined symbol: encrypt.

Solved. Probably need to update that source file with adding extern "C" infront of int encrypt so it is extern "C" int encrypt

Then follow scottie's instruction again.

blackhattristar commented 8 years ago

@scottie So do I just copy and paste apt-get install g++ build-essential curl http://pastebin.com/raw/fCSw0Fz4 -o encrypt.c echo '#define __STDC_LIMIT_MACROS' | cat - encrypt.c > temp && mv temp encrypt.c g++ -shared -fPIC encrypt.c mv a.out encrypt.dll cp encrypt.dll /usr/local/lib/encrypt.dll export LD_LIBRARY_PATH=/usr/local/lib python pokecli.py -a ptc -u blah -p blah --location 'London' into my Digital Ocean Droplet and then run the code?

nequito commented 8 years ago

I keep getting

File "C:\Python27\lib\ctypes\__init__.py", line 362, in __init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 126] The specified module could not be found

Anyone knows what to do?

Forget it, i just figured out. Needed to modify the location

blackhattristar commented 8 years ago

Has anyone got it working on mac?

wkonecny commented 8 years ago

@blackhattristar Yes, i have it working on a Mac. Use the commands @scottie listed and it will work. You must skip the first line and install XCode tools if you haven't already (it includes g++). Or Google on how to install g++ for Mac.

itztq commented 8 years ago

2016-08-07 14:22:28,576 [ search_worker_2][ search][ WARNING] Exception while downloading map: /PokemonGo-Map-develop/pogom/libencrypt.so: wrong ELF class: ELFCLASS64

why??

7AC0B95 commented 8 years ago

@itztq You need to compile for 32 bit

itztq commented 8 years ago

@jfla15 how?

martinohanlon commented 8 years ago

So I compiled encrypt.dll successfully (or certainly with no errors), but Im getting when running pokecli.py:

AttributeError: /usr/local/lib/encrypt.dll: undefined symbol: encrypt

Any thoughts?

elliottcarlson commented 8 years ago

You have a DLL that has different method names than expected. Please see #197.

Commonorx commented 8 years ago

I am on windows. Can someone send me the .dll?

Wolftein commented 8 years ago

I already compile it for Windows, the easy way is to download MinGW / Clion, create a new proyect and your cmake should be something like this

cmake_minimum_required(VERSION 3.6)
project(encrypt)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -static")

set(SOURCE_FILES main.c encrypt.c)
ADD_LIBRARY(encrypt SHARED ${SOURCE_FILES})

Hit build and copy libEncrypt.dll as encrypt.dll

Commonorx commented 8 years ago

That worked to compile but it's not working now anyway it appears. I am getting unknown 6 error now.