Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

32-bit support for hash function #145

Closed
popcornmix opened this issue Nov 7, 2016 · 16 comments
Closed

32-bit support for hash function #145

popcornmix opened this issue Nov 7, 2016 · 16 comments

Comments

@popcornmix
Copy link

I've made a version of the hash function that avoids the 128-bit integers that are not supported on gcc for 32-bit targets like raspberry pi.

I've successfully used this version to get api results on Ubuntu x64
https://gist.github.com/popcornmix/f94e6ab0566a60b7fd1e8acccc0647f8

It should be possible to build a libniantichash-linux-arm-32.so with it.

@fusenuk
Copy link

fusenuk commented Nov 7, 2016

Sorry if I'm not understanding this (maybe you meant there are more steps involved) but I compiled the code you've linked to as libniantichash-linux-arm-32.so and the scanner fails with

Exception while downloading map: NULL pointer access

@popcornmix
Copy link
Author

Yes, I get that too on arm. I don't believe it's related to the hash function (whose code does work on Ubuntu x64), but possibly something else needs updating/fixing?

Anyone know what has failed when you get "Exception while downloading map: NULL pointer access"?

@popcornmix
Copy link
Author

I have sanity checked that the arm32 build produces the same hashes as Ubuntu 64 (both original with 128-bit ints and my version without). Test code here:
https://gist.github.com/popcornmix/8785db9354a2ef0589c55aac78f01f18

@evilmumi
Copy link

evilmumi commented Nov 7, 2016

can you help me. How to build this on raspberry. Or can you please give me the .so file?

@popcornmix
Copy link
Author

popcornmix commented Nov 7, 2016

gcc -Wall -std=c99 -fPIC -shared -o libniantichash-linux-arm-32.so niahash.c

You'll need to put it somewhere it will be found. I put in here:
/usr/local/lib/python2.7/dist-packages/pgoapi/lib/libniantichash-linux-arm-32.so

@kamaze
Copy link

kamaze commented Nov 7, 2016

I think i have the right libencrypt and libniantichash, but still get below error:

Exception while downloading map: NULL pointer access

did anyone meet this problem then solved?

@popcornmix
Copy link
Author

Which libencrypt are you using?

@fusenuk
Copy link

fusenuk commented Nov 7, 2016

PokemonGoMap/PokemonGo-Map@74a49e2 this is supposedly a fix for the null pointer error but I've checked and I have that version of the script and it's still giving me the error so it must be something else.

@popcornmix
Copy link
Author

I was wondering about libencrypt-linux-arm-32.so referenced here:
https://github.com/PokemonGoMap/PokemonGo-Map/pull/1511#issuecomment-258722672

Not sure if arm builds are missing an update there.

@kamaze
Copy link

kamaze commented Nov 7, 2016

@popcornmix I am running CentOS 6.7, and using:

libniantichash-centos-x86-64.so: compiled by my self.
source: https://gist.githubusercontent.com/ZeChrales/28373120d41829d8e4cd3bdc959cb275
build: cc -std=c99 -fPIC -shared -o libniantichash-centos-x86-64.so niahash.c

libencrypt-centos-x86-64.so: fetched from https://github.com/favll/pogom/tree/master/pogom/libencrypt

do you have any idea?

@popcornmix
Copy link
Author

See #148
works for me on raspberry pi.

@nullpixel
Copy link
Contributor

I can't repo the null pointer error. What OS are you running? And steps to repro please 😉

@popcornmix
Copy link
Author

I believe the null pointer came from using the older version of libencrypt.
Updating to version from #148 fixed it for me.

@nullpixel
Copy link
Contributor

Thanks.

@evilmumi
Copy link

evilmumi commented Nov 7, 2016

running for me but no pokemon found. general problem?

@keyphact
Copy link
Member

keyphact commented Nov 9, 2016

Closing as all lib issues are handled by https://github.com/pokecrypt/pokecrypt-pgoapi .

Thanks

@keyphact keyphact closed this as completed Nov 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

6 participants