mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-22 13:10:43 +08:00
add no-fix parameter to data load
to not to change source pm3 files
This commit is contained in:
parent
1e1b669297
commit
6f35f7c878
1 changed files with 11 additions and 5 deletions
|
@ -2032,6 +2032,7 @@ static int CmdLoad(const char *Cmd) {
|
||||||
void *argtable[] = {
|
void *argtable[] = {
|
||||||
arg_param_begin,
|
arg_param_begin,
|
||||||
arg_str1("f", "file", "<fn>", "file to load"),
|
arg_str1("f", "file", "<fn>", "file to load"),
|
||||||
|
arg_lit0("n", "no-fix", "Load data from wile without any transformations"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
@ -2039,6 +2040,9 @@ static int CmdLoad(const char *Cmd) {
|
||||||
int fnlen = 0;
|
int fnlen = 0;
|
||||||
char filename[FILE_PATH_SIZE] = {0};
|
char filename[FILE_PATH_SIZE] = {0};
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||||
|
|
||||||
|
bool nofix = arg_get_lit(ctx, 2);
|
||||||
|
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
|
@ -2069,12 +2073,14 @@ static int CmdLoad(const char *Cmd) {
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "loaded " _YELLOW_("%zu") " samples", g_GraphTraceLen);
|
PrintAndLogEx(SUCCESS, "loaded " _YELLOW_("%zu") " samples", g_GraphTraceLen);
|
||||||
|
|
||||||
|
if (nofix == false) {
|
||||||
uint8_t bits[g_GraphTraceLen];
|
uint8_t bits[g_GraphTraceLen];
|
||||||
size_t size = getFromGraphBuf(bits);
|
size_t size = getFromGraphBuf(bits);
|
||||||
|
|
||||||
removeSignalOffset(bits, size);
|
removeSignalOffset(bits, size);
|
||||||
setGraphBuf(bits, size);
|
setGraphBuf(bits, size);
|
||||||
computeSignalProperties(bits, size);
|
computeSignalProperties(bits, size);
|
||||||
|
}
|
||||||
|
|
||||||
setClockGrid(0, 0);
|
setClockGrid(0, 0);
|
||||||
g_DemodBufferLen = 0;
|
g_DemodBufferLen = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue