This commit is contained in:
osboxes.org 2019-03-14 12:30:32 +01:00
commit 9c2736d1eb
14 changed files with 273 additions and 273 deletions

View file

@ -106,7 +106,7 @@ int usage_hitag_writer(void) {
} }
int usage_hitag_checkchallenges(void) { int usage_hitag_checkchallenges(void) {
PrintAndLogEx(NORMAL, "Check challenges, load a file with save hitag crypto challenges and test them all."); PrintAndLogEx(NORMAL, "Check challenges, load a file with save hitag crypto challenges and test them all.");
PrintAndLogEx(NORMAL, "The file should be 8 * 60 bytes long, the file extension defaults to " _YELLOW_("`.cc`") ); PrintAndLogEx(NORMAL, "The file should be 8 * 60 bytes long, the file extension defaults to " _YELLOW_("`.cc`"));
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Usage: lf hitag cc [h] f <filename w/o extension>"); PrintAndLogEx(NORMAL, "Usage: lf hitag cc [h] f <filename w/o extension>");
PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, "Options:");
@ -289,9 +289,9 @@ int CmdLFHitagSim(const char *Cmd) {
cmdp++; cmdp++;
break; break;
case 'e': case 'e':
param_getstr(Cmd, cmdp+1, filename, sizeof(filename)); param_getstr(Cmd, cmdp + 1, filename, sizeof(filename));
res = loadFileEML(filename, "eml", data, &datalen); res = loadFileEML(filename, "eml", data, &datalen);
if ( res > 0 || datalen != maxdatalen) { if (res > 0 || datalen != maxdatalen) {
PrintAndLogDevice(FAILED, "error, bytes read mismatch file size"); PrintAndLogDevice(FAILED, "error, bytes read mismatch file size");
errors = true; errors = true;
break; break;
@ -300,9 +300,9 @@ int CmdLFHitagSim(const char *Cmd) {
cmdp += 2; cmdp += 2;
break; break;
case 'j': case 'j':
param_getstr(Cmd, cmdp+1, filename, sizeof(filename)); param_getstr(Cmd, cmdp + 1, filename, sizeof(filename));
res = loadFileJSON(filename, "json", data, maxdatalen, &datalen); res = loadFileJSON(filename, "json", data, maxdatalen, &datalen);
if ( res > 0) { if (res > 0) {
errors = true; errors = true;
break; break;
} }
@ -310,9 +310,9 @@ int CmdLFHitagSim(const char *Cmd) {
cmdp += 2; cmdp += 2;
break; break;
case 'b': case 'b':
param_getstr(Cmd, cmdp+1, filename, sizeof(filename)); param_getstr(Cmd, cmdp + 1, filename, sizeof(filename));
res = loadFile(filename, "bin", data, maxdatalen, &datalen); res = loadFile(filename, "bin", data, maxdatalen, &datalen);
if ( res > 0 ) { if (res > 0) {
errors = true; errors = true;
break; break;
} }
@ -333,7 +333,7 @@ int CmdLFHitagSim(const char *Cmd) {
} }
c.arg[0] = (uint32_t)tag_mem_supplied; c.arg[0] = (uint32_t)tag_mem_supplied;
if ( tag_mem_supplied ) { if (tag_mem_supplied) {
memcpy(c.d.asBytes, data, datalen); memcpy(c.d.asBytes, data, datalen);
} }
clearCommandBuffer(); clearCommandBuffer();
@ -447,9 +447,9 @@ int CmdLFHitagCheckChallenges(const char *Cmd) {
free(data); free(data);
return usage_hitag_checkchallenges(); return usage_hitag_checkchallenges();
case 'f': case 'f':
param_getstr(Cmd, cmdp+1, filename, sizeof(filename)); param_getstr(Cmd, cmdp + 1, filename, sizeof(filename));
res = loadFile(filename, "cc", data, 8 * 60, &datalen); res = loadFile(filename, "cc", data, 8 * 60, &datalen);
if ( res > 0 ) { if (res > 0) {
errors = true; errors = true;
break; break;
} }

View file

@ -191,7 +191,7 @@ uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *trace, ui
for (int j = 0; j < data_len && j / 18 < 18; j++) { for (int j = 0; j < data_len && j / 18 < 18; j++) {
uint8_t parityBits = parityBytes[j >> 3]; uint8_t parityBits = parityBytes[j >> 3];
if ( protocol != LEGIC if (protocol != LEGIC
&& protocol != ISO_14443B && protocol != ISO_14443B
&& protocol != ISO_7816_4 && protocol != ISO_7816_4
&& protocol != PROTO_HITAG && protocol != PROTO_HITAG

View file

@ -314,7 +314,7 @@ int loadFile(const char *preferredName, const char *suffix, void *data, size_t m
goto out; goto out;
} }
if ( bytes_read != maxdatalen ) { if (bytes_read != maxdatalen) {
PrintAndLogDevice(WARNING, "Warning, bytes read exeed calling array limit. Max bytes is %d bytes", maxdatalen); PrintAndLogDevice(WARNING, "Warning, bytes read exeed calling array limit. Max bytes is %d bytes", maxdatalen);
bytes_read = maxdatalen; bytes_read = maxdatalen;
} }
@ -470,7 +470,7 @@ int loadFileJSON(const char *preferredName, const char *suffix, void *data, size
if (!strcmp(ctype, "hitag")) { if (!strcmp(ctype, "hitag")) {
size_t sptr = 0; size_t sptr = 0;
for (int i = 0; i < (maxdatalen/4); i++) { for (int i = 0; i < (maxdatalen / 4); i++) {
if (sptr + 4 > maxdatalen) { if (sptr + 4 > maxdatalen) {
retval = 5; retval = 5;
goto out; goto out;

View file

@ -2,7 +2,7 @@
function wait4proxmark_Linux { function wait4proxmark_Linux {
echo >&2 "Waiting for Proxmark to appear..." echo >&2 "Waiting for Proxmark to appear..."
while [ ! -c /dev/ttyACM? -a ! -L /dev/pm3-? ]; do while [ ! -c /dev/ttyACM? -a ! -c /dev/pm3-? ]; do
sleep .1 sleep .1
done done
local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1` local PM3=`ls -1 /dev/pm3-? /dev/ttyACM? 2>/dev/null | head -1`