]> git.zerfleddert.de Git - proxmark3-svn/blame - client/cmdmain.c
Merge branch 'master' into fix_iso15693_fpga
[proxmark3-svn] / client / cmdmain.c
CommitLineData
a553f267 1//-----------------------------------------------------------------------------
2// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
3//
4// This code is licensed to you under the terms of the GNU GPL, version 2 or,
5// at your option, any later version. See the LICENSE.txt file for the text of
6// the license.
7//-----------------------------------------------------------------------------
8// Main command parser entry point
9//-----------------------------------------------------------------------------
10
23af9327 11#include "cmdmain.h"
12
13#include <pthread.h>
7fe9b0b7 14#include <stdio.h>
15#include <stdlib.h>
16#include <unistd.h>
17#include <string.h>
18#include "cmdparser.h"
902cb3c0 19#include "proxmark3.h"
7fe9b0b7 20#include "usb_cmd.h"
21#include "ui.h"
22#include "cmdhf.h"
23#include "cmddata.h"
24#include "cmdhw.h"
25#include "cmdlf.h"
9440213d 26#include "util.h"
ec9c7112 27#include "util_posix.h"
1d59cd8d 28#include "cmdscript.h"
8d7d7b61 29#include "emv/cmdemv.h" // EMV
43591e64 30#ifdef WITH_SMARTCARD
31 #include "cmdsmartcard.h"
32#endif
e772353f 33
7fe9b0b7 34static int CmdHelp(const char *Cmd);
35static int CmdQuit(const char *Cmd);
cf9aa77d 36
fd368d18 37
7fe9b0b7 38static command_t CommandTable[] =
39{
8d7d7b61 40 {"help", CmdHelp, 1, "This help. Use '<command> help' for details of a particular command."},
41 {"data", CmdData, 1, "{ Plot window / data buffer manipulation... }"},
42 {"hf", CmdHF, 1, "{ High Frequency commands... }"},
43 {"hw", CmdHW, 1, "{ Hardware commands... }"},
44 {"lf", CmdLF, 1, "{ Low Frequency commands... }"},
43591e64 45#ifdef WITH_SMARTCARD
8d7d7b61 46 {"emv", CmdEMV, 1, "{ EMV iso14443 and iso7816... }"},
47 {"sc", CmdSmartcard,1,"{ Smartcard commands... }"},
48#else
49 {"emv", CmdEMV, 1, "{ EMV iso14443 }"},
43591e64 50#endif
8d7d7b61 51 {"script",CmdScript,1, "{ Scripting commands }"},
52 {"quit", CmdQuit, 1, "Exit program"},
53 {"exit", CmdQuit, 1, "Exit program"},
54 {NULL, NULL, 0, NULL}
7fe9b0b7 55};
56
57c69556
MHS
57command_t* getTopLevelCommandTable()
58{
59 return CommandTable;
60}
f5ecd97b 61
ad939de5 62static int CmdHelp(const char *Cmd)
7fe9b0b7 63{
64 CmdsHelp(CommandTable);
65 return 0;
66}
67
ad939de5 68static int CmdQuit(const char *Cmd)
7fe9b0b7 69{
2487dfeb 70 return 99;
7fe9b0b7 71}
f46c3663 72
7fe9b0b7 73//-----------------------------------------------------------------------------
74// Entry point into our code: called whenever the user types a command and
75// then presses Enter, which the full command line that they typed.
76//-----------------------------------------------------------------------------
2487dfeb 77int CommandReceived(char *Cmd) {
78 return CmdsParse(CommandTable, Cmd);
7fe9b0b7 79}
80
Impressum, Datenschutz