mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
style
This commit is contained in:
parent
47eab16881
commit
2a0d1557e1
4 changed files with 13 additions and 13 deletions
|
@ -178,7 +178,7 @@ int CmdsParse(const command_t Commands[], const char *Cmd) {
|
||||||
char cmd_name[128];
|
char cmd_name[128];
|
||||||
memset(cmd_name, 0, sizeof(cmd_name));
|
memset(cmd_name, 0, sizeof(cmd_name));
|
||||||
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
// %n == receives an integer of value equal to the number of chars read so far.
|
// %n == receives an integer of value equal to the number of chars read so far.
|
||||||
// len = max 127
|
// len = max 127
|
||||||
sscanf(Cmd, "%127s%n", cmd_name, &len);
|
sscanf(Cmd, "%127s%n", cmd_name, &len);
|
||||||
|
@ -248,10 +248,10 @@ void dumpCommandsRecursive(const command_t cmds[], int markdown) {
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cmds[i].Name) {
|
while (cmds[i].Name) {
|
||||||
|
|
||||||
if ((cmds[i].Name[0] == '-' || strlen(cmds[i].Name) == 0) && ++i) continue;
|
if ((cmds[i].Name[0] == '-' || strlen(cmds[i].Name) == 0) && ++i) continue;
|
||||||
if (cmds[i].Help[0] == '{' && ++i) continue;
|
if (cmds[i].Help[0] == '{' && ++i) continue;
|
||||||
|
|
||||||
const char *cmd_offline = "N";
|
const char *cmd_offline = "N";
|
||||||
|
|
||||||
if (cmds[i].IsAvailable())
|
if (cmds[i].IsAvailable())
|
||||||
|
|
|
@ -136,7 +136,7 @@ static struct crypto_pk *crypto_pk_polarssl_open_priv_rsa(va_list vl) {
|
||||||
mbedtls_mpi_read_binary(&cp->ctx.Q, (const unsigned char *)q, qlen);
|
mbedtls_mpi_read_binary(&cp->ctx.Q, (const unsigned char *)q, qlen);
|
||||||
mbedtls_mpi_read_binary(&cp->ctx.DP, (const unsigned char *)dp, dplen);
|
mbedtls_mpi_read_binary(&cp->ctx.DP, (const unsigned char *)dp, dplen);
|
||||||
mbedtls_mpi_read_binary(&cp->ctx.DQ, (const unsigned char *)dq, dqlen);
|
mbedtls_mpi_read_binary(&cp->ctx.DQ, (const unsigned char *)dq, dqlen);
|
||||||
|
|
||||||
int res = mbedtls_mpi_inv_mod(&cp->ctx.QP, &cp->ctx.Q, &cp->ctx.P);
|
int res = mbedtls_mpi_inv_mod(&cp->ctx.QP, &cp->ctx.Q, &cp->ctx.P);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
fprintf(stderr, "PolarSSL private key error res=%x exp=%d mod=%d.\n", res * -1, explen, modlen);
|
fprintf(stderr, "PolarSSL private key error res=%x exp=%d mod=%d.\n", res * -1, explen, modlen);
|
||||||
|
|
|
@ -204,7 +204,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t
|
||||||
}
|
}
|
||||||
fflush(f);
|
fflush(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32 )" blocks to text file " _YELLOW_("%s"), blocks, fileName);
|
PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32)" blocks to text file " _YELLOW_("%s"), blocks, fileName);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
free(fileName);
|
free(fileName);
|
||||||
|
@ -618,7 +618,7 @@ int loadFile_safe(const char *preferredName, const char *suffix, void **pdata, s
|
||||||
int loadFileEML(const char *preferredName, void *data, size_t *datalen) {
|
int loadFileEML(const char *preferredName, void *data, size_t *datalen) {
|
||||||
|
|
||||||
if (data == NULL) return PM3_EINVARG;
|
if (data == NULL) return PM3_EINVARG;
|
||||||
|
|
||||||
char *fileName = filenamemcopy(preferredName, ".eml");
|
char *fileName = filenamemcopy(preferredName, ".eml");
|
||||||
if (fileName == NULL) return PM3_EMALLOC;
|
if (fileName == NULL) return PM3_EMALLOC;
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ int loadFileEML(const char *preferredName, void *data, size_t *datalen) {
|
||||||
memset(line, 0, sizeof(line));
|
memset(line, 0, sizeof(line));
|
||||||
uint8_t buf[64] = {0x00};
|
uint8_t buf[64] = {0x00};
|
||||||
|
|
||||||
uint8_t *udata = (uint8_t*)data;
|
uint8_t *udata = (uint8_t *)data;
|
||||||
|
|
||||||
while (!feof(f)) {
|
while (!feof(f)) {
|
||||||
|
|
||||||
|
@ -861,15 +861,15 @@ int loadFileDICTIONARYEx(const char *preferredName, void *data, size_t maxdatale
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startFilePosition) {
|
if (startFilePosition) {
|
||||||
if (fseek(f, startFilePosition, SEEK_SET) < 0){
|
if (fseek(f, startFilePosition, SEEK_SET) < 0) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
retval = PM3_EFILE;
|
retval = PM3_EFILE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t *udata = (uint8_t*)data;
|
uint8_t *udata = (uint8_t *)data;
|
||||||
|
|
||||||
// read file
|
// read file
|
||||||
while (!feof(f)) {
|
while (!feof(f)) {
|
||||||
size_t filepos = ftell(f);
|
size_t filepos = ftell(f);
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
// MFU/NTAG PWD/PACK generation stuff
|
// MFU/NTAG PWD/PACK generation stuff
|
||||||
// Italian transport system
|
// Italian transport system
|
||||||
// Amiibo
|
// Amiibo
|
||||||
// Lego Dimension
|
// Lego Dimension
|
||||||
// XYZ 3D printing
|
// XYZ 3D printing
|
||||||
|
@ -225,9 +225,9 @@ int mfc_algo_mizip_one(uint8_t *uid, uint8_t sector, uint64_t *key) {
|
||||||
}
|
}
|
||||||
// returns all Mifare Mini (MFM) 10 keys.
|
// returns all Mifare Mini (MFM) 10 keys.
|
||||||
// keys must have 5*2*6 = 60bytes space
|
// keys must have 5*2*6 = 60bytes space
|
||||||
int mfc_algo_mizip_all(uint8_t *uid, uint8_t *keys) {
|
int mfc_algo_mizip_all(uint8_t *uid, uint8_t *keys) {
|
||||||
if (keys == NULL) return PM3_EINVARG;
|
if (keys == NULL) return PM3_EINVARG;
|
||||||
|
|
||||||
uint64_t xor_tbl[] = {
|
uint64_t xor_tbl[] = {
|
||||||
0x09125a2589e5ULL, 0xF12C8453D821ULL,
|
0x09125a2589e5ULL, 0xF12C8453D821ULL,
|
||||||
0xAB75C937922FULL, 0x73E799FE3241ULL,
|
0xAB75C937922FULL, 0x73E799FE3241ULL,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue