pgoapi icon indicating copy to clipboard operation
pgoapi copied to clipboard

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

Open neohunter opened this issue 7 years ago • 17 comments

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

neohunter avatar Aug 07 '16 00:08 neohunter

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 ?

morphau avatar Aug 07 '16 01:08 morphau

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.

kiddkai avatar Aug 07 '16 01:08 kiddkai

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.

scottie avatar Aug 07 '16 02:08 scottie

@scottie Where shall we place that dll??

nequito avatar Aug 07 '16 03:08 nequito

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.

valmedia avatar Aug 07 '16 03:08 valmedia

@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?

blackhattristar avatar Aug 07 '16 04:08 blackhattristar

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

nequito avatar Aug 07 '16 05:08 nequito

Has anyone got it working on mac?

blackhattristar avatar Aug 07 '16 05:08 blackhattristar

@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.

wkonecny avatar Aug 07 '16 10:08 wkonecny

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??

itztq avatar Aug 07 '16 12:08 itztq

@itztq You need to compile for 32 bit

7AC0B95 avatar Aug 07 '16 13:08 7AC0B95

@jfla15 how?

itztq avatar Aug 07 '16 13:08 itztq

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?

martinohanlon avatar Aug 07 '16 20:08 martinohanlon

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

elliottcarlson avatar Aug 07 '16 20:08 elliottcarlson

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

Commonorx avatar Aug 08 '16 21:08 Commonorx

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

Wolftein avatar Aug 09 '16 00:08 Wolftein

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

Commonorx avatar Aug 09 '16 03:08 Commonorx