]>
Commit | Line | Data |
---|---|---|
6658905f | 1 | #include <usb.h> |
2 | #include <stdio.h> | |
3 | #include <unistd.h> | |
4 | #include <stdlib.h> | |
5 | #include <strings.h> | |
6 | #include <string.h> | |
7 | #include <errno.h> | |
8 | ||
cd00aa30 | 9 | #include "prox.h" |
6658905f | 10 | #include "proxmark3.h" |
11 | ||
12 | #define HANDLE_ERROR if (error_occured) { \ | |
13 | error_occured = 0;\ | |
14 | break;\ | |
15 | } | |
16 | ||
17 | int main() | |
18 | { | |
19 | usb_init(); | |
20 | setlogfilename("snooper.log"); | |
21 | ||
22 | return_on_error = 1; | |
23 | ||
24 | while(1) { | |
25 | while(!(devh=OpenProxmark(0))) { sleep(1); } | |
26 | ||
27 | while(1) { | |
28 | UsbCommand cmdbuf; | |
29 | int i; | |
30 | ||
31 | CommandReceived("hi14asnoop"); | |
32 | HANDLE_ERROR | |
33 | ||
34 | ReceiveCommand(&cmdbuf); | |
35 | HANDLE_ERROR | |
36 | for (i=0; i<5; i++) { | |
aa81a8d3 | 37 | ReceiveCommandPoll(&cmdbuf); |
6658905f | 38 | } |
39 | HANDLE_ERROR | |
40 | ||
41 | CommandReceived("hi14alist"); | |
42 | HANDLE_ERROR | |
43 | } | |
44 | } | |
45 | ||
46 | CloseProxmark(); | |
47 | return 0; | |
48 | } |