Merge remote-tracking branch 'upstream/master' into hf_mf_sim

This commit is contained in:
vratiskol 2019-03-20 23:42:00 +01:00
commit f42dd2590e
3 changed files with 14 additions and 7 deletions

View file

@ -1486,8 +1486,8 @@ int CmdEM4x05Info(const char *Cmd) {
static command_t CommandTable[] = {
{"help", CmdHelp, 1, "This help"},
//{"410x_demod", CmdEMdemodASK, 0, "Extract ID from EM410x tag on antenna)"},
{"410x_demod", CmdEM410xDemod, 0, "demodulate a EM410x tag from the GraphBuffer"},
{"410x_read", CmdEM410xRead, 1, "attempt to read and extract tag data"},
{"410x_demod", CmdEM410xDemod, 1, "demodulate a EM410x tag from the GraphBuffer"},
{"410x_read", CmdEM410xRead, 0, "attempt to read and extract tag data"},
{"410x_sim", CmdEM410xSim, 0, "simulate EM410x tag"},
{"410x_brute", CmdEM410xBrute, 0, "reader bruteforce attack by simulating EM410x tags"},
{"410x_watch", CmdEM410xWatch, 0, "watches for EM410x 125/134 kHz tags (option 'h' for 134)"},

View file

@ -144,15 +144,15 @@ int usage_t55xx_wakup() {
int usage_t55xx_chk() {
PrintAndLogEx(NORMAL, "This command uses a dictionary attack");
PrintAndLogEx(NORMAL, "press 'enter' to cancel the command");
PrintAndLogEx(NORMAL, "Usage: lf t55xx bruteforce [h] <m> [i <*.dic>]");
PrintAndLogEx(NORMAL, "Usage: lf t55xx chk [h] <m> [i <*.dic>]");
PrintAndLogEx(NORMAL, "Options:");
PrintAndLogEx(NORMAL, " h - this help");
PrintAndLogEx(NORMAL, " m - use dictionary from flashmemory\n");
PrintAndLogEx(NORMAL, " i <*.dic> - loads a default keys dictionary file <*.dic>");
PrintAndLogEx(NORMAL, "");
PrintAndLogEx(NORMAL, "Examples:");
PrintAndLogEx(NORMAL, " lf t55xx bruteforce m");
PrintAndLogEx(NORMAL, " lf t55xx bruteforce i default_pwd.dic");
PrintAndLogEx(NORMAL, " lf t55xx chk m");
PrintAndLogEx(NORMAL, " lf t55xx chk i default_pwd.dic");
PrintAndLogEx(NORMAL, "");
return 0;
}
@ -1770,11 +1770,15 @@ int CmdT55xxChkPwds(const char *Cmd) {
PrintAndLogEx(INFO, "Testing %08X", testpwd);
AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, true, testpwd);
/*
if (!AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, true, testpwd)) {
PrintAndLogEx(INFO, "Aquireing data from device failed. Quitting");
free(keyBlock);
return 0;
}
*/
found = tryDetectModulation();
if (found)

View file

@ -314,7 +314,7 @@ int getClosestClock(int testclk) {
uint16_t clocks[] = {8, 16, 32, 40, 50, 64, 100, 128, 256, 384};
uint8_t limit[] = {1, 2, 4, 4, 5, 8, 8, 8, 8, 8};
for (uint8_t i = 0; i < 100; i++)
for (uint8_t i = 0; i < 10; i++)
if (testclk >= clocks[i] - limit[i] && testclk <= clocks[i] + limit[i])
return clocks[i];
@ -486,6 +486,9 @@ int DetectStrongAskClock(uint8_t *dest, size_t size, int high, int low, int *clo
getNextHigh(dest, size, high, &i);
getNextLow(dest, size, low, &i);
if (i == size)
return -1;
// clock, numoftimes, first idx
uint16_t tmpclk[10][3] = {
{8, 0, 0},
@ -1398,7 +1401,7 @@ int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert) {
//by marshmellow
//take 10 and 01 and manchester decode
//run through 2 times and take least errCnt
// "7" indicates 00 or 11 wrong bit
// "," indicates 00 or 11 wrong bit
int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos) {
// sanity check