mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
more const for lfops
and some commonutil
This commit is contained in:
parent
d78dae5904
commit
665cf3254b
4 changed files with 19 additions and 19 deletions
|
@ -287,7 +287,7 @@ void printT55xxConfig(void) {
|
|||
DbpString("");
|
||||
}
|
||||
|
||||
void setT55xxConfig(uint8_t arg0, t55xx_configurations_t *c) {
|
||||
void setT55xxConfig(uint8_t arg0, const t55xx_configurations_t *c) {
|
||||
for (uint8_t i = 0; i < 4; i++) {
|
||||
if (c->m[i].start_gap != 0)
|
||||
T55xx_Timing.m[i].start_gap = c->m[i].start_gap;
|
||||
|
@ -1009,7 +1009,7 @@ void CmdHIDsimTAG(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT, bool
|
|||
// prepare a waveform pattern in the buffer based on the ID given then
|
||||
// simulate a FSK tag until the button is pressed
|
||||
// arg1 contains fcHigh and fcLow, arg2 contains STT marker and clock
|
||||
void CmdFSKsimTAGEx(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen, uint8_t *bits, bool ledcontrol, int numcycles) {
|
||||
void CmdFSKsimTAGEx(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen, const uint8_t *bits, bool ledcontrol, int numcycles) {
|
||||
|
||||
FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ void CmdFSKsimTAGEx(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t cl
|
|||
// prepare a waveform pattern in the buffer based on the ID given then
|
||||
// simulate a FSK tag until the button is pressed
|
||||
// arg1 contains fcHigh and fcLow, arg2 contains STT marker and clock
|
||||
void CmdFSKsimTAG(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen, uint8_t *bits, bool ledcontrol) {
|
||||
void CmdFSKsimTAG(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen, const uint8_t *bits, bool ledcontrol) {
|
||||
CmdFSKsimTAGEx(fchigh, fclow, separator, clk, bitslen, bits, ledcontrol, -1);
|
||||
reply_ng(CMD_LF_FSK_SIMULATE, PM3_EOPABORTED, NULL, 0);
|
||||
}
|
||||
|
@ -1866,9 +1866,9 @@ void T55xxResetRead(uint8_t flags, bool ledcontrol) {
|
|||
if (ledcontrol) LED_A_OFF();
|
||||
}
|
||||
|
||||
void T55xxDangerousRawTest(uint8_t *data, bool ledcontrol) {
|
||||
void T55xxDangerousRawTest(const uint8_t *data, bool ledcontrol) {
|
||||
// supports only default downlink mode
|
||||
t55xx_test_block_t *c = (t55xx_test_block_t *)data;
|
||||
const t55xx_test_block_t *c = (const t55xx_test_block_t *)data;
|
||||
|
||||
uint8_t start_wait = 4;
|
||||
uint8_t bs[128 / 8];
|
||||
|
@ -2320,7 +2320,7 @@ void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT, boo
|
|||
}
|
||||
|
||||
// clone viking tag to T55xx
|
||||
void CopyVikingtoT55xx(uint8_t *blocks, bool q5, bool em, bool ledcontrol) {
|
||||
void CopyVikingtoT55xx(const uint8_t *blocks, bool q5, bool em, bool ledcontrol) {
|
||||
|
||||
uint32_t data[] = {T55x7_BITRATE_RF_32 | T55x7_MODULATION_MANCHESTER | (2 << T55x7_MAXBLOCK_SHIFT), 0, 0};
|
||||
if (q5) {
|
||||
|
|
|
@ -38,9 +38,9 @@ void CmdHIDsimTAGEx(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT, boo
|
|||
void CmdHIDsimTAG(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT, bool ledcontrol);
|
||||
|
||||
void CmdFSKsimTAGEx(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen,
|
||||
uint8_t *bits, bool ledcontrol, int numcycles);
|
||||
const uint8_t *bits, bool ledcontrol, int numcycles);
|
||||
void CmdFSKsimTAG(uint8_t fchigh, uint8_t fclow, uint8_t separator, uint8_t clk, uint16_t bitslen,
|
||||
uint8_t *bits, bool ledcontrol);
|
||||
const uint8_t *bits, bool ledcontrol);
|
||||
void CmdASKsimTAG(uint8_t encoding, uint8_t invert, uint8_t separator, uint8_t clk, uint16_t size,
|
||||
const uint8_t *bits, bool ledcontrol);
|
||||
void CmdPSKsimTAG(uint8_t carrier, uint8_t invert, uint8_t clk, uint16_t size,
|
||||
|
@ -54,7 +54,7 @@ int lf_em410x_watch(int findone, uint32_t *high, uint64_t *low, bool ledcontrol)
|
|||
int lf_io_watch(int findone, uint32_t *high, uint32_t *low, bool ledcontrol);
|
||||
|
||||
void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT, bool q5, bool em, bool ledcontrol); // Clone an HID card to T5557/T5567
|
||||
void CopyVikingtoT55xx(uint8_t *blocks, bool q5, bool em, bool ledcontrol);
|
||||
void CopyVikingtoT55xx(const uint8_t *blocks, bool q5, bool em, bool ledcontrol);
|
||||
|
||||
int copy_em410x_to_t55xx(uint8_t card, uint8_t clock, uint32_t id_hi, uint32_t id_lo, bool ledcontrol);
|
||||
|
||||
|
@ -66,7 +66,7 @@ void T55xxReadBlock(uint8_t page, bool pwd_mode, bool brute_mem, uint8_t block,
|
|||
uint8_t downlink_mode, bool ledcontrol);
|
||||
void T55xxWakeUp(uint32_t pwd, uint8_t flags, bool ledcontrol);
|
||||
void T55xx_ChkPwds(uint8_t flags, bool ledcontrol);
|
||||
void T55xxDangerousRawTest(uint8_t *data, bool ledcontrol);
|
||||
void T55xxDangerousRawTest(const uint8_t *data, bool ledcontrol);
|
||||
|
||||
void turn_read_lf_on(uint32_t delay);
|
||||
void turn_read_lf_off(uint32_t delay);
|
||||
|
@ -78,7 +78,7 @@ void EM4xWriteWord(uint8_t addr, uint32_t data, uint32_t pwd, uint8_t usepwd, bo
|
|||
void EM4xProtectWord(uint32_t data, uint32_t pwd, uint8_t usepwd, bool ledcontrol);
|
||||
|
||||
void Cotag(uint32_t arg0, bool ledcontrol);
|
||||
void setT55xxConfig(uint8_t arg0, t55xx_configurations_t *c);
|
||||
void setT55xxConfig(uint8_t arg0, const t55xx_configurations_t *c);
|
||||
t55xx_configurations_t *getT55xxConfig(void);
|
||||
void printT55xxConfig(void);
|
||||
void loadT55xxConfig(void);
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
* verifies the magic properties, then stores a formatted string, prefixed by
|
||||
* prefix in dst.
|
||||
*/
|
||||
void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_info) {
|
||||
struct version_information_t *v = (struct version_information_t *)version_info;
|
||||
void FormatVersionInformation(char *dst, int len, const char *prefix, const void *version_info) {
|
||||
const struct version_information_t *v = (const struct version_information_t *)version_info;
|
||||
dst[0] = 0;
|
||||
strncat(dst, prefix, len - 1);
|
||||
if (v->magic != VERSION_INFORMATION_MAGIC) {
|
||||
|
@ -53,8 +53,8 @@ void FormatVersionInformation(char *dst, int len, const char *prefix, void *vers
|
|||
strncat(dst, v->armsrc, len - strlen(dst) - 1);
|
||||
}
|
||||
|
||||
void format_version_information_short(char *dst, int len, void *version_info) {
|
||||
struct version_information_t *v = (struct version_information_t *)version_info;
|
||||
void format_version_information_short(char *dst, int len, const void *version_info) {
|
||||
const struct version_information_t *v = (const struct version_information_t *)version_info;
|
||||
dst[0] = 0;
|
||||
if (v->magic != VERSION_INFORMATION_MAGIC) {
|
||||
strncat(dst, "Missing/Invalid version information", len - strlen(dst) - 1);
|
||||
|
@ -151,7 +151,7 @@ void num_to_bytes(uint64_t n, size_t len, uint8_t *dest) {
|
|||
}
|
||||
}
|
||||
|
||||
uint64_t bytes_to_num(uint8_t *src, size_t len) {
|
||||
uint64_t bytes_to_num(const uint8_t *src, size_t len) {
|
||||
uint64_t num = 0;
|
||||
while (len--) {
|
||||
num = (num << 8) | (*src);
|
||||
|
|
|
@ -50,8 +50,8 @@
|
|||
#endif
|
||||
|
||||
extern struct version_information_t g_version_information;
|
||||
void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_info);
|
||||
void format_version_information_short(char *dst, int len, void *version_info);
|
||||
void FormatVersionInformation(char *dst, int len, const char *prefix, const void *version_info);
|
||||
void format_version_information_short(char *dst, int len, const void *version_info);
|
||||
|
||||
uint32_t reflect(uint32_t v, int b); // used in crc.c ...
|
||||
uint8_t reflect8(uint8_t b); // dedicated 8bit reversal
|
||||
|
@ -59,7 +59,7 @@ uint16_t reflect16(uint16_t b); // dedicated 16bit reversal
|
|||
uint32_t reflect32(uint32_t b); // dedicated 32bit reversal
|
||||
|
||||
void num_to_bytes(uint64_t n, size_t len, uint8_t *dest);
|
||||
uint64_t bytes_to_num(uint8_t *src, size_t len);
|
||||
uint64_t bytes_to_num(const uint8_t *src, size_t len);
|
||||
|
||||
// LE and BE to/from memory
|
||||
uint16_t MemLeToUint2byte(const uint8_t *data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue