mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
make style (linux)
This commit is contained in:
parent
dbc730468a
commit
59667e5d1b
16 changed files with 4007 additions and 4125 deletions
|
@ -4,8 +4,8 @@
|
||||||
typedef struct pm3_device pm3;
|
typedef struct pm3_device pm3;
|
||||||
|
|
||||||
pm3 *pm3_open(char *port);
|
pm3 *pm3_open(char *port);
|
||||||
int pm3_console(pm3* dev, char *cmd);
|
int pm3_console(pm3 *dev, char *cmd);
|
||||||
const char *pm3_name_get(pm3* dev);
|
const char *pm3_name_get(pm3 *dev);
|
||||||
void pm3_close(pm3* dev);
|
void pm3_close(pm3 *dev);
|
||||||
pm3 *pm3_get_current_dev(void);
|
pm3 *pm3_get_current_dev(void);
|
||||||
#endif // LIBPM3_H
|
#endif // LIBPM3_H
|
||||||
|
|
|
@ -3038,7 +3038,7 @@ typedef struct {
|
||||||
|
|
||||||
static size_t iclass_tc = 1;
|
static size_t iclass_tc = 1;
|
||||||
|
|
||||||
static void* bf_generate_mac(void *thread_arg) {
|
static void *bf_generate_mac(void *thread_arg) {
|
||||||
|
|
||||||
iclass_thread_arg_t *targ = (iclass_thread_arg_t *)thread_arg;
|
iclass_thread_arg_t *targ = (iclass_thread_arg_t *)thread_arg;
|
||||||
const uint8_t idx = targ->thread_idx;
|
const uint8_t idx = targ->thread_idx;
|
||||||
|
@ -3086,8 +3086,8 @@ void GenerateMacFrom(uint8_t *CSN, uint8_t *CCNR, bool use_raw, bool use_elite,
|
||||||
args[i].keys = keys;
|
args[i].keys = keys;
|
||||||
args[i].list.premac = list;
|
args[i].list.premac = list;
|
||||||
|
|
||||||
memcpy(args[i].csn, CSN, sizeof(args[i].csn) );
|
memcpy(args[i].csn, CSN, sizeof(args[i].csn));
|
||||||
memcpy(args[i].cc_nr, CCNR, sizeof(args[i].cc_nr) );
|
memcpy(args[i].cc_nr, CCNR, sizeof(args[i].cc_nr));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < iclass_tc; i++) {
|
for (int i = 0; i < iclass_tc; i++) {
|
||||||
|
@ -3103,7 +3103,7 @@ void GenerateMacFrom(uint8_t *CSN, uint8_t *CCNR, bool use_raw, bool use_elite,
|
||||||
pthread_join(threads[i], NULL);
|
pthread_join(threads[i], NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* bf_generate_mackey(void *thread_arg) {
|
static void *bf_generate_mackey(void *thread_arg) {
|
||||||
|
|
||||||
iclass_thread_arg_t *targ = (iclass_thread_arg_t *)thread_arg;
|
iclass_thread_arg_t *targ = (iclass_thread_arg_t *)thread_arg;
|
||||||
const uint8_t idx = targ->thread_idx;
|
const uint8_t idx = targ->thread_idx;
|
||||||
|
@ -3149,8 +3149,8 @@ void GenerateMacKeyFrom(uint8_t *CSN, uint8_t *CCNR, bool use_raw, bool use_elit
|
||||||
args[i].keys = keys;
|
args[i].keys = keys;
|
||||||
args[i].list.prekey = list;
|
args[i].list.prekey = list;
|
||||||
|
|
||||||
memcpy(args[i].csn, CSN, sizeof(args[i].csn) );
|
memcpy(args[i].csn, CSN, sizeof(args[i].csn));
|
||||||
memcpy(args[i].cc_nr, CCNR, sizeof(args[i].cc_nr) );
|
memcpy(args[i].cc_nr, CCNR, sizeof(args[i].cc_nr));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < iclass_tc; i++) {
|
for (int i = 0; i < iclass_tc; i++) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ static int pac_buf_to_cardid(uint8_t *src, const size_t src_size, uint8_t *dst,
|
||||||
|
|
||||||
// convert a 16 byte array of raw demod data (FF204990XX...) to 8 bytes of PAC_8byte ID
|
// convert a 16 byte array of raw demod data (FF204990XX...) to 8 bytes of PAC_8byte ID
|
||||||
// performs no parity or checksum validation
|
// performs no parity or checksum validation
|
||||||
static void pac_raw_to_cardid(const uint8_t* src, uint8_t *dst) {
|
static void pac_raw_to_cardid(const uint8_t *src, uint8_t *dst) {
|
||||||
for (int i = 4; i < 12; i++) {
|
for (int i = 4; i < 12; i++) {
|
||||||
uint8_t shift = 7 - (i + 3) % 4 * 2;
|
uint8_t shift = 7 - (i + 3) % 4 * 2;
|
||||||
size_t index = i + (i - 1) / 4;
|
size_t index = i + (i - 1) / 4;
|
||||||
|
@ -236,7 +236,7 @@ static int CmdPacClone(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnlen == 8 || cnlen == 9) {
|
if (cnlen == 8 || cnlen == 9) {
|
||||||
pac_cardid_to_raw((char*)cnstr, raw);
|
pac_cardid_to_raw((char *)cnstr, raw);
|
||||||
} else {
|
} else {
|
||||||
pac_raw_to_cardid(raw, cnstr);
|
pac_raw_to_cardid(raw, cnstr);
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ static int CmdPacSim(const char *Cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cnlen == 8 || cnlen == 9) {
|
if (cnlen == 8 || cnlen == 9) {
|
||||||
pac_cardid_to_raw((char*)cnstr, raw);
|
pac_cardid_to_raw((char *)cnstr, raw);
|
||||||
} else {
|
} else {
|
||||||
pac_raw_to_cardid(raw, cnstr);
|
pac_raw_to_cardid(raw, cnstr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,7 +323,8 @@ static int CmdParadoxSim(const char *Cmd) {
|
||||||
if (resp.status != PM3_EOPABORTED)
|
if (resp.status != PM3_EOPABORTED)
|
||||||
return resp.status;
|
return resp.status;
|
||||||
|
|
||||||
return PM3_SUCCESS;}
|
return PM3_SUCCESS;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
|
|
||||||
if (sscanf(Cmd, "%u %u", &fc, &cn) != 2) return usage_lf_paradox_sim();
|
if (sscanf(Cmd, "%u %u", &fc, &cn) != 2) return usage_lf_paradox_sim();
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int detectPresco(uint8_t *dest, size_t *size) {
|
||||||
|
|
||||||
// convert base 12 ID to sitecode & usercode & 8 bit other unknown code
|
// convert base 12 ID to sitecode & usercode & 8 bit other unknown code
|
||||||
static int getWiegandFromPrintedPresco(void *arr, uint32_t *fullcode) {
|
static int getWiegandFromPrintedPresco(void *arr, uint32_t *fullcode) {
|
||||||
char *s = (char*)arr;
|
char *s = (char *)arr;
|
||||||
uint8_t val = 0;
|
uint8_t val = 0;
|
||||||
for (int i = 0; i < strlen(s); ++i) {
|
for (int i = 0; i < strlen(s); ++i) {
|
||||||
// Get value from number string.
|
// Get value from number string.
|
||||||
|
@ -162,7 +162,7 @@ static int CmdPrescoClone(const char *Cmd) {
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
int hex_len = 0;
|
int hex_len = 0;
|
||||||
uint8_t hex[4] = {0,0,0,0};
|
uint8_t hex[4] = {0, 0, 0, 0};
|
||||||
CLIGetHexWithReturn(ctx, 1, hex, &hex_len);
|
CLIGetHexWithReturn(ctx, 1, hex, &hex_len);
|
||||||
|
|
||||||
uint8_t idstr[11];
|
uint8_t idstr[11];
|
||||||
|
@ -265,7 +265,7 @@ static int CmdPrescoSim(const char *Cmd) {
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
int hex_len = 0;
|
int hex_len = 0;
|
||||||
uint8_t hex[4] = {0,0,0,0};
|
uint8_t hex[4] = {0, 0, 0, 0};
|
||||||
CLIGetHexWithReturn(ctx, 1, hex, &hex_len);
|
CLIGetHexWithReturn(ctx, 1, hex, &hex_len);
|
||||||
|
|
||||||
uint8_t idstr[11];
|
uint8_t idstr[11];
|
||||||
|
|
|
@ -32,12 +32,12 @@
|
||||||
#include "fileutils.h"
|
#include "fileutils.h"
|
||||||
|
|
||||||
#ifdef HAVE_LUA_SWIG
|
#ifdef HAVE_LUA_SWIG
|
||||||
extern int luaopen_pm3(lua_State* L);
|
extern int luaopen_pm3(lua_State *L);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
#ifdef HAVE_PYTHON_SWIG
|
#ifdef HAVE_PYTHON_SWIG
|
||||||
extern PyObject* PyInit__pm3(void);
|
extern PyObject *PyInit__pm3(void);
|
||||||
#endif // HAVE_PYTHON_SWIG
|
#endif // HAVE_PYTHON_SWIG
|
||||||
|
|
||||||
// Partly ripped from PyRun_SimpleFileExFlags
|
// Partly ripped from PyRun_SimpleFileExFlags
|
||||||
|
|
|
@ -232,7 +232,7 @@ void hash2(uint8_t *key64, uint8_t *outp_keytable) {
|
||||||
|
|
||||||
if (g_debugMode > 0) {
|
if (g_debugMode > 0) {
|
||||||
PrintAndLogEx(DEBUG, "High security custom key (Kcus):");
|
PrintAndLogEx(DEBUG, "High security custom key (Kcus):");
|
||||||
PrintAndLogEx(DEBUG, "z0 %s", sprint_hex(z[0],8));
|
PrintAndLogEx(DEBUG, "z0 %s", sprint_hex(z[0], 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t y[8][8] = {{0}, {0}};
|
uint8_t y[8][8] = {{0}, {0}};
|
||||||
|
@ -308,7 +308,7 @@ typedef struct {
|
||||||
static size_t loclass_tc = 1;
|
static size_t loclass_tc = 1;
|
||||||
static int loclass_found = 0;
|
static int loclass_found = 0;
|
||||||
|
|
||||||
static void* bf_thread(void* thread_arg) {
|
static void *bf_thread(void *thread_arg) {
|
||||||
|
|
||||||
loclass_thread_arg_t *targ = (loclass_thread_arg_t *)thread_arg;
|
loclass_thread_arg_t *targ = (loclass_thread_arg_t *)thread_arg;
|
||||||
const uint32_t endmask = targ->endmask;
|
const uint32_t endmask = targ->endmask;
|
||||||
|
@ -332,7 +332,7 @@ static void* bf_thread(void* thread_arg) {
|
||||||
int found;
|
int found;
|
||||||
while (!(brute & endmask)) {
|
while (!(brute & endmask)) {
|
||||||
|
|
||||||
found = __atomic_load_n (&loclass_found, __ATOMIC_SEQ_CST);
|
found = __atomic_load_n(&loclass_found, __ATOMIC_SEQ_CST);
|
||||||
|
|
||||||
if (found != 0xFF) return NULL;
|
if (found != 0xFF) return NULL;
|
||||||
|
|
||||||
|
@ -370,13 +370,13 @@ static void* bf_thread(void* thread_arg) {
|
||||||
// success
|
// success
|
||||||
if (memcmp(calculated_MAC, mac, 4) == 0) {
|
if (memcmp(calculated_MAC, mac, 4) == 0) {
|
||||||
|
|
||||||
loclass_thread_ret_t *r = (loclass_thread_ret_t*)malloc(sizeof(loclass_thread_ret_t));
|
loclass_thread_ret_t *r = (loclass_thread_ret_t *)malloc(sizeof(loclass_thread_ret_t));
|
||||||
|
|
||||||
for (uint8_t i = 0 ; i < numbytes_to_recover; i++) {
|
for (uint8_t i = 0 ; i < numbytes_to_recover; i++) {
|
||||||
r->values[i] = keytable[bytes_to_recover[i]] & 0xFF;
|
r->values[i] = keytable[bytes_to_recover[i]] & 0xFF;
|
||||||
}
|
}
|
||||||
__atomic_store_n(&loclass_found, targ->thread_idx, __ATOMIC_SEQ_CST);
|
__atomic_store_n(&loclass_found, targ->thread_idx, __ATOMIC_SEQ_CST);
|
||||||
pthread_exit ((void*)r);
|
pthread_exit((void *)r);
|
||||||
}
|
}
|
||||||
|
|
||||||
brute += loclass_tc;
|
brute += loclass_tc;
|
||||||
|
@ -385,11 +385,11 @@ static void* bf_thread(void* thread_arg) {
|
||||||
|
|
||||||
if (numbytes_to_recover == 3) {
|
if (numbytes_to_recover == 3) {
|
||||||
if ((brute > 0) && ((brute & 0xFFFF) == 0)) {
|
if ((brute > 0) && ((brute & 0xFFFF) == 0)) {
|
||||||
PrintAndLogEx(INPLACE, "[ %02x %02x %02x ] %8u / %u", bytes_to_recover[0], bytes_to_recover[1], bytes_to_recover[2] , brute, 0xFFFFFF);
|
PrintAndLogEx(INPLACE, "[ %02x %02x %02x ] %8u / %u", bytes_to_recover[0], bytes_to_recover[1], bytes_to_recover[2], brute, 0xFFFFFF);
|
||||||
}
|
}
|
||||||
} else if (numbytes_to_recover == 2) {
|
} else if (numbytes_to_recover == 2) {
|
||||||
if ((brute > 0) && ((brute & 0x3F) == 0))
|
if ((brute > 0) && ((brute & 0x3F) == 0))
|
||||||
PrintAndLogEx(INPLACE, "[ %02x %02x ] %5u / %u" _CLR_ , bytes_to_recover[0], bytes_to_recover[1], brute, 0xFFFF);
|
PrintAndLogEx(INPLACE, "[ %02x %02x ] %5u / %u" _CLR_, bytes_to_recover[0], bytes_to_recover[1], brute, 0xFFFF);
|
||||||
} else {
|
} else {
|
||||||
if ((brute > 0) && ((brute & 0x1F) == 0))
|
if ((brute > 0) && ((brute & 0x1F) == 0))
|
||||||
PrintAndLogEx(INPLACE, "[ %02x ] %3u / %u" _CLR_, bytes_to_recover[0], brute, 0xFF);
|
PrintAndLogEx(INPLACE, "[ %02x ] %3u / %u" _CLR_, bytes_to_recover[0], brute, 0xFF);
|
||||||
|
@ -397,7 +397,7 @@ static void* bf_thread(void* thread_arg) {
|
||||||
}
|
}
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
|
||||||
void* dummyptr = NULL;
|
void *dummyptr = NULL;
|
||||||
return dummyptr;
|
return dummyptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,9 +455,9 @@ int bruteforceItem(loclass_dumpdata_t item, uint16_t keytable[]) {
|
||||||
args[i].numbytes_to_recover = numbytes_to_recover;
|
args[i].numbytes_to_recover = numbytes_to_recover;
|
||||||
args[i].endmask = 1 << 8 * numbytes_to_recover;
|
args[i].endmask = 1 << 8 * numbytes_to_recover;
|
||||||
|
|
||||||
memcpy((void*)&args[i].item, (void*)&item, sizeof(loclass_dumpdata_t));
|
memcpy((void *)&args[i].item, (void *)&item, sizeof(loclass_dumpdata_t));
|
||||||
memcpy(args[i].bytes_to_recover, bytes_to_recover, sizeof(args[i].bytes_to_recover) );
|
memcpy(args[i].bytes_to_recover, bytes_to_recover, sizeof(args[i].bytes_to_recover));
|
||||||
memcpy(args[i].key_index, key_index, sizeof(args[i].key_index) );
|
memcpy(args[i].key_index, key_index, sizeof(args[i].key_index));
|
||||||
memcpy(args[i].keytable, keytable, sizeof(args[i].keytable));
|
memcpy(args[i].keytable, keytable, sizeof(args[i].keytable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ int bruteforceItem(loclass_dumpdata_t item, uint16_t keytable[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// wait for threads to terminate:
|
// wait for threads to terminate:
|
||||||
void* ptrs[loclass_tc];
|
void *ptrs[loclass_tc];
|
||||||
for (int i = 0; i < loclass_tc; i++)
|
for (int i = 0; i < loclass_tc; i++)
|
||||||
pthread_join(threads[i], &ptrs[i]);
|
pthread_join(threads[i], &ptrs[i]);
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ int bruteforceItem(loclass_dumpdata_t item, uint16_t keytable[]) {
|
||||||
uint8_t key_index[8] = {0};
|
uint8_t key_index[8] = {0};
|
||||||
hash1(item.csn, key_index);
|
hash1(item.csn, key_index);
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Determine which bytes to retrieve. A hash is typically
|
* Determine which bytes to retrieve. A hash is typically
|
||||||
* 01010000454501
|
* 01010000454501
|
||||||
* We go through that hash, and in the corresponding keytable, we put markers
|
* We go through that hash, and in the corresponding keytable, we put markers
|
||||||
|
@ -571,13 +571,13 @@ int bruteforceItem(loclass_dumpdata_t item, uint16_t keytable[]) {
|
||||||
//A uint32 has room for 4 bytes, we'll only need 24 of those bits to bruteforce up to three bytes,
|
//A uint32 has room for 4 bytes, we'll only need 24 of those bits to bruteforce up to three bytes,
|
||||||
uint32_t brute = 0;
|
uint32_t brute = 0;
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
Determine where to stop the bruteforce. A 1-byte attack stops after 256 tries,
|
Determine where to stop the bruteforce. A 1-byte attack stops after 256 tries,
|
||||||
(when brute reaches 0x100). And so on...
|
(when brute reaches 0x100). And so on...
|
||||||
bytes_to_recover = 1 --> endmask = 0x000000100
|
bytes_to_recover = 1 --> endmask = 0x000000100
|
||||||
bytes_to_recover = 2 --> endmask = 0x000010000
|
bytes_to_recover = 2 --> endmask = 0x000010000
|
||||||
bytes_to_recover = 3 --> endmask = 0x001000000
|
bytes_to_recover = 3 --> endmask = 0x001000000
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
uint32_t endmask = 1 << 8 * numbytes_to_recover;
|
uint32_t endmask = 1 << 8 * numbytes_to_recover;
|
||||||
PrintAndLogEx(NORMAL, "----------------------------");
|
PrintAndLogEx(NORMAL, "----------------------------");
|
||||||
|
@ -903,11 +903,11 @@ int testElite(bool slowtests) {
|
||||||
int res = PM3_SUCCESS;
|
int res = PM3_SUCCESS;
|
||||||
PrintAndLogEx(INFO, "Testing hash1...");
|
PrintAndLogEx(INFO, "Testing hash1...");
|
||||||
res += _testHash1();
|
res += _testHash1();
|
||||||
PrintAndLogEx((res == PM3_SUCCESS) ? SUCCESS : WARNING, " hash1 (%s)", (res == PM3_SUCCESS) ? _GREEN_("ok") : _RED_("fail") );
|
PrintAndLogEx((res == PM3_SUCCESS) ? SUCCESS : WARNING, " hash1 (%s)", (res == PM3_SUCCESS) ? _GREEN_("ok") : _RED_("fail"));
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "Testing key diversification...");
|
PrintAndLogEx(INFO, "Testing key diversification...");
|
||||||
res += _test_iclass_key_permutation();
|
res += _test_iclass_key_permutation();
|
||||||
PrintAndLogEx((res == PM3_SUCCESS) ? SUCCESS : WARNING, " key diversification (%s)", (res == PM3_SUCCESS) ? _GREEN_("ok") : _RED_("fail") );
|
PrintAndLogEx((res == PM3_SUCCESS) ? SUCCESS : WARNING, " key diversification (%s)", (res == PM3_SUCCESS) ? _GREEN_("ok") : _RED_("fail"));
|
||||||
|
|
||||||
if (slowtests)
|
if (slowtests)
|
||||||
res += _testBruteforce();
|
res += _testBruteforce();
|
||||||
|
|
|
@ -613,7 +613,7 @@ static int testDES2(uint8_t *key, uint64_t csn, uint64_t expected) {
|
||||||
uint64_t crypt_csn = x_bytes_to_num(result, 8);
|
uint64_t crypt_csn = x_bytes_to_num(result, 8);
|
||||||
|
|
||||||
PrintAndLogEx(DEBUG, " {csn} %"PRIx64, crypt_csn);
|
PrintAndLogEx(DEBUG, " {csn} %"PRIx64, crypt_csn);
|
||||||
PrintAndLogEx(DEBUG, " expected %"PRIx64 " (%s)", expected, (expected == crypt_csn) ? _GREEN_("ok") : _RED_("fail") );
|
PrintAndLogEx(DEBUG, " expected %"PRIx64 " (%s)", expected, (expected == crypt_csn) ? _GREEN_("ok") : _RED_("fail"));
|
||||||
|
|
||||||
if (expected != crypt_csn)
|
if (expected != crypt_csn)
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "util_posix.h"
|
#include "util_posix.h"
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
|
|
||||||
pm3_device* pm3_open(char *port) {
|
pm3_device *pm3_open(char *port) {
|
||||||
pm3_init();
|
pm3_init();
|
||||||
OpenProxmark(&session.current_device, port, false, 20, false, USART_BAUD_RATE);
|
OpenProxmark(&session.current_device, port, false, 20, false, USART_BAUD_RATE);
|
||||||
if (session.pm3_present && (TestProxmark(session.current_device) != PM3_SUCCESS)) {
|
if (session.pm3_present && (TestProxmark(session.current_device) != PM3_SUCCESS)) {
|
||||||
|
@ -30,7 +30,7 @@ pm3_device* pm3_open(char *port) {
|
||||||
return session.current_device;
|
return session.current_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pm3_close(pm3_device* dev) {
|
void pm3_close(pm3_device *dev) {
|
||||||
// Clean up the port
|
// Clean up the port
|
||||||
if (session.pm3_present) {
|
if (session.pm3_present) {
|
||||||
clearCommandBuffer();
|
clearCommandBuffer();
|
||||||
|
@ -40,16 +40,16 @@ void pm3_close(pm3_device* dev) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int pm3_console(pm3_device* dev, char *Cmd) {
|
int pm3_console(pm3_device *dev, char *Cmd) {
|
||||||
// For now, there is no real device context:
|
// For now, there is no real device context:
|
||||||
(void) dev;
|
(void) dev;
|
||||||
return CommandReceived(Cmd);
|
return CommandReceived(Cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *pm3_name_get(pm3_device* dev) {
|
const char *pm3_name_get(pm3_device *dev) {
|
||||||
return dev->conn->serial_port_name;
|
return dev->conn->serial_port_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
pm3_device* pm3_get_current_dev(void) {
|
pm3_device *pm3_get_current_dev(void) {
|
||||||
return session.current_device;
|
return session.current_device;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -446,10 +446,10 @@ void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void bytes_to_bytebits(void* src, size_t srclen, void* dest) {
|
void bytes_to_bytebits(void *src, size_t srclen, void *dest) {
|
||||||
|
|
||||||
uint8_t *s = (uint8_t*)src;
|
uint8_t *s = (uint8_t *)src;
|
||||||
uint8_t *d = (uint8_t*)dest;
|
uint8_t *d = (uint8_t *)dest;
|
||||||
|
|
||||||
uint32_t i = srclen * 8;
|
uint32_t i = srclen * 8;
|
||||||
while (srclen--) {
|
while (srclen--) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ void print_blocks(uint32_t *data, size_t len);
|
||||||
int hex_to_bytes(const char *hexValue, uint8_t *bytesValue, size_t maxBytesValueLen);
|
int hex_to_bytes(const char *hexValue, uint8_t *bytesValue, size_t maxBytesValueLen);
|
||||||
void num_to_bytebits(uint64_t n, size_t len, uint8_t *dest);
|
void num_to_bytebits(uint64_t n, size_t len, uint8_t *dest);
|
||||||
void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest);
|
void num_to_bytebitsLSBF(uint64_t n, size_t len, uint8_t *dest);
|
||||||
void bytes_to_bytebits(void* src, size_t srclen, void* dest);
|
void bytes_to_bytebits(void *src, size_t srclen, void *dest);
|
||||||
|
|
||||||
// Swap endian on arrays up to 64bytes.
|
// Swap endian on arrays up to 64bytes.
|
||||||
uint8_t *SwapEndian64(const uint8_t *src, const size_t len, const uint8_t blockSize);
|
uint8_t *SwapEndian64(const uint8_t *src, const size_t len, const uint8_t blockSize);
|
||||||
|
|
|
@ -732,7 +732,7 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`lf keri help `|Y |`This help`
|
|`lf keri help `|Y |`This help`
|
||||||
|`lf keri demod `|Y |`Demodulate an KERI tag from the GraphBuffer`
|
|`lf keri demod `|Y |`Demodulate an KERI tag from the GraphBuffer`
|
||||||
|`lf keri reader `|N |`Attempt to read and extract tag data from the antenna`
|
|`lf keri read `|N |`Attempt to read and extract tag data from the antenna`
|
||||||
|`lf keri clone `|N |`clone KERI tag to T55x7 or Q5/T5555`
|
|`lf keri clone `|N |`clone KERI tag to T55x7 or Q5/T5555`
|
||||||
|`lf keri sim `|N |`simulate KERI tag`
|
|`lf keri sim `|N |`simulate KERI tag`
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`lf motorola help `|Y |`This help`
|
|`lf motorola help `|Y |`This help`
|
||||||
|`lf motorola demod `|Y |`Demodulate an MOTOROLA tag from the GraphBuffer`
|
|`lf motorola demod `|Y |`Demodulate an MOTOROLA tag from the GraphBuffer`
|
||||||
|`lf motorola reader `|N |`Attempt to read and extract tag data from the antenna`
|
|`lf motorola read `|N |`Attempt to read and extract tag data from the antenna`
|
||||||
|`lf motorola clone `|N |`clone MOTOROLA tag to T55x7`
|
|`lf motorola clone `|N |`clone MOTOROLA tag to T55x7`
|
||||||
|`lf motorola sim `|N |`simulate MOTOROLA tag`
|
|`lf motorola sim `|N |`simulate MOTOROLA tag`
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`lf nexwatch help `|Y |`This help`
|
|`lf nexwatch help `|Y |`This help`
|
||||||
|`lf nexwatch demod `|Y |`Demodulate a NexWatch tag (nexkey, quadrakey) from the GraphBuffer`
|
|`lf nexwatch demod `|Y |`Demodulate a NexWatch tag (nexkey, quadrakey) from the GraphBuffer`
|
||||||
|`lf nexwatch reader `|N |`Attempt to Read and Extract tag data from the antenna`
|
|`lf nexwatch read `|N |`Attempt to Read and Extract tag data from the antenna`
|
||||||
|`lf nexwatch clone `|N |`clone NexWatch tag to T55x7`
|
|`lf nexwatch clone `|N |`clone NexWatch tag to T55x7`
|
||||||
|`lf nexwatch sim `|N |`simulate NexWatch tag`
|
|`lf nexwatch sim `|N |`simulate NexWatch tag`
|
||||||
|
|
||||||
|
@ -785,7 +785,7 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`lf noralsy help `|Y |`This help`
|
|`lf noralsy help `|Y |`This help`
|
||||||
|`lf noralsy demod `|Y |`Demodulate an Noralsy tag from the GraphBuffer`
|
|`lf noralsy demod `|Y |`Demodulate an Noralsy tag from the GraphBuffer`
|
||||||
|`lf noralsy reader `|N |`Attempt to read and extract tag data from the antenna`
|
|`lf noralsy read `|N |`Attempt to read and extract tag data from the antenna`
|
||||||
|`lf noralsy clone `|N |`clone Noralsy tag to T55x7 or Q5/T5555`
|
|`lf noralsy clone `|N |`clone Noralsy tag to T55x7 or Q5/T5555`
|
||||||
|`lf noralsy sim `|N |`simulate Noralsy tag`
|
|`lf noralsy sim `|N |`simulate Noralsy tag`
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ Check column "offline" for their availability.
|
||||||
|------- |------- |-----------
|
|------- |------- |-----------
|
||||||
|`lf pac help `|Y |`This help`
|
|`lf pac help `|Y |`This help`
|
||||||
|`lf pac demod `|Y |`Demodulate a PAC tag from the GraphBuffer`
|
|`lf pac demod `|Y |`Demodulate a PAC tag from the GraphBuffer`
|
||||||
|`lf pac reader `|N |`Attempt to read and extract tag data from the antenna`
|
|`lf pac read `|N |`Attempt to read and extract tag data from the antenna`
|
||||||
|`lf pac clone `|N |`clone PAC tag to T55x7`
|
|`lf pac clone `|N |`clone PAC tag to T55x7`
|
||||||
|`lf pac sim `|N |`simulate PAC tag`
|
|`lf pac sim `|N |`simulate PAC tag`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue