This commit is contained in:
iceman1001 2020-03-09 16:57:13 +01:00
parent 8a3f2d03ac
commit 59bae5000c
2 changed files with 39 additions and 39 deletions

View file

@ -45,7 +45,7 @@
* This module emits debug strings during normal operation -- so try it out in * This module emits debug strings during normal operation -- so try it out in
* the lab connected to PM3 client before taking it into the field. * the lab connected to PM3 client before taking it into the field.
* *
* To delete the trace data from flash: * To delete the trace data from flash:
* *
* Caveats / notes: * Caveats / notes:
* - Trace buffer will be cleared on starting stand-alone mode. Data in flash * - Trace buffer will be cleared on starting stand-alone mode. Data in flash
@ -97,7 +97,7 @@ void RunMod() {
if (trace_len > 0) { if (trace_len > 0) {
Dbprintf("[!] Trace length (bytes) = %u", trace_len); Dbprintf("[!] Trace length (bytes) = %u", trace_len);
uint8_t* trace_buffer = BigBuf_get_addr(); uint8_t *trace_buffer = BigBuf_get_addr();
if (!exists_in_spiffs(HF_14ASNIFF_LOGFILE)) { if (!exists_in_spiffs(HF_14ASNIFF_LOGFILE)) {
rdv40_spiffs_write( rdv40_spiffs_write(
HF_14ASNIFF_LOGFILE, trace_buffer, trace_len, RDV40_SPIFFS_SAFETY_SAFE); HF_14ASNIFF_LOGFILE, trace_buffer, trace_len, RDV40_SPIFFS_SAFETY_SAFE);
@ -117,7 +117,7 @@ void RunMod() {
SpinErr(LED_A, 200, 5); SpinErr(LED_A, 200, 5);
SpinDelay(100); SpinDelay(100);
LEDsoff(); LEDsoff();
SpinDelay(300); SpinDelay(300);
DownloadTraceInstructions(); DownloadTraceInstructions();

View file

@ -63,7 +63,7 @@ void DownloadLogInstructions() {
bool log_exists; bool log_exists;
void append(uint8_t* entry, size_t entry_len) { void append(uint8_t *entry, size_t entry_len) {
LED_B_ON(); LED_B_ON();
if (log_exists == false) { if (log_exists == false) {
@ -106,22 +106,22 @@ uint32_t IceEM410xdemod() {
if (size == 128) { if (size == 128) {
sprintf((char *)entry, "EM XL TAG ID: %06lx%08lx%08lx - (%05ld_%03ld_%08ld)\n", sprintf((char *)entry, "EM XL TAG ID: %06lx%08lx%08lx - (%05ld_%03ld_%08ld)\n",
hi, hi,
(uint32_t)(lo >> 32), (uint32_t)(lo >> 32),
(uint32_t)lo, (uint32_t)lo,
(uint32_t)(lo & 0xFFFF), (uint32_t)(lo & 0xFFFF),
(uint32_t)((lo >> 16LL) & 0xFF), (uint32_t)((lo >> 16LL) & 0xFF),
(uint32_t)(lo & 0xFFFFFF)); (uint32_t)(lo & 0xFFFFFF));
} else { } else {
sprintf((char *)entry, "EM TAG ID: %02lx%08lx - (%05ld_%03ld_%08ld)\n", sprintf((char *)entry, "EM TAG ID: %02lx%08lx - (%05ld_%03ld_%08ld)\n",
(uint32_t)(lo >> 32), (uint32_t)(lo >> 32),
(uint32_t)lo, (uint32_t)lo,
(uint32_t)(lo & 0xFFFF), (uint32_t)(lo & 0xFFFF),
(uint32_t)((lo >> 16LL) & 0xFF), (uint32_t)((lo >> 16LL) & 0xFF),
(uint32_t)(lo & 0xFFFFFF)); (uint32_t)(lo & 0xFFFFFF));
} }
append(entry, strlen((char*)entry)); append(entry, strlen((char *)entry));
Dbprintf("%s", entry); Dbprintf("%s", entry);
BigBuf_free(); BigBuf_free();
return PM3_SUCCESS; return PM3_SUCCESS;
@ -173,7 +173,7 @@ uint32_t IceAWIDdemod() {
} }
} }
append(entry, strlen((char*)entry)); append(entry, strlen((char *)entry));
Dbprintf("%s", entry); Dbprintf("%s", entry);
BigBuf_free(); BigBuf_free();
return PM3_SUCCESS; return PM3_SUCCESS;
@ -210,14 +210,14 @@ uint32_t IceIOdemod() {
memset(entry, 0, sizeof(entry)); memset(entry, 0, sizeof(entry));
sprintf((char *)entry, "IO Prox XSF(%02d)%02x:%05d (%08lx%08lx)\n" sprintf((char *)entry, "IO Prox XSF(%02d)%02x:%05d (%08lx%08lx)\n"
, version , version
, facilitycode , facilitycode
, number , number
, hi , hi
, lo , lo
); );
append(entry, strlen((char*)entry)); append(entry, strlen((char *)entry));
Dbprintf("%s", entry); Dbprintf("%s", entry);
BigBuf_free(); BigBuf_free();
return PM3_SUCCESS; return PM3_SUCCESS;
@ -250,13 +250,13 @@ uint32_t IceHIDDemod() {
if (hi2 != 0) { //extra large HID tags 88/192 bits if (hi2 != 0) { //extra large HID tags 88/192 bits
sprintf((char *)entry, "HID large: %lx%08lx%08lx (%ld)\n", sprintf((char *)entry, "HID large: %lx%08lx%08lx (%ld)\n",
hi2, hi2,
hi, hi,
lo, lo,
(lo >> 1) & 0xFFFF (lo >> 1) & 0xFFFF
); );
append(entry, strlen((char*)entry)); append(entry, strlen((char *)entry));
} else { //standard HID tags 44/96 bits } else { //standard HID tags 44/96 bits
uint8_t bitlen = 0; uint8_t bitlen = 0;
@ -297,15 +297,15 @@ uint32_t IceHIDDemod() {
} }
sprintf((char *)entry, "HID: %lx%08lx (%ld) Format: %d bit FC: %ld Card: %ld\n", sprintf((char *)entry, "HID: %lx%08lx (%ld) Format: %d bit FC: %ld Card: %ld\n",
hi, hi,
lo, lo,
(lo >> 1) & 0xFFFF, (lo >> 1) & 0xFFFF,
bitlen, bitlen,
fac, fac,
cardnum cardnum
); );
append(entry, strlen((char*)entry)); append(entry, strlen((char *)entry));
} }
Dbprintf("%s", entry); Dbprintf("%s", entry);
@ -349,7 +349,7 @@ void RunMod() {
uint32_t res; uint32_t res;
// since we steal 12800 from bigbuffer, no need to sample it. // since we steal 12800 from bigbuffer, no need to sample it.
DoAcquisition_config(false, 28000); DoAcquisition_config(false, 28000);
res = IceHIDDemod(); res = IceHIDDemod();
if (res == PM3_SUCCESS) { if (res == PM3_SUCCESS) {