This commit is contained in:
iceman1001 2020-01-07 22:18:27 +01:00
commit 2a0d1557e1
4 changed files with 13 additions and 13 deletions

View file

@ -178,7 +178,7 @@ int CmdsParse(const command_t Commands[], const char *Cmd) {
char cmd_name[128];
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.
// len = max 127
sscanf(Cmd, "%127s%n", cmd_name, &len);
@ -248,10 +248,10 @@ void dumpCommandsRecursive(const command_t cmds[], int markdown) {
}
while (cmds[i].Name) {
if ((cmds[i].Name[0] == '-' || strlen(cmds[i].Name) == 0) && ++i) continue;
if (cmds[i].Help[0] == '{' && ++i) continue;
const char *cmd_offline = "N";
if (cmds[i].IsAvailable())

View file

@ -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.DP, (const unsigned char *)dp, dplen);
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);
if (res != 0) {
fprintf(stderr, "PolarSSL private key error res=%x exp=%d mod=%d.\n", res * -1, explen, modlen);

View file

@ -204,7 +204,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t
}
fflush(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:
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) {
if (data == NULL) return PM3_EINVARG;
char *fileName = filenamemcopy(preferredName, ".eml");
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));
uint8_t buf[64] = {0x00};
uint8_t *udata = (uint8_t*)data;
uint8_t *udata = (uint8_t *)data;
while (!feof(f)) {
@ -861,15 +861,15 @@ int loadFileDICTIONARYEx(const char *preferredName, void *data, size_t maxdatale
}
if (startFilePosition) {
if (fseek(f, startFilePosition, SEEK_SET) < 0){
if (fseek(f, startFilePosition, SEEK_SET) < 0) {
fclose(f);
retval = PM3_EFILE;
goto out;
}
}
uint8_t *udata = (uint8_t*)data;
uint8_t *udata = (uint8_t *)data;
// read file
while (!feof(f)) {
size_t filepos = ftell(f);

View file

@ -26,7 +26,7 @@
//------------------------------------
// MFU/NTAG PWD/PACK generation stuff
// Italian transport system
// Italian transport system
// Amiibo
// Lego Dimension
// 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.
// 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;
uint64_t xor_tbl[] = {
0x09125a2589e5ULL, 0xF12C8453D821ULL,
0xAB75C937922FULL, 0x73E799FE3241ULL,