mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Messy messy. I probably lost my commit texts now...
Merge branch 'master' of https://github.com/RfidResearchGroup/proxmark3
This commit is contained in:
commit
54ea65bf34
34 changed files with 103 additions and 120 deletions
|
@ -195,7 +195,7 @@ void RunMod() {
|
||||||
MifareCGetBlock(params, 0, testBlock0);
|
MifareCGetBlock(params, 0, testBlock0);
|
||||||
|
|
||||||
if (memcmp(testBlock0, newBlock0, 16) == 0) {
|
if (memcmp(testBlock0, newBlock0, 16) == 0) {
|
||||||
DbpString("Cloned successfull!");
|
DbpString("Cloned successful!");
|
||||||
cardRead[selected] = 0; // Only if the card was cloned successfully should we clear it
|
cardRead[selected] = 0; // Only if the card was cloned successfully should we clear it
|
||||||
playing = 0;
|
playing = 0;
|
||||||
iGotoRecord = 1;
|
iGotoRecord = 1;
|
||||||
|
|
|
@ -139,8 +139,8 @@ void EPA_Finish() {
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Parses DER encoded data, e.g. from EF.CardAccess and fills out the given
|
// Parses DER encoded data, e.g. from EF.CardAccess and fills out the given
|
||||||
// structs. If a pointer is 0, it is ignored.
|
// structs. If a pointer is 0, it is ignored.
|
||||||
// The function returns 0 on success and if an error occured, it returns the
|
// The function returns 0 on success and if an error occurred, it returns the
|
||||||
// offset where it occured.
|
// offset where it occurred.
|
||||||
//
|
//
|
||||||
// TODO: This function can access memory outside of the given data if the DER
|
// TODO: This function can access memory outside of the given data if the DER
|
||||||
// encoding is broken
|
// encoding is broken
|
||||||
|
@ -274,7 +274,7 @@ void EPA_PACE_Collect_Nonce(PacketCommandNG *c) {
|
||||||
* ack layout:
|
* ack layout:
|
||||||
* arg:
|
* arg:
|
||||||
* 1. element
|
* 1. element
|
||||||
* step where the error occured or 0 if no error occured
|
* step where the error occurred or 0 if no error occurred
|
||||||
* 2. element
|
* 2. element
|
||||||
* return code of the last executed function
|
* return code of the last executed function
|
||||||
* d:
|
* d:
|
||||||
|
|
|
@ -427,7 +427,7 @@ static bool hitag2_password(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blocknr > 7) {
|
if (blocknr > 7) {
|
||||||
DbpString("Read succesful!");
|
DbpString("Read successful!");
|
||||||
bSuccessful = true;
|
bSuccessful = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,7 @@ static bool hitag2_password(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t
|
||||||
|
|
||||||
// Unexpected response
|
// Unexpected response
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Uknown frame length: %d", rxlen);
|
Dbprintf("Unknown frame length: %d", rxlen);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -532,7 +532,7 @@ static bool hitag2_crypto(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t *
|
||||||
blocknr++;
|
blocknr++;
|
||||||
}
|
}
|
||||||
if (blocknr > 7) {
|
if (blocknr > 7) {
|
||||||
DbpString("Read succesful!");
|
DbpString("Read successful!");
|
||||||
bSuccessful = true;
|
bSuccessful = true;
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -546,7 +546,7 @@ static bool hitag2_crypto(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t *
|
||||||
|
|
||||||
// Unexpected response
|
// Unexpected response
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Uknown frame length: %d", rxlen);
|
Dbprintf("Unknown frame length: %d", rxlen);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -588,7 +588,7 @@ static bool hitag2_authenticate(uint8_t *rx, const size_t rxlen, uint8_t *tx, si
|
||||||
memcpy(tx, NrAr, 8);
|
memcpy(tx, NrAr, 8);
|
||||||
bCrypto = true;
|
bCrypto = true;
|
||||||
} else {
|
} else {
|
||||||
DbpString("Authentication succesful!");
|
DbpString("Authentication successful!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ static bool hitag2_authenticate(uint8_t *rx, const size_t rxlen, uint8_t *tx, si
|
||||||
|
|
||||||
// Unexpected response
|
// Unexpected response
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Uknown frame length: %d", rxlen);
|
Dbprintf("Unknown frame length: %d", rxlen);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -655,7 +655,7 @@ static bool hitag2_test_auth_attempts(uint8_t *rx, const size_t rxlen, uint8_t *
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Uknown frame length: %d", rxlen);
|
Dbprintf("Unknown frame length: %d", rxlen);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -696,7 +696,7 @@ static bool hitag2_read_uid(uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t
|
||||||
break;
|
break;
|
||||||
// Unexpected response
|
// Unexpected response
|
||||||
default: {
|
default: {
|
||||||
Dbprintf("Uknown frame length: %d", rxlen);
|
Dbprintf("Unknown frame length: %d", rxlen);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1277,7 +1277,7 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
|
||||||
|
|
||||||
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
||||||
// Since the clock counts since the last falling edge, a 'one' means that the
|
// Since the clock counts since the last falling edge, a 'one' means that the
|
||||||
// falling edge occured halfway the period. with respect to this falling edge,
|
// falling edge occurred halfway the period. with respect to this falling edge,
|
||||||
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
||||||
// All timer values are in terms of T0 units
|
// All timer values are in terms of T0 units
|
||||||
while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait + (HITAG_T_TAG_HALF_PERIOD * lastbit)));
|
while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait + (HITAG_T_TAG_HALF_PERIOD * lastbit)));
|
||||||
|
@ -1533,7 +1533,7 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
|
||||||
|
|
||||||
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
||||||
// Since the clock counts since the last falling edge, a 'one' means that the
|
// Since the clock counts since the last falling edge, a 'one' means that the
|
||||||
// falling edge occured halfway the period. with respect to this falling edge,
|
// falling edge occurred halfway the period. with respect to this falling edge,
|
||||||
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
||||||
// All timer values are in terms of T0 units
|
// All timer values are in terms of T0 units
|
||||||
while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait + (HITAG_T_TAG_HALF_PERIOD * lastbit))) {};
|
while (AT91C_BASE_TC0->TC_CV < T0 * (t_wait + (HITAG_T_TAG_HALF_PERIOD * lastbit))) {};
|
||||||
|
|
|
@ -1354,7 +1354,7 @@ void ReadHitagS(hitag_function htf, hitag_data *htd) {
|
||||||
|
|
||||||
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
||||||
// Since the clock counts since the last falling edge, a 'one' means that the
|
// Since the clock counts since the last falling edge, a 'one' means that the
|
||||||
// falling edge occured halfway the period. with respect to this falling edge,
|
// falling edge occurred halfway the period. with respect to this falling edge,
|
||||||
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
||||||
// All timer values are in terms of T0 units
|
// All timer values are in terms of T0 units
|
||||||
|
|
||||||
|
@ -1643,7 +1643,7 @@ void WritePageHitagS(hitag_function htf, hitag_data *htd, int page) {
|
||||||
|
|
||||||
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
||||||
// Since the clock counts since the last falling edge, a 'one' means that the
|
// Since the clock counts since the last falling edge, a 'one' means that the
|
||||||
// falling edge occured halfway the period. with respect to this falling edge,
|
// falling edge occurred halfway the period. with respect to this falling edge,
|
||||||
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
||||||
// All timer values are in terms of T0 units
|
// All timer values are in terms of T0 units
|
||||||
|
|
||||||
|
@ -1952,7 +1952,7 @@ void check_challenges(bool file_given, uint8_t *data) {
|
||||||
|
|
||||||
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
// Wait for HITAG_T_WAIT_2 carrier periods after the last tag bit before transmitting,
|
||||||
// Since the clock counts since the last falling edge, a 'one' means that the
|
// Since the clock counts since the last falling edge, a 'one' means that the
|
||||||
// falling edge occured halfway the period. with respect to this falling edge,
|
// falling edge occurred halfway the period. with respect to this falling edge,
|
||||||
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
// we need to wait (T_Wait2 + half_tag_period) when the last was a 'one'.
|
||||||
// All timer values are in terms of T0 units
|
// All timer values are in terms of T0 units
|
||||||
|
|
||||||
|
|
|
@ -1005,7 +1005,7 @@ static bool SimulateIso14443aInit(int tagType, int flags, uint8_t *data, tag_res
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
if (DBGLEVEL >= DBG_ERROR) Dbprintf("Error: unkown tagtype (%d)", tagType);
|
if (DBGLEVEL >= DBG_ERROR) Dbprintf("Error: unknown tagtype (%d)", tagType);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2999,7 +2999,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
||||||
|
|
||||||
mf_nr_ar[3] &= 0x1F;
|
mf_nr_ar[3] &= 0x1F;
|
||||||
|
|
||||||
if (DBGLEVEL >= DBG_EXTENDED) Dbprintf("Number of sent auth requestes: %u", i);
|
if (DBGLEVEL >= DBG_EXTENDED) Dbprintf("Number of sent auth requests: %u", i);
|
||||||
|
|
||||||
uint8_t buf[32] = {0x00};
|
uint8_t buf[32] = {0x00};
|
||||||
memset(buf, 0x00, sizeof(buf));
|
memset(buf, 0x00, sizeof(buf));
|
||||||
|
|
|
@ -766,7 +766,7 @@ void DbdecodeIso15693Answer(int len, uint8_t *d) {
|
||||||
strncat(status, "0F: no info", DBD15STATLEN - strlen(status));
|
strncat(status, "0F: no info", DBD15STATLEN - strlen(status));
|
||||||
break;
|
break;
|
||||||
case 0x10:
|
case 0x10:
|
||||||
strncat(status, "10: dont exist", DBD15STATLEN - strlen(status));
|
strncat(status, "10: don't exist", DBD15STATLEN - strlen(status));
|
||||||
break;
|
break;
|
||||||
case 0x11:
|
case 0x11:
|
||||||
strncat(status, "11: lock again", DBD15STATLEN - strlen(status));
|
strncat(status, "11: lock again", DBD15STATLEN - strlen(status));
|
||||||
|
|
|
@ -913,7 +913,7 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
|
||||||
LED_B_ON();
|
LED_B_ON();
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
uint16_t unsuccessfull_tries = 0;
|
uint16_t unsuccessful_tries = 0;
|
||||||
uint16_t davg = 0;
|
uint16_t davg = 0;
|
||||||
dmax = 0;
|
dmax = 0;
|
||||||
dmin = 2000;
|
dmin = 2000;
|
||||||
|
@ -970,8 +970,8 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
|
||||||
}
|
}
|
||||||
if (DBGLEVEL >= 3) Dbprintf("Nested: calibrating... ntdist=%d", i);
|
if (DBGLEVEL >= 3) Dbprintf("Nested: calibrating... ntdist=%d", i);
|
||||||
} else {
|
} else {
|
||||||
unsuccessfull_tries++;
|
unsuccessful_tries++;
|
||||||
if (unsuccessfull_tries > NESTED_MAX_TRIES) { // card isn't vulnerable to nested attack (random numbers are not predictable)
|
if (unsuccessful_tries > NESTED_MAX_TRIES) { // card isn't vulnerable to nested attack (random numbers are not predictable)
|
||||||
isOK = -3;
|
isOK = -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1038,7 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datain)
|
||||||
|
|
||||||
if (valid_nonce(nttest, nt2, ks1, par_array)) {
|
if (valid_nonce(nttest, nt2, ks1, par_array)) {
|
||||||
if (ncount > 0) { // we are only interested in disambiguous nonces, try again
|
if (ncount > 0) { // we are only interested in disambiguous nonces, try again
|
||||||
if (DBGLEVEL >= 3) Dbprintf("Nonce#%d: dismissed (ambigous), ntdist=%d", i + 1, j);
|
if (DBGLEVEL >= 3) Dbprintf("Nonce#%d: dismissed (ambiguous), ntdist=%d", i + 1, j);
|
||||||
target_nt[i] = 0;
|
target_nt[i] = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1118,7 +1118,7 @@ uint8_t chkKey(struct chk_t *c) {
|
||||||
|
|
||||||
CHK_TIMEOUT();
|
CHK_TIMEOUT();
|
||||||
|
|
||||||
// if successfull auth, send HALT
|
// if successful auth, send HALT
|
||||||
// if ( !res )
|
// if ( !res )
|
||||||
// mifare_classic_halt_ex(c->pcs);
|
// mifare_classic_halt_ex(c->pcs);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -302,7 +302,7 @@ int rdv40_spiffs_lazy_mount() {
|
||||||
if (!rdv40_spiffs_mounted()) {
|
if (!rdv40_spiffs_mounted()) {
|
||||||
changed = rdv40_spiffs_mount();
|
changed = rdv40_spiffs_mount();
|
||||||
/* if changed = 0 = SPIFFS_OK then all went well then the change
|
/* if changed = 0 = SPIFFS_OK then all went well then the change
|
||||||
* actually occured :)*/
|
* actually occurred :)*/
|
||||||
changed = !changed;
|
changed = !changed;
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
|
@ -371,7 +371,7 @@ just get back to this state. If not, just don't.
|
||||||
[...]
|
[...]
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// Again : This will "toggle" spiffs mount status only if a "change" occured
|
// Again : This will "toggle" spiffs mount status only if a "change" occurred
|
||||||
// (and should be fed by the result of a spiffs_lazy* function) If everything
|
// (and should be fed by the result of a spiffs_lazy* function) If everything
|
||||||
// went well, it will return SPIFFS_OK if everything went well, and a report
|
// went well, it will return SPIFFS_OK if everything went well, and a report
|
||||||
// back the chain a SPI_ERRNO if not.
|
// back the chain a SPI_ERRNO if not.
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int usage_analyse_checksum(void) {
|
||||||
PrintAndLogEx(NORMAL, "Usage: analyse chksum [h] [v] b <bytes> m <mask>");
|
PrintAndLogEx(NORMAL, "Usage: analyse chksum [h] [v] b <bytes> m <mask>");
|
||||||
PrintAndLogEx(NORMAL, "Options:");
|
PrintAndLogEx(NORMAL, "Options:");
|
||||||
PrintAndLogEx(NORMAL, " h This help");
|
PrintAndLogEx(NORMAL, " h This help");
|
||||||
PrintAndLogEx(NORMAL, " v supress header");
|
PrintAndLogEx(NORMAL, " v suppress header");
|
||||||
PrintAndLogEx(NORMAL, " b <bytes> bytes to calc missing XOR in a LCR");
|
PrintAndLogEx(NORMAL, " b <bytes> bytes to calc missing XOR in a LCR");
|
||||||
PrintAndLogEx(NORMAL, " m <mask> bit mask to limit the outpuyt");
|
PrintAndLogEx(NORMAL, " m <mask> bit mask to limit the outpuyt");
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
|
|
@ -164,7 +164,7 @@ static int CmdHFEPAPACEReplay(const char *Cmd) {
|
||||||
PrintAndLogEx(NORMAL, "GA Perform Key Agreement: %u us", resp.data.asDwords[3]);
|
PrintAndLogEx(NORMAL, "GA Perform Key Agreement: %u us", resp.data.asDwords[3]);
|
||||||
PrintAndLogEx(NORMAL, "GA Mutual Authenticate: %u us", resp.data.asDwords[4]);
|
PrintAndLogEx(NORMAL, "GA Mutual Authenticate: %u us", resp.data.asDwords[4]);
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(NORMAL, "PACE replay successfull!");
|
PrintAndLogEx(NORMAL, "PACE replay successful!");
|
||||||
PrintAndLogEx(NORMAL, "MSE Set AT: %u us", resp.data.asDwords[0]);
|
PrintAndLogEx(NORMAL, "MSE Set AT: %u us", resp.data.asDwords[0]);
|
||||||
PrintAndLogEx(NORMAL, "GA Get Nonce: %u us", resp.data.asDwords[1]);
|
PrintAndLogEx(NORMAL, "GA Get Nonce: %u us", resp.data.asDwords[1]);
|
||||||
PrintAndLogEx(NORMAL, "GA Map Nonce: %u us", resp.data.asDwords[2]);
|
PrintAndLogEx(NORMAL, "GA Map Nonce: %u us", resp.data.asDwords[2]);
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ static int CmdHF14AMfDump(const char *Cmd) {
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "time: %" PRIu64 " seconds\n", (msclock() - t1) / 1000);
|
PrintAndLogEx(SUCCESS, "time: %" PRIu64 " seconds\n", (msclock() - t1) / 1000);
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "\nSucceded in dumping all blocks");
|
PrintAndLogEx(SUCCESS, "\nSucceeded in dumping all blocks");
|
||||||
|
|
||||||
if (strlen(dataFilename) < 1) {
|
if (strlen(dataFilename) < 1) {
|
||||||
fptr = GenerateFilename("hf-mf-", "-data");
|
fptr = GenerateFilename("hf-mf-", "-data");
|
||||||
|
@ -1422,14 +1422,14 @@ jumptoend:
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(SUCCESS, "saving keys to binary file " _YELLOW_("%s"), fptr);
|
PrintAndLogEx(SUCCESS, "saving keys to binary file " _YELLOW_("%s"), fptr);
|
||||||
uint8_t standart[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
uint8_t standard[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
uint8_t tempkey[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
uint8_t tempkey[6] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
|
||||||
for (int i = 0; i < SectorsCnt; i++) {
|
for (int i = 0; i < SectorsCnt; i++) {
|
||||||
if (e_sector[i].foundKey[0]) {
|
if (e_sector[i].foundKey[0]) {
|
||||||
num_to_bytes(e_sector[i].Key[0], 6, tempkey);
|
num_to_bytes(e_sector[i].Key[0], 6, tempkey);
|
||||||
fwrite(tempkey, 1, 6, fkeys);
|
fwrite(tempkey, 1, 6, fkeys);
|
||||||
} else {
|
} else {
|
||||||
fwrite(&standart, 1, 6, fkeys);
|
fwrite(&standard, 1, 6, fkeys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; i < SectorsCnt; i++) {
|
for (int i = 0; i < SectorsCnt; i++) {
|
||||||
|
@ -1437,7 +1437,7 @@ jumptoend:
|
||||||
num_to_bytes(e_sector[i].Key[1], 6, tempkey);
|
num_to_bytes(e_sector[i].Key[1], 6, tempkey);
|
||||||
fwrite(tempkey, 1, 6, fkeys);
|
fwrite(tempkey, 1, 6, fkeys);
|
||||||
} else {
|
} else {
|
||||||
fwrite(&standart, 1, 6, fkeys);
|
fwrite(&standard, 1, 6, fkeys);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fflush(fkeys);
|
fflush(fkeys);
|
||||||
|
|
|
@ -245,7 +245,7 @@ static int CmdLFHitagList(const char *Cmd) {
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
PrintAndLogEx(NORMAL, "Recorded activity succesfully written to file: %s", filename);
|
PrintAndLogEx(NORMAL, "Recorded activity successfully written to file: %s", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(got);
|
free(got);
|
||||||
|
|
|
@ -340,14 +340,14 @@ static int CmdHelp(const char *Cmd);
|
||||||
|
|
||||||
static bool t55xxProtect(bool lock, bool usepwd, uint8_t override, uint32_t password, uint8_t downlink_mode, uint32_t new_password ) {
|
static bool t55xxProtect(bool lock, bool usepwd, uint8_t override, uint32_t password, uint8_t downlink_mode, uint32_t new_password ) {
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Checking current block0");
|
PrintAndLogEx(INFO, "Checking current configuration");
|
||||||
|
|
||||||
bool testmode = false;
|
bool testmode = false;
|
||||||
uint32_t block0 = 0;
|
uint32_t block0 = 0;
|
||||||
|
|
||||||
int res = T55xxReadBlockEx(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, usepwd, override, password, downlink_mode, false);
|
int res = T55xxReadBlockEx(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, usepwd, override, password, downlink_mode, false);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
PrintAndLogEx(WARNING, "fail to read current block0, use `p` password parameter ?");
|
PrintAndLogEx(WARNING, "Failed to read block0, use `p` password parameter?");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,41 +360,27 @@ static bool t55xxProtect(bool lock, bool usepwd, uint8_t override, uint32_t pass
|
||||||
PrintAndLogEx(INFO, "PWD bit is already set");
|
PrintAndLogEx(INFO, "PWD bit is already set");
|
||||||
usepwd = true;
|
usepwd = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set / clear pwd bit
|
||||||
if (lock) {
|
if (lock) {
|
||||||
// set pwd bit
|
|
||||||
block0 |= 1 << 4;
|
block0 |= 1 << 4;
|
||||||
} else {
|
} else {
|
||||||
block0 &= ~(1 << 4);
|
block0 &= ~(1 << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " old %08X vs %08X", old, block0);
|
|
||||||
|
|
||||||
// write new password
|
// write new password
|
||||||
if ( t55xxWrite(T55x7_PWD_BLOCK, T55x7_PAGE0, usepwd, testmode, password, downlink_mode, new_password ) != PM3_SUCCESS ) {
|
if ( t55xxWrite(T55x7_PWD_BLOCK, T55x7_PAGE0, usepwd, testmode, password, downlink_mode, new_password ) != PM3_SUCCESS ) {
|
||||||
PrintAndLogEx(ERR, "Failed writing new pwd");
|
PrintAndLogEx(ERR, "Failed to write new password");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "Wrote new password");
|
PrintAndLogEx(SUCCESS, "Wrote new password");
|
||||||
}
|
}
|
||||||
|
|
||||||
// password bit already set
|
|
||||||
// write b 7 new key old_pwd
|
|
||||||
// validate b 7 new_key old_pwd
|
|
||||||
// write b0 new_key
|
|
||||||
// validate b0 new_key
|
|
||||||
|
|
||||||
// write b7 new key
|
|
||||||
// validate b7 (no key)
|
|
||||||
// write b0 (no key)
|
|
||||||
// validate b0 w new key
|
|
||||||
|
|
||||||
|
|
||||||
// validate new password
|
// validate new password
|
||||||
uint32_t curr_password = (isPwdBitAlreadySet) ? new_password : password;
|
uint32_t curr_password = (isPwdBitAlreadySet) ? new_password : password;
|
||||||
|
|
||||||
if (t55xxVerifyWrite(T55x7_PWD_BLOCK, T55x7_PAGE0, usepwd, override, curr_password, downlink_mode, new_password) == false) {
|
if (t55xxVerifyWrite(T55x7_PWD_BLOCK, T55x7_PAGE0, usepwd, override, curr_password, downlink_mode, new_password) == false) {
|
||||||
PrintAndLogEx(WARNING, "Could not validate the new password write. aborting.");
|
PrintAndLogEx(WARNING, "Failed to validate the password write. aborting.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "Validated new password");
|
PrintAndLogEx(SUCCESS, "Validated new password");
|
||||||
|
@ -402,7 +388,7 @@ static bool t55xxProtect(bool lock, bool usepwd, uint8_t override, uint32_t pass
|
||||||
|
|
||||||
// write config
|
// write config
|
||||||
if ( t55xxWrite(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, usepwd, testmode, curr_password, downlink_mode, block0 ) != PM3_SUCCESS ) {
|
if ( t55xxWrite(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, usepwd, testmode, curr_password, downlink_mode, block0 ) != PM3_SUCCESS ) {
|
||||||
PrintAndLogEx(ERR, "Failed writing modified configuration block %08X", block0);
|
PrintAndLogEx(ERR, "Failed to write modified configuration block %08X", block0);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "Wrote modified configuration block");
|
PrintAndLogEx(SUCCESS, "Wrote modified configuration block");
|
||||||
|
@ -411,7 +397,7 @@ static bool t55xxProtect(bool lock, bool usepwd, uint8_t override, uint32_t pass
|
||||||
// validate new config. If all went well, card should now demand pwd, hence override = 0.
|
// validate new config. If all went well, card should now demand pwd, hence override = 0.
|
||||||
override = 0;
|
override = 0;
|
||||||
if (t55xxVerifyWrite(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, true, override, new_password, downlink_mode, block0) == false) {
|
if (t55xxVerifyWrite(T55x7_CONFIGURATION_BLOCK, T55x7_PAGE0, true, override, new_password, downlink_mode, block0) == false) {
|
||||||
PrintAndLogEx(WARNING, "Could not validate pwd bit set on configuration block. aborting.");
|
PrintAndLogEx(WARNING, "Failed to validate pwd bit set on configuration block. aborting.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(SUCCESS, "New configuration block " _YELLOW_("%08X")"password " _YELLOW_("%08X"), block0, new_password);
|
PrintAndLogEx(SUCCESS, "New configuration block " _YELLOW_("%08X")"password " _YELLOW_("%08X"), block0, new_password);
|
||||||
|
@ -681,15 +667,15 @@ int T55xxReadBlockEx(uint8_t block, bool page1, bool usepwd, uint8_t override, u
|
||||||
return PM3_ERFTRANS;
|
return PM3_ERFTRANS;
|
||||||
|
|
||||||
if (tryDetectModulation(downlink_mode, false) == false) {
|
if (tryDetectModulation(downlink_mode, false) == false) {
|
||||||
PrintAndLogEx(WARNING, "Safety Check: Could not detect if PWD bit is set in config block. Exits.");
|
PrintAndLogEx(WARNING, "Safety check: Could not detect if PWD bit is set in config block. Exits.");
|
||||||
return PM3_EWRONGANSVER;
|
return PM3_EWRONGANSVER;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "Safety Check: PWD bit is NOT set in config block. Reading without password...");
|
PrintAndLogEx(WARNING, "Safety check: PWD bit is NOT set in config block. Reading without password...");
|
||||||
usepwd = false;
|
usepwd = false;
|
||||||
page1 = false; // ??
|
page1 = false; // ??
|
||||||
}
|
}
|
||||||
} else if (override == 1) {
|
} else if (override == 1) {
|
||||||
PrintAndLogEx(INFO, "Safety Check Overriden - proceeding despite risk");
|
PrintAndLogEx(INFO, "Safety check overridden - proceeding despite risk");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1525,7 +1511,7 @@ static int CmdT55xxWriteBlock(const char *Cmd) {
|
||||||
if (validate) {
|
if (validate) {
|
||||||
bool isOK = t55xxVerifyWrite(block, page1, usepwd, 1, password, downlink_mode, data);
|
bool isOK = t55xxVerifyWrite(block, page1, usepwd, 1, password, downlink_mode, data);
|
||||||
if (isOK)
|
if (isOK)
|
||||||
PrintAndLogEx(SUCCESS, "Write OK, validation succesful");
|
PrintAndLogEx(SUCCESS, "Write OK, validation successful");
|
||||||
else
|
else
|
||||||
PrintAndLogEx(WARNING, "Write could not validate the written data");
|
PrintAndLogEx(WARNING, "Write could not validate the written data");
|
||||||
}
|
}
|
||||||
|
@ -3173,10 +3159,7 @@ static int CmdT55xxProtect(const char *Cmd) {
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
||||||
// lock
|
// lock
|
||||||
bool res = t55xxProtect(true, usepwd, override, password, downlink_mode, new_password );
|
if ( t55xxProtect(true, usepwd, override, password, downlink_mode, new_password) == false ) {
|
||||||
// unlock
|
|
||||||
// res = t55xxProtect(false, usepwd, override, password, downlink_mode, new_password );
|
|
||||||
if (res == false) {
|
|
||||||
PrintAndLogEx(WARNING, "Command failed. Did you run `lf t55xx detect` before?");
|
PrintAndLogEx(WARNING, "Command failed. Did you run `lf t55xx detect` before?");
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ const APDUCode APDUCodeTable[] = {
|
||||||
{"6281", APDUCODE_TYPE_WARNING, "Part of returned data may be corrupted"},
|
{"6281", APDUCODE_TYPE_WARNING, "Part of returned data may be corrupted"},
|
||||||
{"6282", APDUCODE_TYPE_WARNING, "End of file/record reached before reading Le bytes"},
|
{"6282", APDUCODE_TYPE_WARNING, "End of file/record reached before reading Le bytes"},
|
||||||
{"6283", APDUCODE_TYPE_WARNING, "Selected file invalidated"},
|
{"6283", APDUCODE_TYPE_WARNING, "Selected file invalidated"},
|
||||||
{"6284", APDUCODE_TYPE_WARNING, "Selected file is not valid. FCI not formated according to ISO"},
|
{"6284", APDUCODE_TYPE_WARNING, "Selected file is not valid. FCI not formatted according to ISO"},
|
||||||
{"6285", APDUCODE_TYPE_WARNING, "No input data available from a sensor on the card. No Purse Engine enslaved for R3bc"},
|
{"6285", APDUCODE_TYPE_WARNING, "No input data available from a sensor on the card. No Purse Engine enslaved for R3bc"},
|
||||||
{"62A2", APDUCODE_TYPE_WARNING, "Wrong R-MAC"},
|
{"62A2", APDUCODE_TYPE_WARNING, "Wrong R-MAC"},
|
||||||
{"62A4", APDUCODE_TYPE_WARNING, "Card locked (during reset( ))"},
|
{"62A4", APDUCODE_TYPE_WARNING, "Card locked (during reset( ))"},
|
||||||
|
@ -143,7 +143,7 @@ const APDUCode APDUCodeTable[] = {
|
||||||
{"6FXX", APDUCODE_TYPE_ERROR, "No precise diagnosis (procedure byte), (ISO 7816-3)"},
|
{"6FXX", APDUCODE_TYPE_ERROR, "No precise diagnosis (procedure byte), (ISO 7816-3)"},
|
||||||
{"9---", APDUCODE_TYPE_NONE, ""},
|
{"9---", APDUCODE_TYPE_NONE, ""},
|
||||||
{"9000", APDUCODE_TYPE_INFO, "Command successfully executed (OK)."},
|
{"9000", APDUCODE_TYPE_INFO, "Command successfully executed (OK)."},
|
||||||
{"9004", APDUCODE_TYPE_WARNING, "PIN not succesfully verified, 3 or more PIN tries left"},
|
{"9004", APDUCODE_TYPE_WARNING, "PIN not successfully verified, 3 or more PIN tries left"},
|
||||||
{"9008", APDUCODE_TYPE_NONE, "Key/file not found"},
|
{"9008", APDUCODE_TYPE_NONE, "Key/file not found"},
|
||||||
{"9080", APDUCODE_TYPE_WARNING, "Unblock Try Counter has reached zero"},
|
{"9080", APDUCODE_TYPE_WARNING, "Unblock Try Counter has reached zero"},
|
||||||
{"9100", APDUCODE_TYPE_NONE, "OK"},
|
{"9100", APDUCODE_TYPE_NONE, "OK"},
|
||||||
|
@ -191,7 +191,7 @@ const APDUCode APDUCodeTable[] = {
|
||||||
{"9681", APDUCODE_TYPE_NONE, "Slave not found"},
|
{"9681", APDUCODE_TYPE_NONE, "Slave not found"},
|
||||||
{"9700", APDUCODE_TYPE_NONE, "PIN blocked and Unblock Try Counter is 1 or 2"},
|
{"9700", APDUCODE_TYPE_NONE, "PIN blocked and Unblock Try Counter is 1 or 2"},
|
||||||
{"9702", APDUCODE_TYPE_NONE, "Main keys are blocked"},
|
{"9702", APDUCODE_TYPE_NONE, "Main keys are blocked"},
|
||||||
{"9704", APDUCODE_TYPE_NONE, "PIN not succesfully verified, 3 or more PIN tries left"},
|
{"9704", APDUCODE_TYPE_NONE, "PIN not successfully verified, 3 or more PIN tries left"},
|
||||||
{"9784", APDUCODE_TYPE_NONE, "Base key"},
|
{"9784", APDUCODE_TYPE_NONE, "Base key"},
|
||||||
{"9785", APDUCODE_TYPE_NONE, "Limit exceeded - C-MAC key"},
|
{"9785", APDUCODE_TYPE_NONE, "Limit exceeded - C-MAC key"},
|
||||||
{"9786", APDUCODE_TYPE_NONE, "SM error - Limit exceeded - R-MAC key"},
|
{"9786", APDUCODE_TYPE_NONE, "SM error - Limit exceeded - R-MAC key"},
|
||||||
|
@ -205,13 +205,13 @@ const APDUCode APDUCodeTable[] = {
|
||||||
{"9850", APDUCODE_TYPE_ERROR, "INCREASE or DECREASE could not be executed because a limit has been reached."},
|
{"9850", APDUCODE_TYPE_ERROR, "INCREASE or DECREASE could not be executed because a limit has been reached."},
|
||||||
{"9862", APDUCODE_TYPE_ERROR, "Authentication Error, application specific (incorrect MAC)"},
|
{"9862", APDUCODE_TYPE_ERROR, "Authentication Error, application specific (incorrect MAC)"},
|
||||||
{"9900", APDUCODE_TYPE_NONE, "1 PIN try left"},
|
{"9900", APDUCODE_TYPE_NONE, "1 PIN try left"},
|
||||||
{"9904", APDUCODE_TYPE_NONE, "PIN not succesfully verified, 1 PIN try left"},
|
{"9904", APDUCODE_TYPE_NONE, "PIN not successfully verified, 1 PIN try left"},
|
||||||
{"9985", APDUCODE_TYPE_NONE, "Wrong status - Cardholder lock"},
|
{"9985", APDUCODE_TYPE_NONE, "Wrong status - Cardholder lock"},
|
||||||
{"9986", APDUCODE_TYPE_ERROR, "Missing privilege"},
|
{"9986", APDUCODE_TYPE_ERROR, "Missing privilege"},
|
||||||
{"9987", APDUCODE_TYPE_NONE, "PIN is not installed"},
|
{"9987", APDUCODE_TYPE_NONE, "PIN is not installed"},
|
||||||
{"9988", APDUCODE_TYPE_NONE, "Wrong status - R-MAC state"},
|
{"9988", APDUCODE_TYPE_NONE, "Wrong status - R-MAC state"},
|
||||||
{"9A00", APDUCODE_TYPE_NONE, "2 PIN try left"},
|
{"9A00", APDUCODE_TYPE_NONE, "2 PIN try left"},
|
||||||
{"9A04", APDUCODE_TYPE_NONE, "PIN not succesfully verified, 2 PIN try left"},
|
{"9A04", APDUCODE_TYPE_NONE, "PIN not successfully verified, 2 PIN try left"},
|
||||||
{"9A71", APDUCODE_TYPE_NONE, "Wrong parameter value - Double agent AID"},
|
{"9A71", APDUCODE_TYPE_NONE, "Wrong parameter value - Double agent AID"},
|
||||||
{"9A72", APDUCODE_TYPE_NONE, "Wrong parameter value - Double agent Type"},
|
{"9A72", APDUCODE_TYPE_NONE, "Wrong parameter value - Double agent Type"},
|
||||||
{"9D05", APDUCODE_TYPE_ERROR, "Incorrect certificate type"},
|
{"9D05", APDUCODE_TYPE_ERROR, "Incorrect certificate type"},
|
||||||
|
@ -258,9 +258,9 @@ const APDUCode APDUCodeTable[] = {
|
||||||
{"9D63", APDUCODE_TYPE_ERROR, "Crypto functions not available"},
|
{"9D63", APDUCODE_TYPE_ERROR, "Crypto functions not available"},
|
||||||
{"9D64", APDUCODE_TYPE_ERROR, "No application loaded"},
|
{"9D64", APDUCODE_TYPE_ERROR, "No application loaded"},
|
||||||
{"9E00", APDUCODE_TYPE_NONE, "PIN not installed"},
|
{"9E00", APDUCODE_TYPE_NONE, "PIN not installed"},
|
||||||
{"9E04", APDUCODE_TYPE_NONE, "PIN not succesfully verified, PIN not installed"},
|
{"9E04", APDUCODE_TYPE_NONE, "PIN not successfully verified, PIN not installed"},
|
||||||
{"9F00", APDUCODE_TYPE_NONE, "PIN blocked and Unblock Try Counter is 3"},
|
{"9F00", APDUCODE_TYPE_NONE, "PIN blocked and Unblock Try Counter is 3"},
|
||||||
{"9F04", APDUCODE_TYPE_NONE, "PIN not succesfully verified, PIN blocked and Unblock Try Counter is 3"},
|
{"9F04", APDUCODE_TYPE_NONE, "PIN not successfully verified, PIN blocked and Unblock Try Counter is 3"},
|
||||||
{"9FXX", APDUCODE_TYPE_NONE, "Command successfully executed; 'xx' bytes of data are available and can be requested using GET RESPONSE."},
|
{"9FXX", APDUCODE_TYPE_NONE, "Command successfully executed; 'xx' bytes of data are available and can be requested using GET RESPONSE."},
|
||||||
{"9XXX", APDUCODE_TYPE_NONE, "Application related status, (ISO 7816-3)"}
|
{"9XXX", APDUCODE_TYPE_NONE, "Application related status, (ISO 7816-3)"}
|
||||||
};
|
};
|
||||||
|
|
|
@ -790,7 +790,7 @@ static int CmdEMVExec(const char *Cmd) {
|
||||||
arg_rem("By default:", "Transaction type - MSD"),
|
arg_rem("By default:", "Transaction type - MSD"),
|
||||||
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
||||||
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
||||||
arg_lit0("xX", "vsdc", "Transaction type - VSDC. For test only. Not a standart behavior."),
|
arg_lit0("xX", "vsdc", "Transaction type - VSDC. For test only. Not a standard behavior."),
|
||||||
arg_lit0("gG", "acgpo", "VISA. generate AC from GPO."),
|
arg_lit0("gG", "acgpo", "VISA. generate AC from GPO."),
|
||||||
arg_lit0("wW", "wired", "Send data via contact (iso7816) interface. Contactless interface set by default."),
|
arg_lit0("wW", "wired", "Send data via contact (iso7816) interface. Contactless interface set by default."),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
|
@ -1380,7 +1380,7 @@ static int CmdEMVScan(const char *Cmd) {
|
||||||
arg_rem("By default:", "Transaction type - MSD"),
|
arg_rem("By default:", "Transaction type - MSD"),
|
||||||
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
arg_lit0("vV", "qvsdc", "Transaction type - qVSDC or M/Chip."),
|
||||||
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
arg_lit0("cC", "qvsdccda", "Transaction type - qVSDC or M/Chip plus CDA (SDAD generation)."),
|
||||||
arg_lit0("xX", "vsdc", "Transaction type - VSDC. For test only. Not a standart behavior."),
|
arg_lit0("xX", "vsdc", "Transaction type - VSDC. For test only. Not a standard behavior."),
|
||||||
arg_lit0("gG", "acgpo", "VISA. generate AC from GPO."),
|
arg_lit0("gG", "acgpo", "VISA. generate AC from GPO."),
|
||||||
arg_lit0("mM", "merge", "Merge output file with card's data. (warning: the file may be corrupted!)"),
|
arg_lit0("mM", "merge", "Merge output file with card's data. (warning: the file may be corrupted!)"),
|
||||||
arg_lit0("wW", "wired", "Send data via contact (iso7816) interface. Contactless interface set by default."),
|
arg_lit0("wW", "wired", "Send data via contact (iso7816) interface. Contactless interface set by default."),
|
||||||
|
|
|
@ -394,7 +394,7 @@ static int EMVSelectWithRetry(EMVCommandChannel channel, bool ActivateField, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
retrycnt = 0;
|
retrycnt = 0;
|
||||||
PrintAndLogEx(NORMAL, "Retry failed [%s]. Skiped...", sprint_hex_inrow(AID, AIDLen));
|
PrintAndLogEx(NORMAL, "Retry failed [%s]. Skipped...", sprint_hex_inrow(AID, AIDLen));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ typedef enum {
|
||||||
|
|
||||||
enum TransactionType {
|
enum TransactionType {
|
||||||
TT_MSD,
|
TT_MSD,
|
||||||
TT_VSDC, // contact only. not standart for contactless
|
TT_VSDC, // contact only. not standard for contactless
|
||||||
TT_QVSDCMCHIP,
|
TT_QVSDCMCHIP,
|
||||||
TT_CDA,
|
TT_CDA,
|
||||||
};
|
};
|
||||||
|
|
|
@ -357,7 +357,7 @@ CborError CborGetArrayBinStringValue(CborValue *elm, uint8_t *data, size_t maxda
|
||||||
return CborGetArrayBinStringValueEx(elm, data, maxdatalen, datalen, NULL, 0);
|
return CborGetArrayBinStringValueEx(elm, data, maxdatalen, datalen, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CborError CborGetArrayBinStringValueEx(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen, uint8_t *delimeter, size_t delimeterlen) {
|
CborError CborGetArrayBinStringValueEx(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen, uint8_t *delimiter, size_t delimiterlen) {
|
||||||
CborValue array;
|
CborValue array;
|
||||||
if (datalen)
|
if (datalen)
|
||||||
*datalen = 0;
|
*datalen = 0;
|
||||||
|
@ -373,9 +373,9 @@ CborError CborGetArrayBinStringValueEx(CborValue *elm, uint8_t *data, size_t max
|
||||||
cbor_check(res);
|
cbor_check(res);
|
||||||
|
|
||||||
totallen += slen;
|
totallen += slen;
|
||||||
if (delimeter) {
|
if (delimiter) {
|
||||||
memcpy(&data[totallen], delimeter, delimeterlen);
|
memcpy(&data[totallen], delimiter, delimiterlen);
|
||||||
totallen += delimeterlen;
|
totallen += delimiterlen;
|
||||||
}
|
}
|
||||||
slen = maxdatalen - totallen;
|
slen = maxdatalen - totallen;
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,7 @@ CborError CborGetBinStringValue(CborValue *elm, uint8_t *data, size_t maxdatalen
|
||||||
return CborNoError;
|
return CborNoError;
|
||||||
};
|
};
|
||||||
|
|
||||||
CborError CborGetArrayStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen, char *delimeter) {
|
CborError CborGetArrayStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen, char *delimiter) {
|
||||||
CborValue array;
|
CborValue array;
|
||||||
if (datalen)
|
if (datalen)
|
||||||
*datalen = 0;
|
*datalen = 0;
|
||||||
|
@ -420,9 +420,9 @@ CborError CborGetArrayStringValue(CborValue *elm, char *data, size_t maxdatalen,
|
||||||
cbor_check(res);
|
cbor_check(res);
|
||||||
|
|
||||||
totallen += slen;
|
totallen += slen;
|
||||||
if (delimeter) {
|
if (delimiter) {
|
||||||
strcat(data, delimeter);
|
strcat(data, delimiter);
|
||||||
totallen += strlen(delimeter);
|
totallen += strlen(delimiter);
|
||||||
}
|
}
|
||||||
slen = maxdatalen - totallen;
|
slen = maxdatalen - totallen;
|
||||||
data[totallen] = 0x00;
|
data[totallen] = 0x00;
|
||||||
|
|
|
@ -25,9 +25,9 @@ int JsonToCbor(json_t *elm, CborEncoder *encoder);
|
||||||
|
|
||||||
int CborMapGetKeyById(CborParser *parser, CborValue *map, uint8_t *data, size_t dataLen, int key);
|
int CborMapGetKeyById(CborParser *parser, CborValue *map, uint8_t *data, size_t dataLen, int key);
|
||||||
CborError CborGetArrayBinStringValue(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen);
|
CborError CborGetArrayBinStringValue(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen);
|
||||||
CborError CborGetArrayBinStringValueEx(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen, uint8_t *delimeter, size_t delimeterlen);
|
CborError CborGetArrayBinStringValueEx(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen, uint8_t *delimiter, size_t delimiterlen);
|
||||||
CborError CborGetBinStringValue(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen);
|
CborError CborGetBinStringValue(CborValue *elm, uint8_t *data, size_t maxdatalen, size_t *datalen);
|
||||||
CborError CborGetArrayStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen, char *delimeter);
|
CborError CborGetArrayStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen, char *delimiter);
|
||||||
CborError CborGetStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen);
|
CborError CborGetStringValue(CborValue *elm, char *data, size_t maxdatalen, size_t *datalen);
|
||||||
CborError CborGetStringValueBuf(CborValue *elm);
|
CborError CborGetStringValueBuf(CborValue *elm);
|
||||||
|
|
||||||
|
|
|
@ -122,8 +122,8 @@ end
|
||||||
-- @param ignoreresponse - if set to true, we don't read the device answer packet
|
-- @param ignoreresponse - if set to true, we don't read the device answer packet
|
||||||
-- which is usually recipe for fail. If not sent, the host will wait 2s for a
|
-- which is usually recipe for fail. If not sent, the host will wait 2s for a
|
||||||
-- response of type CMD_ACK
|
-- response of type CMD_ACK
|
||||||
-- @return packet,nil if successfull
|
-- @return packet,nil if successful
|
||||||
-- nil, errormessage if unsuccessfull
|
-- nil, errormessage if unsuccessful
|
||||||
function Command:sendMIX( ignore_response, timeout )
|
function Command:sendMIX( ignore_response, timeout )
|
||||||
local data = self.data
|
local data = self.data
|
||||||
local cmd = self.cmd
|
local cmd = self.cmd
|
||||||
|
|
|
@ -12,8 +12,8 @@ local reader15693 = require('read15')
|
||||||
-- This method library can be set waits or a 13.56 MHz tag, and when one is found, returns info about
|
-- This method library can be set waits or a 13.56 MHz tag, and when one is found, returns info about
|
||||||
-- what tag it is.
|
-- what tag it is.
|
||||||
--
|
--
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function waitForTag()
|
local function waitForTag()
|
||||||
print("Waiting for card... press Enter to quit")
|
print("Waiting for card... press Enter to quit")
|
||||||
local readers = {reader14443A, reader14443B, reader15693}
|
local readers = {reader14443A, reader14443B, reader15693}
|
||||||
|
|
|
@ -80,8 +80,8 @@ end
|
||||||
|
|
||||||
-- This function does a connect and retrieves som einfo
|
-- This function does a connect and retrieves som einfo
|
||||||
-- @param dont_disconnect - if true, does not disable the field
|
-- @param dont_disconnect - if true, does not disable the field
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function read14443a(dont_disconnect, no_rats)
|
local function read14443a(dont_disconnect, no_rats)
|
||||||
local command, result, info, err, data
|
local command, result, info, err, data
|
||||||
|
|
||||||
|
@ -118,8 +118,8 @@ end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function waitFor14443a()
|
local function waitFor14443a()
|
||||||
print('Waiting for card... press Enter to quit')
|
print('Waiting for card... press Enter to quit')
|
||||||
while not core.kbd_enter_pressed() do
|
while not core.kbd_enter_pressed() do
|
||||||
|
|
|
@ -55,8 +55,8 @@ local function parse14443b(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This function does a connect and retrieves some info
|
-- This function does a connect and retrieves some info
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function read14443b(disconnect)
|
local function read14443b(disconnect)
|
||||||
|
|
||||||
local command, result, info, err, data
|
local command, result, info, err, data
|
||||||
|
@ -96,8 +96,8 @@ end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function waitFor14443b()
|
local function waitFor14443b()
|
||||||
print('Waiting for card... press Enter to quit')
|
print('Waiting for card... press Enter to quit')
|
||||||
while not core.kbd_enter_pressed() do
|
while not core.kbd_enter_pressed() do
|
||||||
|
|
|
@ -64,8 +64,8 @@ end
|
||||||
|
|
||||||
-- This function does a connect and retrieves som info
|
-- This function does a connect and retrieves som info
|
||||||
-- @param dont_disconnect - if true, does not disable the field
|
-- @param dont_disconnect - if true, does not disable the field
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function read15693(slow, dont_readresponse)
|
local function read15693(slow, dont_readresponse)
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
@ -130,8 +130,8 @@ end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Waits for a ISO15693 card to be placed within the vicinity of the reader.
|
-- Waits for a ISO15693 card to be placed within the vicinity of the reader.
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function waitFor15693()
|
local function waitFor15693()
|
||||||
print('Waiting for card... press Enter to quit')
|
print('Waiting for card... press Enter to quit')
|
||||||
while not core.kbd_enter_pressed() do
|
while not core.kbd_enter_pressed() do
|
||||||
|
|
|
@ -59,7 +59,7 @@ local Utils =
|
||||||
-- @param blockData. Assumed to be on the format {'\0\1\2\3,'\b\e\e\f' ...,
|
-- @param blockData. Assumed to be on the format {'\0\1\2\3,'\b\e\e\f' ...,
|
||||||
-- that is, blockData[row] contains a string with the actual data, not ascii hex representation
|
-- that is, blockData[row] contains a string with the actual data, not ascii hex representation
|
||||||
-- return filename if all went well,
|
-- return filename if all went well,
|
||||||
-- @reurn nil, error message if unsuccessfulls
|
-- @reurn nil, error message if unsuccessful
|
||||||
WriteDumpFile = function(uid, blockData)
|
WriteDumpFile = function(uid, blockData)
|
||||||
local destination = string.format("%s.eml", uid)
|
local destination = string.format("%s.eml", uid)
|
||||||
local file = io.open(destination, "w")
|
local file = io.open(destination, "w")
|
||||||
|
|
|
@ -67,8 +67,8 @@ local function help()
|
||||||
end
|
end
|
||||||
---
|
---
|
||||||
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
-- Waits for a mifare card to be placed within the vicinity of the reader.
|
||||||
-- @return if successfull: an table containing card info
|
-- @return if successful: an table containing card info
|
||||||
-- @return if unsuccessfull : nil, error
|
-- @return if unsuccessful : nil, error
|
||||||
local function wait_for_mifare()
|
local function wait_for_mifare()
|
||||||
while not core.kbd_enter_pressed() do
|
while not core.kbd_enter_pressed() do
|
||||||
res, err = lib14a.read()
|
res, err = lib14a.read()
|
||||||
|
|
|
@ -90,8 +90,8 @@ local function getblockdata(response)
|
||||||
return nil, "Couldn't read block"
|
return nil, "Couldn't read block"
|
||||||
end
|
end
|
||||||
---_ Gets data from a block
|
---_ Gets data from a block
|
||||||
-- @return {block, block+1, block+2, block+3} if successfull
|
-- @return {block, block+1, block+2, block+3} if successful
|
||||||
-- @return nil, errormessage if unsuccessfull
|
-- @return nil, errormessage if unsuccessful
|
||||||
local function getBlock(blockno)
|
local function getBlock(blockno)
|
||||||
local block, err
|
local block, err
|
||||||
local c = Command:newMIX{cmd = cmds.CMD_HF_MIFAREU_READBL, arg1 = blockno, data = 0}
|
local c = Command:newMIX{cmd = cmds.CMD_HF_MIFAREU_READBL, arg1 = blockno, data = 0}
|
||||||
|
|
|
@ -939,12 +939,12 @@ static int l_T55xx_readblock(lua_State *L) {
|
||||||
usepage1 = false;
|
usepage1 = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(NORMAL, "Safety Check Overriden - proceeding despite risk");
|
PrintAndLogEx(NORMAL, "Safety Check Overridden - proceeding despite risk");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AquireData(usepage1, block, usepwd, password, 0)) {
|
if (!AquireData(usepage1, block, usepwd, password, 0)) {
|
||||||
return returnToLuaWithError(L, "Failed to aquire data from card");
|
return returnToLuaWithError(L, "Failed to acquire data from card");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DecodeT55xxBlock()) {
|
if (!DecodeT55xxBlock()) {
|
||||||
|
@ -1002,7 +1002,7 @@ static int l_T55xx_detect(lua_State *L) {
|
||||||
|
|
||||||
isok = AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, usepwd, password, 0);
|
isok = AquireData(T55x7_PAGE0, T55x7_CONFIGURATION_BLOCK, usepwd, password, 0);
|
||||||
if (isok == false) {
|
if (isok == false) {
|
||||||
return returnToLuaWithError(L, "Failed to aquire LF signal data");
|
return returnToLuaWithError(L, "Failed to acquire LF signal data");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -528,7 +528,7 @@ int mbedtls_ecp_tls_write_point(const mbedtls_ecp_group *grp, const mbedtls_ecp_
|
||||||
*
|
*
|
||||||
* \return \c 0 on success,
|
* \return \c 0 on success,
|
||||||
* \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure.
|
* \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization failure.
|
||||||
* \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE for unkownn groups.
|
* \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE for unknown groups.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
int mbedtls_ecp_group_load(mbedtls_ecp_group *grp, mbedtls_ecp_group_id id);
|
int mbedtls_ecp_group_load(mbedtls_ecp_group *grp, mbedtls_ecp_group_id id);
|
||||||
|
|
|
@ -558,7 +558,7 @@ void mbedtls_strerror(int ret, char *buf, size_t buflen) {
|
||||||
if (use_ret == -(MBEDTLS_ERR_X509_BUFFER_TOO_SMALL))
|
if (use_ret == -(MBEDTLS_ERR_X509_BUFFER_TOO_SMALL))
|
||||||
mbedtls_snprintf(buf, buflen, "X509 - Destination buffer is too small");
|
mbedtls_snprintf(buf, buflen, "X509 - Destination buffer is too small");
|
||||||
if (use_ret == -(MBEDTLS_ERR_X509_FATAL_ERROR))
|
if (use_ret == -(MBEDTLS_ERR_X509_FATAL_ERROR))
|
||||||
mbedtls_snprintf(buf, buflen, "X509 - A fatal error occured, eg the chain is too long or the vrfy callback failed");
|
mbedtls_snprintf(buf, buflen, "X509 - A fatal error occurred, eg the chain is too long or the vrfy callback failed");
|
||||||
#endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */
|
#endif /* MBEDTLS_X509_USE_C || MBEDTLS_X509_CREATE_C */
|
||||||
// END generated code
|
// END generated code
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
#define MBEDTLS_ERR_X509_ALLOC_FAILED -0x2880 /**< Allocation of memory failed. */
|
#define MBEDTLS_ERR_X509_ALLOC_FAILED -0x2880 /**< Allocation of memory failed. */
|
||||||
#define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */
|
#define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */
|
||||||
#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */
|
#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */
|
||||||
#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occured, eg the chain is too long or the vrfy callback failed. */
|
#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */
|
||||||
/* \} name */
|
/* \} name */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -251,7 +251,7 @@ int mbedtls_x509_serial_gets(char *buf, size_t size, const mbedtls_x509_buf *ser
|
||||||
*
|
*
|
||||||
* \param to mbedtls_x509_time to check
|
* \param to mbedtls_x509_time to check
|
||||||
*
|
*
|
||||||
* \return 1 if the given time is in the past or an error occured,
|
* \return 1 if the given time is in the past or an error occurred,
|
||||||
* 0 otherwise.
|
* 0 otherwise.
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509_time_is_past(const mbedtls_x509_time *to);
|
int mbedtls_x509_time_is_past(const mbedtls_x509_time *to);
|
||||||
|
@ -265,7 +265,7 @@ int mbedtls_x509_time_is_past(const mbedtls_x509_time *to);
|
||||||
*
|
*
|
||||||
* \param from mbedtls_x509_time to check
|
* \param from mbedtls_x509_time to check
|
||||||
*
|
*
|
||||||
* \return 1 if the given time is in the future or an error occured,
|
* \return 1 if the given time is in the future or an error occurred,
|
||||||
* 0 otherwise.
|
* 0 otherwise.
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509_time_is_future(const mbedtls_x509_time *from);
|
int mbedtls_x509_time_is_future(const mbedtls_x509_time *from);
|
||||||
|
|
|
@ -598,10 +598,10 @@ typedef struct _AT91S_RSTC {
|
||||||
#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type
|
#define AT91C_RSTC_RSTTYP (0x7 << 8) // (RSTC) Reset Type
|
||||||
#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising.
|
#define AT91C_RSTC_RSTTYP_POWERUP (0x0 << 8) // (RSTC) Power-up Reset. VDDCORE rising.
|
||||||
#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising.
|
#define AT91C_RSTC_RSTTYP_WAKEUP (0x1 << 8) // (RSTC) WakeUp Reset. VDDCORE rising.
|
||||||
#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occured.
|
#define AT91C_RSTC_RSTTYP_WATCHDOG (0x2 << 8) // (RSTC) Watchdog Reset. Watchdog overflow occurred.
|
||||||
#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software.
|
#define AT91C_RSTC_RSTTYP_SOFTWARE (0x3 << 8) // (RSTC) Software Reset. Processor reset required by the software.
|
||||||
#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low.
|
#define AT91C_RSTC_RSTTYP_USER (0x4 << 8) // (RSTC) User Reset. NRST pin detected low.
|
||||||
#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occured.
|
#define AT91C_RSTC_RSTTYP_BROWNOUT (0x5 << 8) // (RSTC) Brownout Reset occurred.
|
||||||
#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level
|
#define AT91C_RSTC_NRSTL (0x1 << 16) // (RSTC) NRST pin level
|
||||||
#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress.
|
#define AT91C_RSTC_SRCMP (0x1 << 17) // (RSTC) Software Reset Command in Progress.
|
||||||
// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register --------
|
// -------- RSTC_RMR : (RSTC Offset: 0x8) Reset Mode Register --------
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
usb_dev_handle *devh = NULL;
|
usb_dev_handle *devh = NULL;
|
||||||
static unsigned int claimed_iface = 0;
|
static unsigned int claimed_iface = 0;
|
||||||
unsigned char return_on_error = 0;
|
unsigned char return_on_error = 0;
|
||||||
unsigned char error_occured = 0;
|
unsigned char error_occurred = 0;
|
||||||
|
|
||||||
void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len) {
|
void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len) {
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -37,7 +37,7 @@ void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, vo
|
||||||
|
|
||||||
ret = usb_bulk_write(devh, 0x01, (char *)&c, sizeof(PacketCommandOLD), 1000);
|
ret = usb_bulk_write(devh, 0x01, (char *)&c, sizeof(PacketCommandOLD), 1000);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
error_occured = 1;
|
error_occurred = 1;
|
||||||
if (return_on_error)
|
if (return_on_error)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ bool ReceiveCommandPoll(PacketResponseOLD *c) {
|
||||||
ret = usb_bulk_read(devh, 0x82, (char *)c, sizeof(PacketResponseOLD), 500);
|
ret = usb_bulk_read(devh, 0x82, (char *)c, sizeof(PacketResponseOLD), 500);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret != -ETIMEDOUT) {
|
if (ret != -ETIMEDOUT) {
|
||||||
error_occured = 1;
|
error_occurred = 1;
|
||||||
if (return_on_error)
|
if (return_on_error)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "usb_cmd.h"
|
#include "usb_cmd.h"
|
||||||
|
|
||||||
extern unsigned char return_on_error;
|
extern unsigned char return_on_error;
|
||||||
extern unsigned char error_occured;
|
extern unsigned char error_occurred;
|
||||||
|
|
||||||
void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
void SendCommandBL(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, void *data, size_t len);
|
||||||
bool ReceiveCommandPoll(PacketResponseOLD *c);
|
bool ReceiveCommandPoll(PacketResponseOLD *c);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue