mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
FIX: a solution for the issue "hf mf esave - always saves 4K"
FIX: a solution for the issue "hf eload, esave, cload, save - filepath variable too short" CHG: minor code clean up. ADD: AES / CRC16 for lua. (and tnp3xx scripts.) ADD: tnp3dump.lua script to dump tnp3xx tags. ADD: tnp3sim.lua script to let PM3 imitate an tnp3xx tag. Needs to be tested live
This commit is contained in:
parent
d91a31f935
commit
b915fda392
19 changed files with 1137 additions and 133 deletions
|
@ -46,12 +46,18 @@ int ukbhit(void) {
|
|||
#endif
|
||||
|
||||
// log files functions
|
||||
void AddLogLine(char *fileName, char *extData, char *c) {
|
||||
void AddLogLine(char *file, char *extData, char *c) {
|
||||
FILE *fLog = NULL;
|
||||
char filename[FILE_PATH_SIZE] = {0x00};
|
||||
int len = 0;
|
||||
|
||||
fLog = fopen(fileName, "a");
|
||||
len = strlen(file);
|
||||
if (len > FILE_PATH_SIZE) len = FILE_PATH_SIZE;
|
||||
memcpy(filename, file, len);
|
||||
|
||||
fLog = fopen(filename, "a");
|
||||
if (!fLog) {
|
||||
printf("Could not append log file %s", fileName);
|
||||
printf("Could not append log file %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -103,11 +109,13 @@ void print_hex(const uint8_t * data, const size_t len)
|
|||
}
|
||||
|
||||
char * sprint_hex(const uint8_t * data, const size_t len) {
|
||||
|
||||
int maxLen = ( len > 1024/3) ? 1024/3 : len;
|
||||
static char buf[1024];
|
||||
char * tmp = buf;
|
||||
size_t i;
|
||||
|
||||
for (i=0; i < len && i < 1024/3; i++, tmp += 3)
|
||||
for (i=0; i < maxLen; ++i, tmp += 3)
|
||||
sprintf(tmp, "%02x ", data[i]);
|
||||
|
||||
return buf;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue