Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
iceman1001 committed Dec 1, 2023
1 parent bcbe760 commit a913b2c
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 26 deletions.
4 changes: 2 additions & 2 deletions armsrc/lfsampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ uint32_t SampleLF(bool verbose, uint32_t sample_size, bool ledcontrol) {

/**
* Do LF sampling and send samples to the USB
*
*
* Uses parameters in config. Only bits_per_sample = 8 is working now
*
*
* @param reader_field - true for reading tags, false for sniffing
* @return sampling result
**/
Expand Down
4 changes: 2 additions & 2 deletions armsrc/lfsampling.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ uint32_t SampleLF(bool verbose, uint32_t sample_size, bool ledcontrol);

/**
* Do LF sampling and send samples to the USB
*
*
* Uses parameters in config. Only bits_per_sample = 8 is working now
*
*
* @param reader_field - true for reading tags, false for sniffing
* @return sampling result
**/
Expand Down
2 changes: 1 addition & 1 deletion client/luascripts/hf_mf_uid_downgrade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Convert a facility code and card number to a Mifare Classic UID, which can be us
Working on HID Readers with any of the following enabled
- Generic 14333A
- Mifare Classic SIO + CSN
- Mifare Classic CSN
- Mifare Classic CSN
]]
example = [[
-- Downgrade a card with the facility code of 146 and card number of 5
Expand Down
6 changes: 3 additions & 3 deletions client/src/cmdhficlass.c
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ static int CmdHFiClassDump(const char *Cmd) {
if (pagemap != PICOPASS_NON_SECURE_PAGEMODE) {
// div key KD
memcpy(tag_data + (PICOPASS_BLOCK_SIZE * 3),
tempbuf + (PICOPASS_BLOCK_SIZE * 3), PICOPASS_BLOCK_SIZE);
tempbuf + (PICOPASS_BLOCK_SIZE * 3), PICOPASS_BLOCK_SIZE);
}
// all memory available
memcpy(tag_data + (PICOPASS_BLOCK_SIZE * payload.start_block),
Expand Down Expand Up @@ -2137,8 +2137,8 @@ static int CmdHFiClassDump(const char *Cmd) {

// AA2 data
memcpy(tag_data + (PICOPASS_BLOCK_SIZE * payload.start_block),
tempbuf + (PICOPASS_BLOCK_SIZE * payload.start_block),
blocks_read * PICOPASS_BLOCK_SIZE);
tempbuf + (PICOPASS_BLOCK_SIZE * payload.start_block),
blocks_read * PICOPASS_BLOCK_SIZE);

bytes_got += (blocks_read * PICOPASS_BLOCK_SIZE);

Expand Down
4 changes: 2 additions & 2 deletions client/src/cmdlf.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ int lf_read(bool verbose, uint64_t samples) {
}

int CmdLFRead(const char *Cmd) {
// In real-time mode, the first few bytes might be the response of CMD_WTX
// In real-time mode, the first few bytes might be the response of CMD_WTX
// rather than the real samples if the LF FPGA image is not ready.
CLIParserContext *ctx;
CLIParserInit(&ctx, "lf read",
Expand Down Expand Up @@ -876,7 +876,7 @@ int lf_sniff(bool realtime, bool verbose, uint64_t samples) {
}

int CmdLFSniff(const char *Cmd) {
// In real-time mode, the first few bytes might be the response of CMD_WTX
// In real-time mode, the first few bytes might be the response of CMD_WTX
// rather than the real samples if the LF FPGA image is not ready.
CLIParserContext *ctx;
CLIParserInit(&ctx, "lf sniff",
Expand Down
10 changes: 5 additions & 5 deletions client/src/comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,14 @@ bool IsCommunicationThreadDead(void) {
// To stop raw receive mode:
// Call SetCommunicationReceiveMode(false)
//
// Note:
// Note:
// 1. The receiving thread won't accept any normal packets after calling
// SetCommunicationReceiveMode(true). You need to call
// SetCommunicationReceiveMode(true). You need to call
// SetCommunicationReceiveMode(false) to stop the raw receiving process.
// 2. If the received size >= len used in SetCommunicationRawReceiveBuffer(),
// The receiving thread will ignore the incoming data to prevent overflow.
// 3. Normally you only need WaitForRawDataTimeout() rather than the
// low level functions like SetCommunicationReceiveMode(),
// 3. Normally you only need WaitForRawDataTimeout() rather than the
// low level functions like SetCommunicationReceiveMode(),
// SetCommunicationRawReceiveBuffer() and GetCommunicationRawReceiveNum()

bool SetCommunicationReceiveMode(bool isRawMode) {
Expand Down Expand Up @@ -825,7 +825,7 @@ static size_t communication_delay(void) {

/**
* @brief Wait for receiving a specified amount of bytes
*
*
* @param buffer The receive buffer
* @param len The maximum receive byte size
* @param ms_timeout the maximum timeout
Expand Down
2 changes: 1 addition & 1 deletion client/src/mifare/mifaredefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static const uint8_t g_mifare_mad_key_b[] = {0x89, 0xEC, 0xA9, 0x7F, 0x8C, 0x2A}
static const uint8_t g_mifare_signature_key_a[] = {0x5C, 0x8F, 0xF9, 0x99, 0x0D, 0xA2};
static const uint8_t g_mifare_signature_key_b[] = {0x4b, 0x79, 0x1b, 0xea, 0x7b, 0xcc};

// Manufacture MFC / QL88 (S17 / B)
// Manufacture MFC / QL88 (S17 / B)
static const uint8_t g_mifare_ql88_signature_key_b[] = {0x70, 0x7B, 0x11, 0xFC, 0x14, 0x81};

static const uint8_t g_mifare_ndef_key[] = {0xd3, 0xf7, 0xd3, 0xf7, 0xd3, 0xf7};
Expand Down
2 changes: 1 addition & 1 deletion client/src/proxguiqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ void Plot::MoveTo(uint32_t pos) {
if (g_GraphTraceLen == 0) return;
g_GraphStart = pos;

QObject* signalSender = sender();
QObject *signalSender = sender();
if (signalSender != nullptr && signalSender != this) {
// Update if it's triggered by a signal from other object
this->update();
Expand Down
2 changes: 1 addition & 1 deletion client/src/proxguiqt.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ProxWidget;
* @brief The actual plot, black area were we paint the graph
*/
class Plot: public QWidget {
Q_OBJECT; //needed for slot/signal classes
Q_OBJECT; //needed for slot/signal classes

private:
QWidget *master;
Expand Down
18 changes: 11 additions & 7 deletions doc/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -9995,16 +9995,18 @@
"description": "Sniff low frequency signal. - use `lf config` to set parameters. - use `data plot` to look at it",
"notes": [
"lf read -v -s 12000 -> collect 12000 samples",
"lf read -s 3000 -@ -> oscilloscope style"
"lf read -s 3000 -@ -> oscilloscope style",
"lf read -r -> use real-time mode"
],
"offline": false,
"options": [
"-h, --help This help",
"-s, --samples <dec> number of samples to collect",
"-v, --verbose verbose output",
"-@ continuous reading mode"
"-@ continuous reading mode",
"-r, --realtime real-time reading mode"
],
"usage": "lf read [-hv@] [-s <dec>]"
"usage": "lf read [-hv@r] [-s <dec>]"
},
"lf search": {
"command": "lf search",
Expand Down Expand Up @@ -10180,16 +10182,18 @@
"description": "Sniff low frequency signal. You need to configure the LF part on the Proxmark3 device manually. Usually a trigger and skip samples is a good thing to set before doing a low frequency sniff. - use `lf config` to set parameters. - use `data plot` to look at sniff signal. - use `lf search -1` to see if signal can be automatic decoded",
"notes": [
"lf sniff -v",
"lf sniff -s 3000 -@ -> oscilloscope style"
"lf sniff -s 3000 -@ -> oscilloscope style",
"lf sniff -r -> use real-time mode"
],
"offline": false,
"options": [
"-h, --help This help",
"-s, --samples <dec> number of samples to collect",
"-v, --verbose verbose output",
"-@ continuous sniffing mode"
"-@ continuous sniffing mode",
"-r, --realtime real-time sniffing mode"
],
"usage": "lf sniff [-hv@] [-s <dec>]"
"usage": "lf sniff [-hv@r] [-s <dec>]"
},
"lf t55xx bruteforce": {
"command": "lf t55xx bruteforce",
Expand Down Expand Up @@ -12066,6 +12070,6 @@
"metadata": {
"commands_extracted": 699,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2023-11-11T20:31:02"
"extracted_on": "2023-12-01T09:58:53"
}
}
3 changes: 2 additions & 1 deletion include/pm3_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ typedef struct {

typedef struct {
// 64KB SRAM -> 524288 bits(max sample num) < 2^30
uint32_t samples : LF_SAMPLES_BITS;
uint32_t samples :
LF_SAMPLES_BITS;
bool realtime : 1;
bool verbose : 1;
} PACKED lf_sample_payload_t;
Expand Down

0 comments on commit a913b2c

Please sign in to comment.