Proxmark3 community

Research, development and trades concerning the powerful Proxmark3 device.

Remember; sharing is caring. Bring something back to the community.


"Learn the tools of the trade the hard way." +Fravia

You are not logged in.

Announcement

Time changes and with it the technology
Proxmark3 @ discord

Users of this forum, please be aware that information stored on this site is not private.

#1 2016-10-21 00:51:30

mastahofdesastah
Contributor
Registered: 2016-07-06
Posts: 9

[Solved] Compiling Peter Fillmore's fork

Hi all

Im a real noob in coding but usually i get things working with my google-fu.
I succesfull compiled on kalli and win8/10 the original proxmark3 project and also Iceman's fork.
With the instruction given, they compile nice on MS and Linux.

Im desperately try to compile Peter Fillmore's fork without success, on ever platform i try. Despite the other forks compile nicely on the same system/machine. Cant open a issue on github and he is not responsive to mails etc.
Also other members of the forum had the same problems:
http://www.proxmark.org/forum/viewtopic.php?id=2103&p=2
looks like this when start compiling in client subfolder:

[== Undefined ==]
gcc -std=c99 -I. -I../include -I../common -I/opt/local/include -I../liblua -Wall  -g -O4 -DHAVE_GUI -c -o obj/proxmark3.o proxmark3.c
In file included from proxmark3.h:16:0,
                 from proxmark3.c:20:
/usr/include/inttypes.h:290:8: error: unknown type name ‘intmax_t’
 extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
        ^
/usr/include/inttypes.h:290:26: error: unknown type name ‘intmax_t’
 extern intmax_t imaxabs (intmax_t __n) __THROW __attribute__ ((__const__));
                          ^
/usr/include/inttypes.h:293:27: error: unknown type name ‘intmax_t’
 extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
                           ^
/usr/include/inttypes.h:293:45: error: unknown type name ‘intmax_t’
 extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom)
                                             ^
/usr/include/inttypes.h:297:8: error: unknown type name ‘intmax_t’
 extern intmax_t strtoimax (const char *__restrict __nptr,
        ^
/usr/include/inttypes.h:301:8: error: unknown type name ‘uintmax_t’
 extern uintmax_t strtoumax (const char *__restrict __nptr,
        ^
/usr/include/inttypes.h:305:8: error: unknown type name ‘intmax_t’
 extern intmax_t wcstoimax (const __gwchar_t *__restrict __nptr,
        ^
/usr/include/inttypes.h:310:8: error: unknown type name ‘uintmax_t’
 extern uintmax_t wcstoumax (const __gwchar_t *__restrict __nptr,
        ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from proxmark3.c:12:
/usr/include/inttypes.h:324:1: error: expected ‘,’ or ‘;’ before ‘strtoimax’
 __NTH (strtoimax (const char *__restrict nptr, char **__restrict endptr,
 ^
/usr/include/inttypes.h:336:1: error: expected ‘,’ or ‘;’ before ‘strtoumax’
 __NTH (strtoumax (const char *__restrict nptr, char **__restrict endptr,
 ^
/usr/include/inttypes.h:348:1: error: expected ‘,’ or ‘;’ before ‘wcstoimax’
 __NTH (wcstoimax (const __gwchar_t *__restrict nptr,
 ^
/usr/include/inttypes.h:362:1: error: expected ‘,’ or ‘;’ before ‘wcstoumax’
 __NTH (wcstoumax (const __gwchar_t *__restrict nptr,
 ^
In file included from uart.h:52:0,
                 from proxmark3.c:23:
/usr/include/x86_64-linux-gnu/sys/types.h:197:1: error: conflicting types for ‘int64_t’
 __intN_t (64, __DI__);
 ^
In file included from /usr/include/inttypes.h:27:0,
                 from proxmark3.h:16,
                 from proxmark3.c:20:
../include/stdint.h:17:25: note: previous declaration of ‘int64_t’ was here
 typedef long long int   int64_t;

When you start in the root proxmark3 folder:

DWITH_ICLASS -DWITH_LEGICRF -DWITH_HITAG -DWITH_EMV -DWITH_CRC -DON_DEVICE -fno-strict-aliasing -ffunction-sections -fdata-sections -I. -Os  -mthumb-interwork -o obj/optimized_cipher.o optimized_cipher.c 
In file included from /usr/include/newlib/sys/types.h:63:0,
                 from /usr/include/newlib/stdio.h:48,
                 from optimized_cipher.c:64:
/usr/include/newlib/sys/_stdint.h:31:19: error: conflicting types for 'int32_t'
 typedef __int32_t int32_t ;
                   ^
In file included from optimized_cipher.h:3:0,
                 from optimized_cipher.c:63:
../include/stdint.h:16:18: note: previous declaration of 'int32_t' was here
 typedef int      int32_t;
                  ^
In file included from /usr/include/newlib/sys/types.h:63:0,
                 from /usr/include/newlib/stdio.h:48,
                 from optimized_cipher.c:64:
/usr/include/newlib/sys/_stdint.h:32:20: error: conflicting types for 'uint32_t'
 typedef __uint32_t uint32_t ;
                    ^
In file included from optimized_cipher.h:3:0,
                 from optimized_cipher.c:63:
../include/stdint.h:21:24: note: previous declaration of 'uint32_t' was here
 typedef unsigned int   uint32_t;
                        ^
../common/Makefile.common:85: die Regel für Ziel „obj/optimized_cipher.o“ scheiterte
make[1]: *** [obj/optimized_cipher.o] Fehler 1
make[1]: Verzeichnis „/root/proxmark3/armsrc“ wird verlassen
Makefile:11: die Regel für Ziel „armsrc/all“ scheiterte
make: *** [armsrc/all] Fehler 2

This can be fixed by:
https://github.com/Proxmark/proxmark3/issues/116

Tried to comment out the offensive parts, but it goes on on every file it tries to compile.

At the moment im stuck here:

gcc -std=c99 -I. -I../include -I../common -I/opt/local/include -I../liblua -Wall  -g -O4 -DHAVE_GUI -c -o obj/nonce2key/nonce2key.o nonce2key/nonce2key.c
nonce2key/nonce2key.c: In function ‘nonce2key’:
nonce2key/nonce2key.c:15:13: error: expected ‘)’ before ‘PRIx64’
 #define llx PRIx64
             ^
nonce2key/nonce2key.c:51:46: note: in expansion of macro ‘llx’
   PrintAndLog("\nuid(%08x) nt(%08x) par(%016"llx") ks(%016"llx") nr(%08"llx")\n\n",uid,nt,par_info,ks_info,nr);
                                              ^~~
nonce2key/nonce2key.c:15:13: error: expected ‘)’ before ‘PRIx64’
 #define llx PRIx64
             ^
nonce2key/nonce2key.c:108:19: note: in expansion of macro ‘llx’
      printf("p1:%"llx" p2:%"llx" p3:%"llx" key:%012"llx"\n",(uint64_t)(p1-last_keylist),(uint64_t)(p2-state_s),(uint64_t)(p3-last_keylist),*p1);
                   ^~~
nonce2key/nonce2key.c:108:17: warning: spurious trailing ‘%’ in format [-Wformat=]
      printf("p1:%"llx" p2:%"llx" p3:%"llx" key:%012"llx"\n",(uint64_t)(p1-last_keylist),(uint64_t)(p2-state_s),(uint64_t)(p3-last_keylist),*p1);
                 ^
Makefile:134: die Regel für Ziel „obj/nonce2key/nonce2key.o“ scheiterte
make: *** [obj/nonce2key/nonce2key.o] Fehler 1

So i think the firmware is build, but it stops again @the client compile, like described.
As i found out, it must be something with the compiler, but i dont get it.
Somebody can point me to the right direction?
thanks




Solution:
One solution seems to be to remove the stdint.h from the /include directory.
After that some formatting errors have to be corrected, and it compile.
If requested, i will post detailed informations. But seems this build is not full functional, some emv functions are not working...

Last edited by mastahofdesastah (2016-10-29 11:00:07)

Offline

#2 2016-11-27 16:47:47

Exploitagency
Contributor
Registered: 2015-11-10
Posts: 24
Website

Re: [Solved] Compiling Peter Fillmore's fork

What works vs what doesn't work?
I'm about to start looking into peter fillmores fork.

Can you push your mods to github?

Offline

#3 2017-02-14 11:05:27

iceman
Administrator
Registered: 2013-04-25
Posts: 9,538
Website

Re: [Solved] Compiling Peter Fillmore's fork

@mastahofdesastah   icemanfork now can compile and run some commands from Peter Fillmore's fork.

Offline

#4 2017-02-20 23:53:58

mastahofdesastah
Contributor
Registered: 2016-07-06
Posts: 9

Re: [Solved] Compiling Peter Fillmore's fork

@Exploitagency Im really sorry for the late answer. Im very new in coding and github stuff. No idea how to upload the mods and i didnt remember what i changed. Maybe i broke some other stuff, but the EMV fubctions are definitely working. But after i months of trying to get it work, i switched to his other repo: https://github.com/peterfillmore/proxmark3-14a-TagFuzz
It was easier to get it to compile, and it has more EMV funcitionalities.
If you want i can upload my files to a sharehoster or similar...
I have a NFC Pay terminal and tested against it. The terminal didnt accept the payment.

@Iceman I tried your new repo. But it doesent work at all. After it reads the card it stops, the terminal doesent reconize anything... Feel free to askme for testing, how i said i have a working payment terminal and several Visa and Mastercards to test.

Offline

#5 2017-02-21 00:09:49

iceman
Administrator
Registered: 2013-04-25
Posts: 9,538
Website

Re: [Solved] Compiling Peter Fillmore's fork

Sweet,  I'll need to look into that branch again.

Did you compile it with the #define macros uncommented?

Offline

#6 2017-02-21 01:06:25

mastahofdesastah
Contributor
Registered: 2016-07-06
Posts: 9

Re: [Solved] Compiling Peter Fillmore's fork

iceman wrote:

Sweet,  I'll need to look into that branch again.

Did you compile it with the #define macros uncommented?

Sure, how you explained in the video. Commands are there, when i choose "HF emv trans" it reads the card (im not sure if it reads) and thats all.
same as here: http://www.proxmark.org/forum/viewtopic.php?id=4556
cant dump, and proxmark isn't replaying. Or i do something wrong...

What i do is:
execute --> hf emv trans ( gives me #db# SELECT AID COMPLETED, #db# EMV TRANSACTION FINISHED) --> hold it to the Terminal and nothing happens.

Im not at my linux machine now, tomorrow i try with the peters branch and tell you the exact procedere, how i managed to get the terminal respondig. I remember that it ask to swipe or put in the card after i hold the pm3 on it, so something is not working or my terminal has some protection or they implemented something new to the protocol...

Glad to help you if i can.

Last edited by mastahofdesastah (2017-02-21 01:12:50)

Offline

Board footer

Powered by FluxBB