]> git.zerfleddert.de Git - proxmark3-svn/blame - client/cmdhflegic.c
Change -std=c99 to -std=gnu99 to be able to compile libusb-0.1.* which uses u_int...
[proxmark3-svn] / client / cmdhflegic.c
CommitLineData
8e220a91 1#include <stdio.h>
2#include <string.h>
7fe9b0b7 3#include "proxusb.h"
4#include "cmdparser.h"
5#include "cmdhflegic.h"
6
7static int CmdHelp(const char *Cmd);
8
9int CmdLegicRFRead(const char *Cmd)
10{
8e220a91 11 int byte_count=0,offset=0;
12 sscanf(Cmd, "%i %i", &offset, &byte_count);
13 if(byte_count == 0) byte_count = 256;
14 if(byte_count + offset > 256) byte_count = 256 - offset;
15 UsbCommand c={CMD_READER_LEGIC_RF, {offset, byte_count, 0}};
7fe9b0b7 16 SendCommand(&c);
17 return 0;
18}
19
20static command_t CommandTable[] =
21{
22 {"help", CmdHelp, 1, "This help"},
8e220a91 23 {"reader", CmdLegicRFRead, 0, "[offset [length]] -- read bytes from a LEGIC card"},
7fe9b0b7 24 {NULL, NULL, 0, NULL}
25};
26
27int CmdHFLegic(const char *Cmd)
28{
29 CmdsParse(CommandTable, Cmd);
30 return 0;
31}
32
33int CmdHelp(const char *Cmd)
34{
35 CmdsHelp(CommandTable);
36 return 0;
37}
Impressum, Datenschutz