mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part2
This commit is contained in:
parent
125a98a110
commit
1a07fd510d
4 changed files with 7 additions and 5 deletions
|
@ -31,13 +31,13 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
|
||||||
// delay between requests
|
// delay between requests
|
||||||
unsigned int d = 0;
|
unsigned int d = 0;
|
||||||
|
|
||||||
sscanf(Cmd, "%hhu %u %u", &m, &n, &d);
|
sscanf(Cmd, "%"hhu" %u %u", &m, &n, &d);
|
||||||
|
|
||||||
// values are expected to be > 0
|
// values are expected to be > 0
|
||||||
m = m > 0 ? m : 1;
|
m = m > 0 ? m : 1;
|
||||||
n = n > 0 ? n : 1;
|
n = n > 0 ? n : 1;
|
||||||
|
|
||||||
PrintAndLog("Collecting %u %hhu-byte nonces", n, m);
|
PrintAndLog("Collecting %u %"hhu"-byte nonces", n, m);
|
||||||
PrintAndLog("Start: %u", time(NULL));
|
PrintAndLog("Start: %u", time(NULL));
|
||||||
// repeat n times
|
// repeat n times
|
||||||
for (unsigned int i = 0; i < n; i++) {
|
for (unsigned int i = 0; i < n; i++) {
|
||||||
|
|
|
@ -324,7 +324,7 @@ int CmdLegicRfSim(const char *Cmd)
|
||||||
c.arg[0] = 6;
|
c.arg[0] = 6;
|
||||||
c.arg[1] = 3;
|
c.arg[1] = 3;
|
||||||
c.arg[2] = 0;
|
c.arg[2] = 0;
|
||||||
sscanf(Cmd, " %lli %lli %lli", &c.arg[0], &c.arg[1], &c.arg[2]);
|
sscanf(Cmd, " %"lli" %"lli" %"lli, &c.arg[0], &c.arg[1], &c.arg[2]);
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ int CmdLegicRfWrite(const char *Cmd)
|
||||||
int CmdLegicRfFill(const char *Cmd)
|
int CmdLegicRfFill(const char *Cmd)
|
||||||
{
|
{
|
||||||
UsbCommand cmd ={CMD_WRITER_LEGIC_RF};
|
UsbCommand cmd ={CMD_WRITER_LEGIC_RF};
|
||||||
int res = sscanf(Cmd, " 0x%llx 0x%llx 0x%llx", &cmd.arg[0], &cmd.arg[1], &cmd.arg[2]);
|
int res = sscanf(Cmd, " 0x%"llx" 0x%"llx" 0x%"llx, &cmd.arg[0], &cmd.arg[1], &cmd.arg[2]);
|
||||||
if(res != 3) {
|
if(res != 3) {
|
||||||
PrintAndLog("Please specify the offset, length and value as two hex strings");
|
PrintAndLog("Please specify the offset, length and value as two hex strings");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -38,7 +38,7 @@ int CmdLFCommandRead(const char *Cmd)
|
||||||
dummy[0]= ' ';
|
dummy[0]= ' ';
|
||||||
|
|
||||||
UsbCommand c = {CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K};
|
UsbCommand c = {CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K};
|
||||||
sscanf(Cmd, "%lli %lli %lli %s %s", &c.arg[0], &c.arg[1], &c.arg[2], (char *) &c.d.asBytes,(char *) &dummy+1);
|
sscanf(Cmd, "%"lli" %"lli" %"lli" %s %s", &c.arg[0], &c.arg[1], &c.arg[2],(char*)(&c.d.asBytes),(char*)(&dummy+1));
|
||||||
// in case they specified 'h'
|
// in case they specified 'h'
|
||||||
strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy);
|
strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy);
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#define llx PRIx64
|
#define llx PRIx64
|
||||||
|
#define lli PRIi64
|
||||||
|
#define hhu PRIu8
|
||||||
|
|
||||||
#include <usb.h>
|
#include <usb.h>
|
||||||
#include "usb_cmd.h"
|
#include "usb_cmd.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue