GithubHelp home page GithubHelp logo

Cannot compile on OSX about keyhunt HOT 16 CLOSED

 avatar commented on August 22, 2024
Cannot compile on OSX

from keyhunt.

Comments (16)

 avatar commented on August 22, 2024

I fixed it by renaming the function in a different way, by the way now if gives me this problem, even after having installed gmp through brew.

Any idea?

MacBook-Pro keyhunt % make
gcc -O3 -c bloom/bloom.c -o bloom.o -I./bloom/murmur2
gcc -O3 -c bloom/murmur2/MurmurHash2.c -o murmurhash2.o
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c keccak/keccak-tiny.c -o keccak.o -D"memset_b(W,WL,V,OL)=memset(W,V,OL)"
gcc -O3 -c tiny_sha3/sha3.c -o sha3.o
gcc -O3 -c keyhunt.c -o keyhunt.o -lm
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
keyhunt.c:10:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
         ^~~~~~~
1 error generated.
make: *** [default] Error 1

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

Sorry to no anwser before, a was a little busy,

can you add the -lgmp at the en of this line?

gcc -O3 -c keyhunt.c -o keyhunt.o -lm -lgmp

I think that is some issue with configuration of you headers directory,

best regards!

from keyhunt.

 avatar commented on August 22, 2024

Hi @albertobsd, Thank you for your reply,
Unfortunately didn't change, I read it on stackoverflow that had something to do with the headers and xcode,
I tried to add that flag but nothing..

MacBook-Pro keyhunt % make
gcc -O3 -c bloom/bloom.c -o bloom.o -I./bloom/murmur2
gcc -O3 -c bloom/murmur2/MurmurHash2.c -o murmurhash2.o
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c keccak/keccak-tiny.c -o keccak.o -D"memset_b(W,WL,V,OL)=memset(W,V,OL)"
gcc -O3 -c tiny_sha3/sha3.c -o sha3.o
gcc -O3 -c keyhunt.c -o keyhunt.o -lm -lgmp
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -lgmp: 'linker' input unused [-Wunused-command-line-argument]
keyhunt.c:10:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
         ^~~~~~~
1 error generated.
make: *** [default] Error 1

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

Did you install libgmp-dev ?

from keyhunt.

 avatar commented on August 22, 2024

Yes, in mac the equivalent is: brew install gmp

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

OK, can you see if the file gmp.h exist in this folder?

/usr/local/include

In that case include the next line in the Makefile

-I/usr/local/include -L/usr/local/lib

gcc -O3 -c keyhunt.c -o keyhunt.o -lm -I/usr/local/include -L/usr/local/lib

from keyhunt.

 avatar commented on August 22, 2024

It's inside opt

MacBook-Pro include % find /usr /opt -name "gmp.h"

find: /usr/sbin/authserver: Permission denied
/opt/homebrew/include/gmp.h
/opt/homebrew/Cellar/gmp/6.2.1/include/gmp.h

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

OK, then change the directory in the -I param and -L param

gcc -O3 -c keyhunt.c -o keyhunt.o -lm -I/opt/homebrew/Cellar/gmp/6.2.1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1/lib/

from keyhunt.

 avatar commented on August 22, 2024

We're doing progress but still nothing..

MacBook-Pro keyhunt % make
gcc -O3 -c bloom/bloom.c -o bloom.o -I./bloom/murmur2
gcc -O3 -c bloom/murmur2/MurmurHash2.c -o murmurhash2.o
gcc -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
gcc -O3 -c keccak/keccak-tiny.c -o keccak.o -D"memset_b(W,WL,V,OL)=memset(W,V,OL)"
gcc -O3 -c tiny_sha3/sha3.c -o sha3.o
gcc -O3 -c keyhunt.c -o keyhunt.o -lm -I/opt/homebrew/Cellar/gmp/6.2.1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1/lib/
clang: warning: -lm: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/opt/homebrew/Cellar/gmp/6.2.1/lib/' [-Wunused-command-line-argument]
keyhunt.c:71:6: error: conflicting types for 'heapsort'
void heapsort(char  *arr, int int64_t);
     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:309:6: note: previous declaration is here
int      heapsort(void *__base, size_t __nel, size_t __width,
         ^
keyhunt.c:748:62: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                        fprintf(stderr,"[E] error bloom_init for %u elements\n",bsgs_m);
                                                                                 ~~             ^~~~~~
                                                                                 %llu
keyhunt.c:767:62: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("[+] Init bloom filter for %u elements : %.2f MB\n",bsgs_m,(float)((uint32_t)bloom_bPx.bytes/(uint32_t)1048576));
                                                  ~~                       ^~~~~~
                                                  %llu
keyhunt.c:811:49: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                printf("[+] Precalculating %u aMP points\n",bsgs_m);
                                                           ~~               ^~~~~~
                                                           %llu
keyhunt.c:825:48: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                        printf("[+] Precalculating %u aMP points\n",bsgs_m);
                                                   ~~               ^~~~~~
                                                   %llu
keyhunt.c:865:48: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                                printf("[+] Precalculating %u bP points\n",bsgs_m);
                                                           ~~              ^~~~~~
                                                           %llu
keyhunt.c:882:47: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                        printf("[+] precalculating %u bP points\n",bsgs_m);
                                                   ~~              ^~~~~~
                                                   %llu
keyhunt.c:898:38: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                printf("[+] Sorting %u elements\n",bsgs_m);
                                    ~~             ^~~~~~
                                    %llu
keyhunt.c:1174:12: warning: passing 'char *' to parameter of type 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types with different sign
      [-Wpointer-sign]
                shake256(digest, 256,(const uint8_t* ) pkey, length);
                         ^~~~~~
./keccak/keccak-tiny.h:14:1: note: passing argument to parameter here
decshake(256)
^
./keccak/keccak-tiny.h:8:27: note: expanded from macro 'decshake'
  int shake##bits(uint8_t*, size_t, const uint8_t*, size_t);
                          ^
keyhunt.c:1452:30: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
        printf("Testing Keys %lu\n",count);
                             ~~~    ^~~~~
                             %llu
keyhunt.c:1663:30: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
        printf("Testing Keys %lu\n",count);
                             ~~~    ^~~~~
                             %llu
keyhunt.c:1689:23: error: too few arguments to function call, expected 4, have 2
        heapsort(arr,n);
        ~~~~~~~~      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:309:1: note: 'heapsort' declared here
int      heapsort(void *__base, size_t __nel, size_t __width,
^
keyhunt.c:1813:6: error: conflicting types for 'heapsort'
void heapsort(char  *arr, int n)  {
     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:309:6: note: previous declaration is here
int      heapsort(void *__base, size_t __nel, size_t __width,
         ^
keyhunt.c:2270:55: warning: passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'int64_t *' (aka 'long long *') converts between pointers to integer
      types with different sign [-Wpointer-sign]
                                                r = bsgs_searchbinary(bPtable,xpoint_raw,bsgs_m,&j);
                                                                                                ^~
keyhunt.c:1932:81: note: passing argument to parameter 'r_value' here
int bsgs_searchbinary(struct bsgs_xvalue *buffer,char *data,int64_t _N,int64_t *r_value)  {
                                                                                ^
11 warnings and 3 errors generated.
make: *** [default] Error 1

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

ok, this is conflic bewteen that heapsort and my custom heapsort, can you find and remplace all the coincidences of the "heapsort" to "heapsort_2" in the keyhunt.c file

Sorry i need to update all my code to solve this, if you can wait some day or two until i solve those things.

best regards!

from keyhunt.

 avatar commented on August 22, 2024

It started but it pop out this error now:

MacBook-Pro keyhunt % ./keyhunt -m bsgs -f ../120.txt -r 800000000000000000000000000000:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -t 2
[+] Version 0.1.20210112 BSGS
[+] Setting mode BSGS
[+] Setting 2 threads
[+] Opening file ../120.txt
[+] Added 1 points from file
[+] Setting N up to 17592186044416.
[+] Init bloom filter for 4194304 elements : 7.00 MB
[+] Allocating 128.00 MB for aMP Points
[+] Precalculating 4194304 aMP points
[+] Allocating 160.00 MB for bP Points
[+] precalculating 4194304 bP points
[+] Sorting 4194304 elements
[+] Thread 1: 0000000000000000000000000000000000800000000000000000000000000000
zsh: segmentation fault  ./keyhunt -m bsgs -f ../120.txt -r  -t 2

I changed also the Makefile line btw to: gcc -o keyhunt keyhunt.o base58.o rmd160.o sha256.o bloom.o murmurhash2.o keccak.o -lgmp -lm -lpthread -I/opt/homebrew/Cellar/gmp/6.2.1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1/lib/
otherwise will still prompt some other conflict errors..

Thank you so much anyway @albertobsd!
I'll wait futures updates from you, if you want to bring it also to mac users 👍

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

The -r option need a parameter of a range from:to example -r F0000000:FFFFFFFF

if you need a Random is with upper case R this is only -R

from keyhunt.

 avatar commented on August 22, 2024

It's not that, something went wrong while doing make...

a@a-MacBook-Pro keyhunt % ./keyhunt -m bsgs -f ../120.txt -R 800000000000000000000000000000:FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF     
[+] Version 0.1.20210112 BSGS
[+] Setting mode BSGS
[+] Setting random mode.
[+] Opening file ../120.txt
[+] Added 1 points from file
[+] Setting N up to 17592186044416.
[+] Init bloom filter for 4194304 elements : 7.00 MB
[+] Allocating 128.00 MB for aMP Points
[+] Precalculating 4194304 aMP points
[+] Allocating 160.00 MB for bP Points
[+] precalculating 4194304 bP points
[+] Sorting 4194304 elements
[+] Thread 0: af41b9d521f21b466da9d454ec6b486232f7b1f641a4c333a92d1fc3e34b19cc
keyhunt(2477,0x16dce3000) malloc: *** error for object 0x4b72c55a98a602ff: pointer being freed was not allocated
keyhunt(2477,0x16dce3000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./keyhunt -m bsgs -f ../120.txt -R 
a@a-MacBook-Pro keyhunt % ./keyhunt -m bsgs -f ../120.txt                                                                 
[+] Version 0.1.20210112 BSGS
[+] Setting mode BSGS
[+] Opening file ../120.txt
[+] Added 1 points from file
[+] Setting N up to 17592186044416.
[+] Init bloom filter for 4194304 elements : 7.00 MB
[+] Allocating 128.00 MB for aMP Points
[+] Precalculating 4194304 aMP points
[+] Allocating 160.00 MB for bP Points
[+] precalculating 4194304 bP points
[+] Sorting 4194304 elements
[+] Thread 0: 5590f388e5b3568581fa2c41ec2ca029a9863c48636887653680557c2dc95f77
zsh: segmentation fault  ./keyhunt -m bsgs -f ../120.txt
a@a-MacBook-Pro keyhunt % 

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

Interesting there is some error in some devices, idk why is this happening i need to debug in some of those devices.

I will notifiyou when I solve this error.

Best regards!

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

Can you check if the new version works in Mac?

from keyhunt.

albertobsd avatar albertobsd commented on August 22, 2024

This shoulbe solved now those errors were related to an keccak librery but is not loger use.

from keyhunt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.