mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-19 21:03:23 -07:00
add reveng-1.30
new command menu: crc help crc calc crc calc -h for help on command set
This commit is contained in:
parent
07b5a3c3ba
commit
fe81b47811
14 changed files with 3685 additions and 6 deletions
52
client/cmdcrc.c
Normal file
52
client/cmdcrc.c
Normal file
|
@ -0,0 +1,52 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2015 iceman <iceman at iuse.se>
|
||||
//
|
||||
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
|
||||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// CRC Calculations from the software reveng commands
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "cmdmain.h"
|
||||
#include "cmdparser.h"
|
||||
#include "cmdcrc.h"
|
||||
#include "reveng/reveng.h"
|
||||
//#include "reveng/cli.h"
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
int CmdCrcCalc(const char *Cmd)
|
||||
{
|
||||
int argc = 0;
|
||||
char Cmd2[CMD_BUFFER_SIZE] = {0x00};
|
||||
char *argv[3];
|
||||
|
||||
for (int i = 0; i < 50; i++)
|
||||
if (Cmd[i]==0x00) argc=i;
|
||||
|
||||
memcpy(Cmd2, Cmd, argc);
|
||||
argv[1]=Cmd2;
|
||||
reveng_main(argc, argv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static command_t CommandTable[] =
|
||||
{
|
||||
{"help", CmdHelp, 1, "This help"},
|
||||
{"calc", CmdCrcCalc, 1, "{ Calculate CRC's }"},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
int CmdCrc(const char *Cmd)
|
||||
{
|
||||
CmdsParse(CommandTable, Cmd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CmdHelp(const char *Cmd)
|
||||
{
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue