fix reveng -g to correctly take 1024 hexstring as input
This commit is contained in:
1 parent
7414cdf359
commit
2602661435
3 files changed
+10
-6
No files matched your search
+8
-5
@@ -451,9 +451,11 @@ static int CmdrevengSearch(const char *Cmd) {
|
||||
|
||||
#define NMODELS 106
|
||||
|
||||
char inHexStr[256] = {0x00};
|
||||
char inHexStr[1024] = {0};
|
||||
int dataLen = param_getstr(Cmd, 0, inHexStr, sizeof(inHexStr));
|
||||
if (dataLen < 4) return 0;
|
||||
if (dataLen < 4) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// these two arrays, must match preset size.
|
||||
char *Models[NMODELS];
|
||||
@@ -463,14 +465,15 @@ static int CmdrevengSearch(const char *Cmd) {
|
||||
char result[50 + 1] = {0};
|
||||
char revResult[50 + 1] = {0};
|
||||
int ans = GetModels(Models, &count, width);
|
||||
bool found = false;
|
||||
if (!ans) {
|
||||
if (ans == 0) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
free(Models[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
|
||||
str_lower(inHexStr);
|
||||
|
||||
// try each model and get result
|
||||
@@ -576,7 +579,7 @@ static int CmdrevengSearch(const char *Cmd) {
|
||||
}
|
||||
|
||||
int CmdCrc(const char *Cmd) {
|
||||
char c[100 + 7];
|
||||
char c[1024 + 7];
|
||||
snprintf(c, sizeof(c), "reveng ");
|
||||
snprintf(c + strlen(c), sizeof(c) - strlen(c), Cmd, strlen(Cmd));
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ int MADCheck(uint8_t *sector0, uint8_t *sector16, bool verbose, bool *haveMAD2)
|
||||
|
||||
if (verbose && !res2) {
|
||||
PrintAndLogEx(SUCCESS, "CRC8...... 0x%02X ( %s )", sector16[0], _GREEN_("ok"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MA (multi-application card)
|
||||
|
||||
Reference in new issue
Block a user