]>
Commit | Line | Data |
---|---|---|
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 | ||
9 | #include "prox.h" | |
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++) { | |
37 | ReceiveCommandPoll(&cmdbuf); | |
38 | } | |
39 | HANDLE_ERROR | |
40 | ||
41 | CommandReceived("hi14alist"); | |
42 | HANDLE_ERROR | |
43 | } | |
44 | } | |
45 | ||
46 | CloseProxmark(); | |
47 | return 0; | |
48 | } |