mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
armsrc: clarify static vars vs global vars, part 2
This commit is contained in:
parent
4d355192bf
commit
b556810776
12 changed files with 45 additions and 45 deletions
|
@ -81,12 +81,12 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint8_t cjuid[10];
|
static uint8_t cjuid[10];
|
||||||
uint32_t cjcuid;
|
static uint32_t cjcuid;
|
||||||
iso14a_card_select_t p_card;
|
static iso14a_card_select_t p_card;
|
||||||
int currline;
|
static int currline;
|
||||||
int currfline;
|
static int currfline;
|
||||||
int curlline;
|
static int curlline;
|
||||||
|
|
||||||
// TODO : Implement fast read of KEYS like in RFIdea
|
// TODO : Implement fast read of KEYS like in RFIdea
|
||||||
// also http://ext.delaat.net/rp/2015-2016/p04/report.pdf
|
// also http://ext.delaat.net/rp/2015-2016/p04/report.pdf
|
||||||
|
@ -162,7 +162,7 @@ static void scan_keys(const char *str, int len, uint64_t *user_data) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MFC1KSchema Schemas[MAX_SCHEMAS];
|
static MFC1KSchema Schemas[MAX_SCHEMAS];
|
||||||
|
|
||||||
/*MFC1KSchema Noralsy = {
|
/*MFC1KSchema Noralsy = {
|
||||||
.name = "Noralsy",
|
.name = "Noralsy",
|
||||||
|
@ -196,7 +196,7 @@ MFC1KSchema InfiHexact = {.name = "Infineon/Hexact",
|
||||||
0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76}};
|
0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76, 0x8829da9daf76}};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int total_schemas = 0;
|
static int total_schemas = 0;
|
||||||
|
|
||||||
static void add_schema(MFC1KSchema *p, MFC1KSchema a, int *schemas_counter) {
|
static void add_schema(MFC1KSchema *p, MFC1KSchema a, int *schemas_counter) {
|
||||||
if (*schemas_counter < MAX_SCHEMAS) {
|
if (*schemas_counter < MAX_SCHEMAS) {
|
||||||
|
|
|
@ -49,19 +49,19 @@ on a blank card.
|
||||||
#include "mifaresim.h" // mifare1ksim
|
#include "mifaresim.h" // mifare1ksim
|
||||||
#include "mifareutil.h"
|
#include "mifareutil.h"
|
||||||
|
|
||||||
uint8_t uid[10];
|
static uint8_t uid[10];
|
||||||
uint32_t cuid;
|
static uint32_t cuid;
|
||||||
iso14a_card_select_t p_card;
|
static iso14a_card_select_t p_card;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Pseudo-configuration block.
|
Pseudo-configuration block.
|
||||||
*/
|
*/
|
||||||
bool printKeys = false; // Prints keys
|
static bool printKeys = false; // Prints keys
|
||||||
bool transferToEml = true; // Transfer keys to emulator memory
|
static bool transferToEml = true; // Transfer keys to emulator memory
|
||||||
bool ecfill = true; // Fill emulator memory with cards content.
|
static bool ecfill = true; // Fill emulator memory with cards content.
|
||||||
bool simulation = true; // Simulates an exact copy of the target tag
|
static bool simulation = true; // Simulates an exact copy of the target tag
|
||||||
bool fillFromEmulator = false; // Dump emulator memory.
|
static bool fillFromEmulator = false; // Dump emulator memory.
|
||||||
uint8_t stKeyBlock = 20; // Set the quantity of keys in the block.
|
static uint8_t stKeyBlock = 20; // Set the quantity of keys in the block.
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Matt's StandAlone mod.
|
// Matt's StandAlone mod.
|
||||||
|
|
|
@ -52,7 +52,7 @@ void ModInfo(void) {
|
||||||
* technologies. Be brave enough to share your knowledge & inspire others. Salvador Mendoza.
|
* technologies. Be brave enough to share your knowledge & inspire others. Salvador Mendoza.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint8_t ppdol [255] = {0x80, 0xA8, 0x00, 0x00, 0x02, 0x83, 0x00}; // Default GET PROCESSING
|
static uint8_t ppdol [255] = {0x80, 0xA8, 0x00, 0x00, 0x02, 0x83, 0x00}; // Default GET PROCESSING
|
||||||
|
|
||||||
static uint8_t treatPDOL(uint8_t *apdu) { //Generate GET PROCESSING
|
static uint8_t treatPDOL(uint8_t *apdu) { //Generate GET PROCESSING
|
||||||
uint8_t plen = 7;
|
uint8_t plen = 7;
|
||||||
|
|
|
@ -25,11 +25,9 @@
|
||||||
|
|
||||||
// low & high - array for storage IDs. Its length must be equal.
|
// low & high - array for storage IDs. Its length must be equal.
|
||||||
// Predefined IDs must be stored in low[].
|
// Predefined IDs must be stored in low[].
|
||||||
// In high[] must be nulls
|
static uint64_t low[] = {0x565A1140BE, 0x365A398149, 0x5555555555, 0xFFFFFFFFFF};
|
||||||
uint64_t low[] = {0x565A1140BE, 0x365A398149, 0x5555555555, 0xFFFFFFFFFF};
|
static uint8_t *bba, slots_count;
|
||||||
uint32_t high[] = {0, 0, 0, 0};
|
static int buflen;
|
||||||
uint8_t *bba, slots_count;
|
|
||||||
int buflen;
|
|
||||||
|
|
||||||
void ModInfo(void) {
|
void ModInfo(void) {
|
||||||
DbpString(" LF EM4100 simulator standalone mode");
|
DbpString(" LF EM4100 simulator standalone mode");
|
||||||
|
|
|
@ -68,16 +68,16 @@
|
||||||
|
|
||||||
// Predefined bruteforce speed
|
// Predefined bruteforce speed
|
||||||
// avg: 1s, 1.2s, 1.5s, 2s
|
// avg: 1s, 1.2s, 1.5s, 2s
|
||||||
int bruteforceSpeedCurrent = 1;
|
static int bruteforceSpeedCurrent = 1;
|
||||||
int bruteforceSpeed[] = {10, 12, 14, 16};
|
static int bruteforceSpeed[] = {10, 12, 14, 16};
|
||||||
|
|
||||||
// low & high - array for storage IDs. Its length must be equal.
|
// low & high - array for storage IDs. Its length must be equal.
|
||||||
// Predefined IDs must be stored in low[].
|
// Predefined IDs must be stored in low[].
|
||||||
// In high[] must be nulls
|
// In high[] must be nulls
|
||||||
uint64_t low[] = {0, 0, 0, 0};
|
static uint64_t low[] = {0, 0, 0, 0};
|
||||||
uint32_t high[] = {0, 0, 0, 0};
|
static uint32_t high[] = {0, 0, 0, 0};
|
||||||
uint8_t *bba;
|
static uint8_t *bba;
|
||||||
int buflen;
|
static int buflen;
|
||||||
|
|
||||||
void ModInfo(void) {
|
void ModInfo(void) {
|
||||||
DbpString(" LF EM4100 read/sim/write/brute mode");
|
DbpString(" LF EM4100 read/sim/write/brute mode");
|
||||||
|
|
|
@ -39,10 +39,10 @@
|
||||||
// low & high - array for storage IDs. Its length must be equal.
|
// low & high - array for storage IDs. Its length must be equal.
|
||||||
// Predefined IDs must be stored in low[].
|
// Predefined IDs must be stored in low[].
|
||||||
// In high[] must be nulls
|
// In high[] must be nulls
|
||||||
uint64_t low[] = {0x565AF781C7, 0x540053E4E2, 0x1234567890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
static uint64_t low[] = {0x565AF781C7, 0x540053E4E2, 0x1234567890, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
uint32_t high[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
static uint32_t high[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
uint8_t *bba, slots_count;
|
static uint8_t *bba, slots_count;
|
||||||
int buflen;
|
static int buflen;
|
||||||
|
|
||||||
void ModInfo(void) {
|
void ModInfo(void) {
|
||||||
DbpString(" LF EM4100 read/write/clone mode");
|
DbpString(" LF EM4100 read/write/clone mode");
|
||||||
|
|
|
@ -70,9 +70,11 @@
|
||||||
#define TOSEND_BUFFER_SIZE (9*MAX_FRAME_SIZE + 1 + 1 + 2) // 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits
|
#define TOSEND_BUFFER_SIZE (9*MAX_FRAME_SIZE + 1 + 1 + 2) // 8 data bits and 1 parity bit per payload byte, 1 correction bit, 1 SOC bit, 2 EOC bits
|
||||||
uint8_t ToSend[TOSEND_BUFFER_SIZE];
|
uint8_t ToSend[TOSEND_BUFFER_SIZE];
|
||||||
int ToSendMax = -1;
|
int ToSendMax = -1;
|
||||||
|
|
||||||
|
|
||||||
static int ToSendBit;
|
static int ToSendBit;
|
||||||
struct common_area common_area __attribute__((section(".commonarea")));
|
struct common_area common_area __attribute__((section(".commonarea")));
|
||||||
int button_status = BUTTON_NO_CLICK;
|
static int button_status = BUTTON_NO_CLICK;
|
||||||
static bool allow_send_wtx = false;
|
static bool allow_send_wtx = false;
|
||||||
|
|
||||||
inline void send_wtx(uint16_t wtx) {
|
inline void send_wtx(uint16_t wtx) {
|
||||||
|
|
|
@ -67,7 +67,7 @@ static uint8_t iso14_pcb_blocknum = 0;
|
||||||
#define DELAY_ARM2AIR_AS_READER (4*16 + 8*16 + 8 + 8 + 1)
|
#define DELAY_ARM2AIR_AS_READER (4*16 + 8*16 + 8 + 8 + 1)
|
||||||
|
|
||||||
// The FPGA will report its internal sending delay in
|
// The FPGA will report its internal sending delay in
|
||||||
uint16_t FpgaSendQueueDelay;
|
static uint16_t FpgaSendQueueDelay;
|
||||||
// the 5 first bits are the number of bits buffered in mod_sig_buf
|
// the 5 first bits are the number of bits buffered in mod_sig_buf
|
||||||
// the last three bits are the remaining ticks/2 after the mod_sig_buf shift
|
// the last three bits are the remaining ticks/2 after the mod_sig_buf shift
|
||||||
#define DELAY_FPGA_QUEUE (FpgaSendQueueDelay<<1)
|
#define DELAY_FPGA_QUEUE (FpgaSendQueueDelay<<1)
|
||||||
|
|
|
@ -51,8 +51,8 @@ bool lf_test_periods(size_t expected, size_t count) {
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
// Low frequency (LF) adc passthrough functionality
|
// Low frequency (LF) adc passthrough functionality
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
uint8_t previous_adc_val = 0;
|
static uint8_t previous_adc_val = 0;
|
||||||
uint8_t adc_avg = 0;
|
static uint8_t adc_avg = 0;
|
||||||
|
|
||||||
void lf_sample_mean(void) {
|
void lf_sample_mean(void) {
|
||||||
uint8_t periods = 0;
|
uint8_t periods = 0;
|
||||||
|
|
|
@ -2289,10 +2289,10 @@ void WriteEM410x(uint32_t card, uint32_t id_hi, uint32_t id_lo) {
|
||||||
#define FWD_CMD_READ 0x9
|
#define FWD_CMD_READ 0x9
|
||||||
#define FWD_CMD_DISABLE 0x5
|
#define FWD_CMD_DISABLE 0x5
|
||||||
|
|
||||||
uint8_t forwardLink_data[64]; //array of forwarded bits
|
static uint8_t forwardLink_data[64]; //array of forwarded bits
|
||||||
uint8_t *forward_ptr; //ptr for forward message preparation
|
static uint8_t *forward_ptr; //ptr for forward message preparation
|
||||||
uint8_t fwd_bit_sz; //forwardlink bit counter
|
static uint8_t fwd_bit_sz; //forwardlink bit counter
|
||||||
uint8_t *fwd_write_ptr; //forwardlink bit pointer
|
static uint8_t *fwd_write_ptr; //forwardlink bit pointer
|
||||||
|
|
||||||
//====================================================================
|
//====================================================================
|
||||||
// prepares command bits
|
// prepares command bits
|
||||||
|
|
|
@ -2008,9 +2008,9 @@ out:
|
||||||
// bit 6 - wipe tag.
|
// bit 6 - wipe tag.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// magic uid card generation 1 commands
|
// magic uid card generation 1 commands
|
||||||
uint8_t wupC1[] = { MIFARE_MAGICWUPC1 };
|
static uint8_t wupC1[] = { MIFARE_MAGICWUPC1 };
|
||||||
uint8_t wupC2[] = { MIFARE_MAGICWUPC2 };
|
static uint8_t wupC2[] = { MIFARE_MAGICWUPC2 };
|
||||||
uint8_t wipeC[] = { MIFARE_MAGICWIPEC };
|
static uint8_t wipeC[] = { MIFARE_MAGICWIPEC };
|
||||||
|
|
||||||
void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
|
void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain) {
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ void ReadThinFilm(void) {
|
||||||
#define SEC_D 0xf0
|
#define SEC_D 0xf0
|
||||||
#define SEC_E 0x0f
|
#define SEC_E 0x0f
|
||||||
#define SEC_F 0x00
|
#define SEC_F 0x00
|
||||||
uint16_t FpgaSendQueueDelay;
|
static uint16_t FpgaSendQueueDelay;
|
||||||
|
|
||||||
static uint16_t ReadReaderField(void) {
|
static uint16_t ReadReaderField(void) {
|
||||||
#if defined RDV4
|
#if defined RDV4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue