This commit is contained in:
Philippe Teuwen 2021-10-10 01:35:38 +02:00
commit 88308ea727
98 changed files with 271 additions and 271 deletions

View file

@ -49,7 +49,7 @@ static tosend_t toSend = {
};
//=============================================================================
// The dmaBuf 16bit buffer.
// A buffer where we recive IQ samples sent from the FPGA, for demodulating
// A buffer where we receive IQ samples sent from the FPGA, for demodulating
//=============================================================================
static dmabuf16_t dma_16 = {
.size = DMA_BUFFER_SIZE,

View file

@ -225,7 +225,7 @@ static void RAMFUNC SniffAndStore(uint8_t param) {
}
if (g_dbglevel > 1)
Dbprintf("[!] Wrote %u Authentification attempts into logfile", auth_attempts);
Dbprintf("[!] Wrote %u Authentication attempts into logfile", auth_attempts);
SpinErr(LED_A, 200, 5);
SpinDelay(100);

View file

@ -310,7 +310,7 @@ void WriteTagToFlash(uint32_t uid, size_t size) {
num_to_bytes(uid, 4, buid);
sprintf(dest, "hf_colin/mf_%02x%02x%02x%02x.bin", buid[0], buid[1], buid[2], buid[3]);
// TODO : by using safe function for multiple writes we are both breaking cache mecanisms and making useless and
// TODO : by using safe function for multiple writes we are both breaking cache mechanisms and making useless and
// unoptimized mount operations we should manage at out level the mount status before and after the whole
// standalone mode
rdv40_spiffs_write((char *)dest, (uint8_t *)data, len, RDV40_SPIFFS_SAFETY_SAFE);

View file

@ -11,7 +11,7 @@
// Created for the live streamed talk 'DEFCON 28 Wireless Village-Omikron and Iceman - Ghosting the PACS-man: New Tools and Techniques'
// https://www.youtube.com/watch?v=ghiHXK4GEzE
//
// I created a youtube video demostrating the HF_ICECLASS standalone mode
// I created a youtube video demonstrating the HF_ICECLASS standalone mode
// https://youtu.be/w_1GnAscNIU
//
//
@ -43,7 +43,7 @@
// ====================================================
// Select which standalone function to be active.
// 5 possiblities. Uncomment the one you wanna use.
// 5 possibilities. Uncomment the one you wanna use.
#define ICE_USE ICE_STATE_FULLSIM
//#define ICE_USE ICE_STATE_ATTACK

View file

@ -124,7 +124,7 @@ void RunMod(void) {
DbpString("[=] looking for tags");
int read_success = PM3_ESOFT;
//search for legic card until reading successfull or button pressed
//search for legic card until reading successful or button pressed
do {
LED_C_ON();
SpinDelay(500);

View file

@ -33,7 +33,7 @@ void ModInfo(void) {
*
* Instructions:
*
* I recommend setting up & run the other end before start sending or receving data in this Proxmark3
* I recommend setting up & run the other end before start sending or receiving data in this Proxmark3
* standalone.
*
* For the reading mode:

View file

@ -8,8 +8,8 @@
//-----------------------------------------------------------------------------
// LF rswb - This mode can simulate ID from selected slot, read ID to
// selected slot, write from selected slot to T5555/T55x7 tag and store
// readed ID to flash (only RDV4).
// Predefined its is not recomended because you can incedently rewrite your MANDATORY tag data.
// read ID to flash (only RDV4).
// Predefining it is not recommended because you can incidentally rewrite your MANDATORY tag data.
//
// To recall stored ID from flash execute:
// mem spifss dump o emdump p
@ -23,12 +23,12 @@
// 0 - READ Read source card ID and store it to current slot
// Will switch to SIM mode automatically.
//
// 1 - SIM Simulate readed ID
// 1 - SIM Simulate read ID
//
// 2 - WRITE(CLONE) Write readed ID to T55x7 card
// !!! Warning, card id WILL BE OVERRWRITED
// 2 - WRITE(CLONE) Write read ID to T55x7 card
// !!! Warning, card id WILL BE OVERWRITTEN
//
// 3 - BRUTE Brute upper or down from readed card)
// 3 - BRUTE Brute upper or down from read card)
// You can PRESS SINGLE to exit brute mode OR
// PRESS DOUBLE to save bruted ID to current slot (will automatically switch to SIM mode) AND
// Also You can HOLD button to change brute speeds.

View file

@ -2011,7 +2011,7 @@ static void PacketReceived(PacketCommandNG *packet) {
reply_ng(CMD_LF_UPLOAD_SIM_SAMPLES, PM3_EOVFLOW, NULL, 0);
break;
}
// ensure len bytes copied wont go past end of bigbuf
// ensure len bytes copied won't go past end of bigbuf
uint16_t len = MIN(BigBuf_get_size() - payload->offset, sizeof(payload->data));
uint8_t *mem = BigBuf_get_addr();
@ -2250,9 +2250,9 @@ static void PacketReceived(PacketCommandNG *packet) {
case CMD_FLASHMEM_WIPE: {
LED_B_ON();
uint8_t page = packet->oldarg[0];
uint8_t initalwipe = packet->oldarg[1];
uint8_t initialwipe = packet->oldarg[1];
bool isok = false;
if (initalwipe) {
if (initialwipe) {
isok = Flash_WipeMemory();
reply_mix(CMD_ACK, isok, 0, 0, 0, 0);
LED_B_OFF();

View file

@ -443,7 +443,7 @@ static int find_double_listen_window(bool bcommand) {
return PM3_EFAILED;
}
// function is used to check wether a tag on the proxmark is an
// function is used to check whether a tag on the proxmark is an
// EM4x50 tag or not -> speed up "lf search" process
static bool find_em4x50_tag(void) {
return find_single_listen_window();
@ -458,7 +458,7 @@ static int request_receive_mode(void) {
// returns true if signal structue corresponds to ACK, anything else is
// counted as NAK (-> false)
// Only relevant for pasword writing function:
// Only relevant for password writing function:
// If <bliw> is true then within the single listen window right after the
// ack signal a RM request has to be sent.
static bool check_ack(bool bliw) {
@ -1796,7 +1796,7 @@ void em4x50_sim(uint32_t *password) {
g_Login = false;
g_WritePasswordProcess = false;
// start with inital command = standard read mode
// start with initial command = standard read mode
command = EM4X50_COMMAND_STANDARD_READ;
for (;;) {

View file

@ -59,7 +59,7 @@ static bool command_parity = true;
#define EM4X70_COMMAND_WRITE 0x05
#define EM4X70_COMMAND_UM2 0x07
// Constants used to determing high/low state of signal
// Constants used to determine high/low state of signal
#define EM4X70_NOISE_THRESHOLD 13 // May depend on noise in environment
#define HIGH_SIGNAL_THRESHOLD (127 + EM4X70_NOISE_THRESHOLD)
#define LOW_SIGNAL_THRESHOLD (127 - EM4X70_NOISE_THRESHOLD)
@ -539,7 +539,7 @@ static bool em4x70_read_um2(void) {
}
static bool find_em4x70_tag(void) {
// function is used to check wether a tag on the proxmark is an
// function is used to check whether a tag on the proxmark is an
// EM4170 tag or not -> speed up "lf search" process
return find_listen_window(false);
}

View file

@ -5,7 +5,7 @@
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to support the German eletronic "Personalausweis" (ID card)
// Routines to support the German electronic "Personalausweis" (ID card)
//-----------------------------------------------------------------------------
#ifndef __EPA_H

View file

@ -172,7 +172,7 @@ uint16_t FlashSendByte(uint32_t data) {
//while ((AT91C_BASE_SPI->SPI_SR & AT91C_SPI_TDRE) == 0){};
// wait recive transfer is complete
// wait receive transfer is complete
while ((AT91C_BASE_SPI->SPI_SR & AT91C_SPI_RDRF) == 0) {};
// reading incoming data
@ -285,7 +285,7 @@ void Flash_TransferAdresse(uint32_t address) {
FlashSendByte((address >> 0) & 0xFF);
}
/* This ensure we can ReadData without having to cycle through initialization everytime */
/* This ensures we can ReadData without having to cycle through initialization every time */
uint16_t Flash_ReadDataCont(uint32_t address, uint8_t *out, uint16_t len) {
// length should never be zero

View file

@ -530,7 +530,7 @@ void FpgaSendCommand(uint16_t cmd, uint16_t v) {
//-----------------------------------------------------------------------------
// Write the FPGA setup word (that determines what mode the logic is in, read
// vs. clone vs. etc.). This is now a special case of FpgaSendCommand() to
// avoid changing this function's occurence everywhere in the source code.
// avoid changing this function's occurrence everywhere in the source code.
//-----------------------------------------------------------------------------
void FpgaWriteConfWord(uint16_t v) {
FpgaSendCommand(FPGA_CMD_SET_CONFREG, v);

View file

@ -75,7 +75,7 @@ int HfSniff(uint32_t samplesToSkip, uint32_t triggersToSkip, uint16_t *len) {
r = MAX(r & 0xFF, r >> 8);
// 180 (0xB4) arbitary value to see if a strong RF field is near.
// 180 (0xB4) arbitrary value to see if a strong RF field is near.
if (r > 180) {
if (++trigger_cnt > triggersToSkip) {

View file

@ -1141,7 +1141,7 @@ void SniffHitag2(void) {
// Disable timer during configuration
AT91C_BASE_TC1->TC_CCR = AT91C_TC_CLKDIS;
// Capture mode, defaul timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// Capture mode, default timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// external trigger rising edge, load RA on rising edge of TIOA.
AT91C_BASE_TC1->TC_CMR = AT91C_TC_CLKS_TIMER_DIV1_CLOCK | AT91C_TC_ETRGEDG_BOTH | AT91C_TC_ABETRG | AT91C_TC_LDRA_BOTH;
@ -1225,7 +1225,7 @@ void SniffHitag2(void) {
//DbpString("wierd1?");
// }
// Capture the T0 periods that have passed since last communication or field drop (reset)
// We always recieve a 'one' first, which has the falling edge after a half period |-_|
// We always receive a 'one' first, which has the falling edge after a half period |-_|
response = ra - HITAG_T_TAG_HALF_PERIOD;
} else if (ra >= HITAG_T_TAG_CAPTURE_FOUR_HALF) {

View file

@ -727,7 +727,7 @@ bool hitag2crack_consume_keystream(uint8_t *keybits, int kslen, int *ksoffset, u
return false;
}
// dont bother decrypting the response - we already know the keybits
// don't bother decrypting the response - we already know the keybits
// update ksoffset with command length and response
*ksoffset += (numcmds * 10) + 32;

View file

@ -603,7 +603,7 @@ static void hitagS_handle_reader_command(uint8_t *rx, const size_t rxlen,
}
/*
* to autenticate to a tag with the given key or challenge
* to authenticate to a tag with the given key or challenge
*/
static int hitagS_handle_tag_auth(hitag_function htf, uint64_t key, uint64_t NrAr, uint8_t *rx, const size_t rxlen, uint8_t *tx, size_t *txlen) {
uint8_t rx_air[HITAG_FRAME_LEN];
@ -1015,7 +1015,7 @@ void SimulateHitagSTag(bool tag_mem_supplied, uint8_t *data) {
// Capture reader frame
if (ra >= HITAG_T_STOP) {
if (rxlen != 0) {
//DbpString("wierd0?");
//DbpString("weird0?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
response = (ra - HITAG_T_LOW);
@ -1110,10 +1110,10 @@ static void hitagS_receive_frame(uint8_t *rx, size_t *rxlen, int *response) {
// Capture tag frame (manchester decoding using only falling edges)
if (ra >= HITAG_T_EOF) {
if (*rxlen != 0) {
//DbpString("wierd1?");
//DbpString("weird1?");
}
// Capture the T0 periods that have passed since last communication or field drop (reset)
// We always recieve a 'one' first, which has the falling edge after a half period |-_|
// We always receive a 'one' first, which has the falling edge after a half period |-_|
*response = ra - HITAG_T_TAG_HALF_PERIOD;
} else if (ra >= HITAG_T_TAG_CAPTURE_FOUR_HALF) {
// Manchester coding example |-_|_-|-_| (101)
@ -1143,12 +1143,12 @@ static void hitagS_receive_frame(uint8_t *rx, size_t *rxlen, int *response) {
(*rxlen)++;
}
} else {
// Ignore wierd value, is to small to mean anything
// Ignore weird value, is to small to mean anything
errorCount++;
}
}
// if we saw over 100 wierd values break it probably isn't hitag...
// if we saw over 100 weird values break it probably isn't hitag...
if (errorCount > 100) break;
// We can break this loop if we received the last bit from a frame
@ -1255,7 +1255,7 @@ void ReadHitagS(hitag_function htf, hitag_data *htd) {
// TC0: Capture mode, default timer source = MCK/2 (TIMER_CLOCK1), no triggers
AT91C_BASE_TC0->TC_CMR = AT91C_TC_CLKS_TIMER_DIV1_CLOCK;
// TC1: Capture mode, defaul timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// TC1: Capture mode, default timer source = MCK/2 (TIMER_CLOCK1), TIOA is external trigger,
// external trigger rising edge, load RA on falling edge of TIOA.
AT91C_BASE_TC1->TC_CMR =
AT91C_TC_CLKS_TIMER_DIV1_CLOCK |
@ -1320,13 +1320,13 @@ void ReadHitagS(hitag_function htf, hitag_data *htd) {
}
}
k = 0;
for (i = 4; i < 36; i++) { // ignore first 4 bits: SOF (actualy 1 or 6 depending on response protocol)
for (i = 4; i < 36; i++) { // ignore first 4 bits: SOF (actually 1 or 6 depending on response protocol)
pageData[k] = response_bit[i];
k++;
}
for (i = 0; i < 4; i++) // set page bytes to 0
tag.pages[pageNum][i] = 0x0;
for (i = 0; i < 4; i++) { // set page bytes from recieved bits
for (i = 0; i < 4; i++) { // set page bytes from received bits
tag.pages[pageNum][i] += ((pageData[i * 8] << 7)
| (pageData[1 + (i * 8)] << 6)
| (pageData[2 + (i * 8)] << 5)
@ -1554,7 +1554,7 @@ void WritePageHitagS(hitag_function htf, hitag_data *htd, int page) {
Dbprintf("no write access on page %d", page);
bStop = !false;
} else if (rxlen == 0 && tag.tstate != HT_WRITING_PAGE_DATA) {
//start the authetication
//start the authentication
txlen = 5;
memcpy(tx, "\xc0", nbytes(txlen));
tag.pstate = HT_READY;
@ -1581,7 +1581,7 @@ void WritePageHitagS(hitag_function htf, hitag_data *htd, int page) {
tx[2] = 0x00 + (crc % 16) * 16;
} else if (tag.pstate == HT_SELECTED && tag.tstate == HT_WRITING_PAGE_ACK
&& rxlen == 6 && rx[0] == 0xf4) {
//ACK recieved to write the page. send data
//ACK received to write the page. send data
tag.tstate = HT_WRITING_PAGE_DATA;
txlen = 40;
crc = CRC_PRESET;

View file

@ -1246,7 +1246,7 @@ static void iclass_send_as_reader(uint8_t *frame, int len, uint32_t *start_time,
CodeIso15693AsReader(frame, len);
tosend_t *ts = get_tosend();
TransmitTo15693Tag(ts->buf, ts->max, start_time);
*end_time = *start_time + (32 * ((8 * ts->max) - 4)); // substract the 4 padding bits after EOF
*end_time = *start_time + (32 * ((8 * ts->max) - 4)); // subtract the 4 padding bits after EOF
LogTrace_ISO15693(frame, len, (*start_time * 4), (*end_time * 4), NULL, true);
}

View file

@ -2326,7 +2326,7 @@ int ReaderReceive(uint8_t *receivedAnswer, uint8_t *par) {
// This function misstreats the ISO 14443a anticollision procedure.
// by fooling the reader there is a collision and forceing the reader to
// increase the uid bytes. The might be an overflow, DoS will occure.
// increase the uid bytes. The might be an overflow, DoS will occur.
void iso14443a_antifuzz(uint32_t flags) {
// We need to listen to the high-frequency, peak-detected path.
@ -3136,7 +3136,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
received_nack = true;
else if (resp_res == 4) {
// did we get lucky and got our dummykey to be valid?
// however we dont feed key w uid it the prng..
// however we don't feed key w uid it the prng..
isOK = -6;
break;
}
@ -3520,7 +3520,7 @@ void DetectNACKbug(void) {
consecutive_resyncs = 0;
} // end for loop
// num_nacks = number of nacks recieved. should be only 1. if not its a clone card which always sends NACK (parity == 0) ?
// num_nacks = number of nacks received. should be only 1. if not its a clone card which always sends NACK (parity == 0) ?
// i = number of authentications sent. Not always 256, since we are trying to sync but close to it.
FpgaDisableTracing();

View file

@ -194,7 +194,7 @@ static uint32_t iso14b_timeout = FWT_TIMEOUT_14B;
*
* Elementary Time Unit (ETU)
* --------------------------
* ETU is used to denotate 1 bit period i.e. how long one bit transfer takes.
* ETU is used to denote 1 bit period i.e. how long one bit transfer takes.
*
* - 128 Carrier cycles / 13.56MHz = 8 Subcarrier units / 848kHz = 1/106kHz = 9.4395 µS
* - 16 Carrier cycles = 1 Subcarrier unit = 1.17 µS
@ -203,7 +203,7 @@ static uint32_t iso14b_timeout = FWT_TIMEOUT_14B;
* ----------
* 1 ETU = 128 / ( D x fc )
* where
* D = divisor. Which inital is 1
* D = divisor. Which initial is 1
* fc = carrier frequency
* gives
* 1 ETU = 128 / fc
@ -267,7 +267,7 @@ static uint32_t iso14b_timeout = FWT_TIMEOUT_14B;
* --------------------------
* The mode FPGA_MAJOR_MODE_HF_SIMULATOR | FPGA_HF_SIMULATOR_MODULATE_BPSK which we use to simulate tag
* works like this:
* Simulation per definition is "inversed" effect on the reader antenna.
* Simulation per definition is "inverted" effect on the reader antenna.
* - A 1-bit input to the FPGA becomes 8 pulses at 847.5kHz (1.18µS / pulse) == 9.44us
* - A 0-bit input to the FPGA becomes an unmodulated time of 1.18µS or does it become 8 nonpulses for 9.44us
*

View file

@ -1454,7 +1454,7 @@ void Iso15693InitReader(void) {
///////////////////////////////////////////////////////////////////////
// ISO 15693 Part 3 - Air Interface
// This section basicly contains transmission and receiving of bits
// This section basically contains transmission and receiving of bits
///////////////////////////////////////////////////////////////////////
// Encode an identify request, which is the first
@ -1504,7 +1504,7 @@ int SendDataTag(uint8_t *send, int sendlen, bool init, bool speed_fast, uint8_t
} else {
*eof_time = start_time + 32 * ((8 * ts->max) - 4); // substract the 4 padding bits after EOF
*eof_time = start_time + 32 * ((8 * ts->max) - 4); // subtract the 4 padding bits after EOF
LogTrace_ISO15693(send, sendlen, (start_time * 4), (*eof_time * 4), NULL, true);
if (recv != NULL) {
res = GetIso15693AnswerFromTag(recv, max_recv_len, timeout, eof_time);
@ -1518,7 +1518,7 @@ int SendDataTagEOF(uint8_t *recv, uint16_t max_recv_len, uint32_t start_time, ui
CodeIso15693AsReaderEOF();
tosend_t *ts = get_tosend();
TransmitTo15693Tag(ts->buf, ts->max, &start_time);
uint32_t end_time = start_time + 32 * (8 * ts->max - 4); // substract the 4 padding bits after EOF
uint32_t end_time = start_time + 32 * (8 * ts->max - 4); // subtract the 4 padding bits after EOF
LogTrace_ISO15693(NULL, 0, (start_time * 4), (end_time * 4), NULL, true);
int res = 0;
@ -1858,7 +1858,7 @@ void BruteforceIso15693Afi(uint32_t speed) {
Iso15693InitReader();
// first without AFI
// Tags should respond wihtout AFI and with AFI=0 even when AFI is active
// Tags should respond without AFI and with AFI=0 even when AFI is active
data[0] = ISO15_REQ_SUBCARRIER_SINGLE | ISO15_REQ_DATARATE_HIGH | ISO15_REQ_INVENTORY | ISO15_REQINV_SLOT1;
data[1] = ISO15693_INVENTORY;

View file

@ -38,10 +38,10 @@ static crc_t legic_crc;
// - 100us for a 1 (RWD_TIME_1)
//
// The data dependent timing makes writing comprehensible code significantly
// harder. The current aproach forwards the prng data based if there is data on
// harder. The current approach forwards the prng data based if there is data on
// air and time based, using GET_TICKS, during computational and wait periodes.
//
// To not have the necessity to calculate/guess exection time dependend timeouts
// To not have the necessity to calculate/guess execution time dependend timeouts
// tx_frame and rx_frame use a shared timestamp to coordinate tx and rx timeslots.
//-----------------------------------------------------------------------------
@ -79,10 +79,10 @@ static uint16_t rx_frame_from_fpga(void) {
// Demodulation (Reader)
//-----------------------------------------------------------------------------
// Returns a demedulated bit
// Returns a demodulated bit
//
// The FPGA running xcorrelation samples the subcarrier at ~13.56 MHz. The mode
// was initialy designed to receive BSPK/2-PSK. Hance, it reports an I/Q pair
// was initially designed to receive BSPK/2-PSK. Hance, it reports an I/Q pair
// every 4.7us (8 bits i and 8 bits q).
//
// The subcarrier amplitude can be calculated using Pythagoras sqrt(i^2 + q^2).
@ -93,7 +93,7 @@ static uint16_t rx_frame_from_fpga(void) {
// and averages the next (most stable) 8 samples. The final 8 samples are dropped
// also.
//
// The demodulated should be alligned to the bit period by the caller. This is
// The demodulated should be aligned to the bit period by the caller. This is
// done in rx_bit and rx_ack.
//
// Note: The demodulator would be drifting (18.9us * 5 != 100us), rx_frame

View file

@ -36,11 +36,11 @@ static crc_t legic_crc;
// - 99.1us for a 1 (RWD_TIME_1)
//
// The data dependent timing makes writing comprehensible code significantly
// harder. The current aproach forwards the prng data based if there is data on
// harder. The current approach forwards the prng data based if there is data on
// air and time based, using GetCountSspClk(), during computational and wait
// periodes. SSP Clock is clocked by the FPGA at 212 kHz (subcarrier frequency).
//
// To not have the necessity to calculate/guess exection time dependend timeouts
// To not have the necessity to calculate/guess execution time dependent timeouts
// tx_frame and rx_frame use a shared timestamp to coordinate tx and rx timeslots.
//-----------------------------------------------------------------------------
@ -76,7 +76,7 @@ static bool wait_for(bool value, const uint32_t timeout) {
return true;
}
// Returns a demedulated bit or -1 on code violation
// Returns a demodulated bit or -1 on code violation
//
// rx_bit decodes bits using a thresholds. rx_bit has to be called by as soon as
// a frame starts (first pause is received). rx_bit checks for a pause up to
@ -118,8 +118,8 @@ static int8_t rx_bit(void) {
// - Subcarrier on for a 1
// - Subcarrier off for for a 0
//
// The 212kHz subcarrier is generated by the FPGA as well as a mathcing ssp clk.
// Each bit is transfered in a 99.1us slot and the first timeslot starts 330us
// The 212kHz subcarrier is generated by the FPGA as well as a matching ssp clk.
// Each bit is transferred in a 99.1us slot and the first timeslot starts 330us
// after the final 20us pause generated by the reader.
//-----------------------------------------------------------------------------
@ -201,7 +201,7 @@ static void tx_ack(void) {
LogTrace(cmdbytes, sizeof(cmdbytes), last_frame_start, last_frame_end, NULL, false);
}
// Returns a demedulated frame or -1 on code violation
// Returns a demodulated frame or -1 on code violation
//
// Since TX to RX delay is arbitrary rx_frame has to:
// - detect start of frame (first pause)
@ -212,7 +212,7 @@ static int32_t rx_frame(uint8_t *len) {
int32_t frame = 0;
// add 2 SSP clock cycles (1 for tx and 1 for rx pipeline delay)
// those will be substracted at the end of the rx phase
// those will be subtracted at the end of the rx phase
last_frame_end -= 2;
// wait for first pause (start of frame)
@ -259,7 +259,7 @@ static int32_t rx_frame(uint8_t *len) {
}
// rx_bit sets coordination timestamp to start of pause, append pause duration
// and substract 2 SSP clock cycles (1 for rx and 1 for tx pipeline delay) to
// and subtract 2 SSP clock cycles (1 for rx and 1 for tx pipeline delay) to
// obtain exact end of frame.
last_frame_end += RWD_TIME_PAUSE - 2;
@ -495,7 +495,7 @@ void LegicRfSimulate(uint8_t tagtype, bool send_reply) {
continue;
}
// conection is established, process commands until one fails
// connection is established, process commands until one fails
while (connected_phase(&card) == false) {
WDT_HIT();
}

View file

@ -113,7 +113,7 @@ static size_t lf_count_edge_periods_ex(size_t max, bool wait, bool detect_gap) {
if (wait == false) {
// Test if we are locating a field modulation (100% ASK = complete field drop)
if (detect_gap) {
// Only return when the field completely dissapeared
// Only return when the field completely disappeared
if (adc_val == 0) {
return periods;
}

View file

@ -52,7 +52,7 @@ Short note about timers on Proxmark device ARM. They are a bit differently impl
SAM7S has several timers, we will use the source TIMER_CLOCK1 (aka AT91C_TC_CLKS_TIMER_DIV1_CLOCK)
TIMER_CLOCK1 = MCK/2, MCK is running at 48 MHz, Timer is running at 48/2 = 24 MHz
New timer implemenation in ticks.c, which is used in LFOPS.c
New timer implementation in ticks.c, which is used in LFOPS.c
1 μs = 1.5 ticks
1 fc = 8 μs = 12 ticks
@ -135,7 +135,7 @@ Initial values if not in flash
WG = Write gap
RG = Read gap
Explainations for array T55xx_Timing below
Explanations for array T55xx_Timing below
0 1 2 3
SG WG Bit 00 Bit 01 Bit 10 Bit 11 RG
@ -1680,7 +1680,7 @@ static void T55xxWriteBit(uint8_t bit, uint8_t downlink_idx) {
// Function to abstract an Arbitrary length byte array to store bit pattern.
// bit_array - Array to hold data/bit pattern
// start_offset - bit location to start storing new bits.
// data - upto 32 bits of data to store
// data - up to 32 bits of data to store
// num_bits - how many bits (low x bits of data) Max 32 bits at a time
// max_len - how many bytes can the bit_array hold (ensure no buffer overflow)
// returns "Next" bit offset / bits stored (for next store)
@ -1927,7 +1927,7 @@ void T55xxWriteBlock(uint8_t *data) {
// as the tag should repeat back the new block
// until it is reset, but to confirm it we would
// need to know the current block 0 config mode for
// modulation clock an other details to demod the response...
// modulation clock another details to demod the response...
// response should be (for t55x7) a 0 bit then (ST if on)
// block data written in on repeat until reset.
@ -2446,7 +2446,7 @@ static uint8_t Prepare_Cmd(uint8_t cmd) {
cmd >>= 1;
*forward_ptr++ = cmd;
return 6; //return number of emited bits
return 6; //return number of emitted bits
}
//====================================================================
@ -2467,7 +2467,7 @@ static uint8_t Prepare_Addr(uint8_t addr) {
*forward_ptr++ = (line_parity & 1);
return 7; //return number of emited bits
return 7; //return number of emitted bits
}
//====================================================================
@ -2502,7 +2502,7 @@ static uint8_t Prepare_Data(uint16_t data_low, uint16_t data_hi) {
}
*forward_ptr = 0;
return 45; //return number of emited bits
return 45; //return number of emitted bits
}
//====================================================================

View file

@ -1413,7 +1413,7 @@ void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *da
if (keyCount == 0)
goto OUT;
// limit size of availlable for keys in bigbuff
// limit size of available for keys in bigbuff
// a key is 6bytes
uint16_t key_mem_available = MIN(BigBuf_get_size(), keyCount * 6);

View file

@ -544,7 +544,7 @@ void MifareDES_Auth1(uint8_t *datain) {
memcpy(cmd+19,buff3,8);
// The command always times out on the first attempt, this will retry until a response
// is recieved.
// is received.
len = 0;
while(!len) {
len = DesfireAPDU(cmd,27,resp);
@ -587,7 +587,7 @@ void MifareDES_Auth1(uint8_t *datain) {
memcpy(cmd+19,buff3,8);
// The command always times out on the first attempt, this will retry until a response
// is recieved.
// is received.
len = 0;
while(!len) {
len = DesfireAPDU(cmd,27,resp);

View file

@ -897,7 +897,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
response[14], response[15]);
}
// Access permission managment:
// Access permission management:
//
// Sector Trailer:
// - KEY A access
@ -907,7 +907,7 @@ void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint1
// Data block:
// - Data access
// If permission is not allowed, data is cleared (00) in emulator memeory.
// If permission is not allowed, data is cleared (00) in emulator memory.
// ex: a0a1a2a3a4a561e789c1b0b1b2b3b4b5 => 00000000000061e789c1b0b1b2b3b4b5

View file

@ -291,7 +291,7 @@ static void copy_in_spiffs(const char *src, const char *dst) {
////// Abstract Operations for base Safetyness /////////////////////////////////
//
// mount if not already
// As an "hint" to the behavior one should adopt after his or her lazyness
// As an "hint" to the behavior one should adopt after his or her laziness
// it will return 0 if the call was a noop, either because it did not need to
// change OR because it wasn't ABLE to change :)
// 1 if the mount status actually changed
@ -384,7 +384,7 @@ int rdv40_spiffs_lazy_mount_rollback(int changed) {
}
///////////////////////////////////////////////////////////////////////////////
// High level functions with SatefetyLevel
// High level functions with SafetyLevel
// Beware that different safety level makes different return behavior
//
// RDV40_SPIFFS_SAFETY_NORMAL : will operate withtout further change on mount
@ -396,7 +396,7 @@ int rdv40_spiffs_lazy_mount_rollback(int changed) {
// mount state had to change will return SPIFFS_OK /
// 0 / false if everything went well
// TODO : this functions are common enought to be unified with a switchcase
// TODO : this functions are common enough to be unified with a switchcase
// statement or some function taking function parameters
// TODO : forbid writing to a filename which already exists as lnk !
// TODO : forbid writing to a filename.lnk which already exists without lnk !
@ -468,7 +468,7 @@ int rdv40_spiffs_is_symlink(const char *s) {
// since FILENAME can't be longer than 32Bytes as of hard configuration, we're
// safe with Such maximum. So the "size" variable is actually the known/intended
// size of DESTINATION file, may it be known (may we provide a "stat from
// symlinkk ?")
// symlink ?")
// ATTENTION : you must NOT provide the whole filename (so please do not include the .lnk extension)
// TODO : integrate in read_function
int rdv40_spiffs_read_as_symlink(char *filename, uint8_t *dst, uint32_t size, RDV40SpiFFSSafetyLevel level) {
@ -499,7 +499,7 @@ int rdv40_spiffs_read_as_symlink(char *filename, uint8_t *dst, uint32_t size, RD
// Eg :
// rdv40_spiffs_make_symlink((uint8_t *)"hello", (uint8_t *)"world", RDV40_SPIFFS_SAFETY_SAFE)
// will generate a file named "world.lnk" with the path to file "hello" written in
// wich you can then read back with :
// which you can then read back with :
// rdv40_spiffs_read_as_symlink((uint8_t *)"world",(uint8_t *) buffer, orig_file_size, RDV40_SPIFFS_SAFETY_SAFE);
// TODO : FORBID creating a symlink with a basename (before.lnk) which already exists as a file !
int rdv40_spiffs_make_symlink(char *linkdest, char *filename, RDV40SpiFFSSafetyLevel level) {
@ -513,8 +513,8 @@ int rdv40_spiffs_make_symlink(char *linkdest, char *filename, RDV40SpiFFSSafetyL
// filename and filename.lnk will both the existence-checked
// if filename exists, read will be used, if filename.lnk exists, read_as_symlink will be used
// Both existence is not handled right now and should not happen or create a default fallback behavior
// Still, this case won't happend when the write(s) functions will check for both symlink and real file
// preexistance, avoiding a link being created if filename exists, or avoiding a file being created if
// Still, this case won't happen when the write(s) functions will check for both symlink and real file
// preexistence, avoiding a link being created if filename exists, or avoiding a file being created if
// symlink exists with same name
int rdv40_spiffs_read_as_filetype(char *filename, uint8_t *dst, uint32_t size, RDV40SpiFFSSafetyLevel level) {
RDV40_SPIFFS_SAFE_FUNCTION(
@ -537,7 +537,7 @@ int rdv40_spiffs_read_as_filetype(char *filename, uint8_t *dst, uint32_t size, R
// TODO regarding reads/write and symlinks :
// Provide a higher level readFile function which
// - don't need a size to be provided, getting it from STAT call and using bigbuff malloc
// - send back the whole readed file as return Result
// - send back the whole read file as return Result
// Maybe a good think to implement a VFS api here.
////////////////////////////////////////////////////////////////////////////////
@ -566,10 +566,10 @@ void rdv40_spiffs_safe_print_fsinfo(void) {
// this function is safe and WILL rollback since it is only a PRINTING function,
// not a function intended to give any sort of struct to manipulate the FS
// objects
// TODO : Fake the Directory availability by spliting strings , buffering,
// maintaining prefix list sorting, unique_checking, THEN outputing precomputed
// tree Other solutio nwould be to add directory support to SPIFFS, but that we
// dont want, as prefix are way easier and lighter in every aspect.
// TODO : Fake the Directory availability by splitting strings , buffering,
// maintaining prefix list sorting, unique_checking, THEN outputting precomputed
// tree Other solution would be to add directory support to SPIFFS, but that we
// don't want, as prefix are way easier and lighter in every aspect.
void rdv40_spiffs_safe_print_tree(void) {
int changed = rdv40_spiffs_lazy_mount();
spiffs_DIR d;
@ -643,7 +643,7 @@ void test_spiffs(void) {
Dbprintf(" Writing 'I love Proxmark3 RDV4' in a testspiffs.txt");
// Since We lazy_mounted manually before hand, the wrte safety level will
// Since We lazy_mounted manually before hand, the write safety level will
// just imply noops
rdv40_spiffs_write((char *)"testspiffs.txt", (uint8_t *)"I love Proxmark3 RDV4", 21, RDV40_SPIFFS_SAFETY_SAFE);

View file

@ -742,7 +742,7 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh);
* in this callback will mess things up for sure - do not do this.
* This can be used to track where files are and move around during garbage
* collection, which in turn can be used to build location tables in ram.
* Used in conjuction with SPIFFS_open_by_page this may improve performance
* Used in conjunction with SPIFFS_open_by_page this may improve performance
* when opening a lot of files.
* Must be invoked after mount.
*