mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-30 19:40:37 -07:00
make style
This commit is contained in:
parent
5787f07617
commit
f69739da79
16 changed files with 62 additions and 63 deletions
|
@ -19,7 +19,7 @@ extern uint8_t _stack_start, __bss_end__;
|
|||
// BigBuf is the large multi-purpose buffer, typically used to hold A/D samples or traces.
|
||||
// Also used to hold various smaller buffers and the Mifare Emulator Memory.
|
||||
// We know that bss is aligned to 4 bytes.
|
||||
static uint8_t* BigBuf = &__bss_end__;
|
||||
static uint8_t *BigBuf = &__bss_end__;
|
||||
|
||||
/* BigBuf memory layout:
|
||||
Pointer to highest available memory: BigBuf_hi
|
||||
|
|
|
@ -2080,7 +2080,7 @@ void __attribute__((noreturn)) AppMain(void) {
|
|||
SpinDelay(100);
|
||||
BigBuf_initialize();
|
||||
|
||||
for (uint32_t * p = &_stack_start; p < (uint32_t *)((uintptr_t)&_stack_end - 0x200); ++p) {
|
||||
for (uint32_t *p = &_stack_start; p < (uint32_t *)((uintptr_t)&_stack_end - 0x200); ++p) {
|
||||
*p = 0xdeadbeef;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "cmd.h"
|
||||
|
||||
static void RAMFUNC optimizedSniff(uint16_t *dest, uint16_t dsize) {
|
||||
for (;dsize > 0; dsize -= sizeof(dsize)) {
|
||||
for (; dsize > 0; dsize -= sizeof(dsize)) {
|
||||
if (AT91C_BASE_SSC->SSC_SR & AT91C_SSC_RXRDY) {
|
||||
*dest = (uint16_t)(AT91C_BASE_SSC->SSC_RHR);
|
||||
dest++;
|
||||
|
@ -95,7 +95,7 @@ int HfSniff(uint32_t samplesToSkip, uint32_t triggersToSkip, uint16_t *len) {
|
|||
waitcount--;
|
||||
}
|
||||
|
||||
optimizedSniff((uint16_t*)mem, (*len) >> 2);
|
||||
optimizedSniff((uint16_t *)mem, (*len) >> 2);
|
||||
|
||||
Dbprintf("Trigger kicked in (%d >= 180)", r);
|
||||
}
|
||||
|
|
|
@ -258,7 +258,7 @@ int CmdHFSniff(const char *Cmd) {
|
|||
params.triggersToSkip = param_get32ex(Cmd, 1, 0, 10);
|
||||
|
||||
clearCommandBuffer();
|
||||
SendCommandNG(CMD_HF_SNIFF, (uint8_t*)¶ms, sizeof(params));
|
||||
SendCommandNG(CMD_HF_SNIFF, (uint8_t *)¶ms, sizeof(params));
|
||||
|
||||
for (;;) {
|
||||
|
||||
|
|
|
@ -1014,7 +1014,7 @@ int EM4x50Read(const char *Cmd, bool verbose) {
|
|||
PrintAndLogEx(INFO, "%03d | %08x", block, Code[block]);
|
||||
}
|
||||
PrintAndLogEx(INFO, "----+--------------");
|
||||
PrintAndLogEx( (AllPTest) ? SUCCESS : WARNING, "Parities checks | %s", (AllPTest) ? _GREEN_("Passed") : _RED_("Fail"));
|
||||
PrintAndLogEx((AllPTest) ? SUCCESS : WARNING, "Parities checks | %s", (AllPTest) ? _GREEN_("Passed") : _RED_("Fail"));
|
||||
|
||||
if (AllPTest == false) {
|
||||
PrintAndLogEx(HINT, "Try cleaning the read samples with " _YELLOW_("'data askedge'"));
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
// Partly ripped from PyRun_SimpleFileExFlags
|
||||
// but does not terminate client on sys.exit
|
||||
// and print exit code only if != 0
|
||||
static int Pm3PyRun_SimpleFileNoExit(FILE *fp, const char *filename)
|
||||
{
|
||||
static int Pm3PyRun_SimpleFileNoExit(FILE *fp, const char *filename) {
|
||||
PyObject *m, *d, *v;
|
||||
int set_file_name = 0, ret = -1;
|
||||
m = PyImport_AddModule("__main__");
|
||||
|
@ -86,7 +85,7 @@ static int Pm3PyRun_SimpleFileNoExit(FILE *fp, const char *filename)
|
|||
}
|
||||
Py_DECREF(v);
|
||||
ret = 0;
|
||||
done:
|
||||
done:
|
||||
if (set_file_name && PyDict_DelItemString(d, "__file__"))
|
||||
PyErr_Clear();
|
||||
Py_XDECREF(m);
|
||||
|
|
|
@ -1455,7 +1455,7 @@ static int CmdEMVScan(const char *Cmd) {
|
|||
// current path + file name
|
||||
if (MergeJSON) {
|
||||
|
||||
root = json_load_file( (char*)filename, 0, &error);
|
||||
root = json_load_file((char *)filename, 0, &error);
|
||||
if (!root) {
|
||||
PrintAndLogEx(ERR, "Json error on line %d: %s", error.line, error.text);
|
||||
return PM3_EFILE;
|
||||
|
@ -1750,15 +1750,15 @@ static int CmdEMVScan(const char *Cmd) {
|
|||
|
||||
if (MergeJSON == false) {
|
||||
// create unique new name
|
||||
char *fname = newfilenamemcopy((char*)filename, ".json");
|
||||
char *fname = newfilenamemcopy((char *)filename, ".json");
|
||||
if (fname == NULL) {
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
strcpy((char*)filename, fname);
|
||||
strcpy((char *)filename, fname);
|
||||
free(fname);
|
||||
}
|
||||
|
||||
res = json_dump_file(root, (char*)filename, JSON_INDENT(2));
|
||||
res = json_dump_file(root, (char *)filename, JSON_INDENT(2));
|
||||
if (res) {
|
||||
PrintAndLogEx(ERR, "Can't save the file: %s", filename);
|
||||
return PM3_EFILE;
|
||||
|
|
|
@ -504,15 +504,15 @@ struct emv_pk *emv_pk_get_ca_pk(const unsigned char *rid, unsigned char idx) {
|
|||
bool isok = emv_pk_verify(pk);
|
||||
|
||||
PrintAndLogEx(INFO, "Verifying CA PK for %02hhx:%02hhx:%02hhx:%02hhx:%02hhx IDX %02hhx %zu bits. ( %s )",
|
||||
pk->rid[0],
|
||||
pk->rid[1],
|
||||
pk->rid[2],
|
||||
pk->rid[3],
|
||||
pk->rid[4],
|
||||
pk->index,
|
||||
pk->mlen * 8,
|
||||
(isok) ? _GREEN_("ok") : _RED_("failed")
|
||||
);
|
||||
pk->rid[0],
|
||||
pk->rid[1],
|
||||
pk->rid[2],
|
||||
pk->rid[3],
|
||||
pk->rid[4],
|
||||
pk->index,
|
||||
pk->mlen * 8,
|
||||
(isok) ? _GREEN_("ok") : _RED_("failed")
|
||||
);
|
||||
|
||||
if (isok) {
|
||||
return pk;
|
||||
|
|
|
@ -1369,17 +1369,17 @@ static int convert_plain_mfu_dump(uint8_t **dump, size_t *dumplen, bool verbose)
|
|||
}
|
||||
|
||||
static int convert_old_mfu_dump(uint8_t **dump, size_t *dumplen, bool verbose) {
|
||||
/* For reference
|
||||
typedef struct {
|
||||
uint8_t version[8];
|
||||
uint8_t tbo[2];
|
||||
uint8_t tearing[3];
|
||||
uint8_t pack[2];
|
||||
uint8_t tbo1[1];
|
||||
uint8_t signature[32];
|
||||
uint8_t data[1024];
|
||||
} PACKED old_mfu_dump_t;
|
||||
*/
|
||||
/* For reference
|
||||
typedef struct {
|
||||
uint8_t version[8];
|
||||
uint8_t tbo[2];
|
||||
uint8_t tearing[3];
|
||||
uint8_t pack[2];
|
||||
uint8_t tbo1[1];
|
||||
uint8_t signature[32];
|
||||
uint8_t data[1024];
|
||||
} PACKED old_mfu_dump_t;
|
||||
*/
|
||||
|
||||
// convert old format
|
||||
old_mfu_dump_t *old_mfu_dump = (old_mfu_dump_t *)*dump;
|
||||
|
|
|
@ -882,7 +882,7 @@ void mifare_cypher_blocks_chained(desfiretag_t tag, desfirekey_t key, uint8_t *i
|
|||
}
|
||||
|
||||
void desfire_crc32(const uint8_t *data, const size_t len, uint8_t *crc) {
|
||||
crc32_ex(data,len,crc);
|
||||
crc32_ex(data, len, crc);
|
||||
}
|
||||
|
||||
void desfire_crc32_append(uint8_t *data, const size_t len) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue