CHG: merged the forum user @jason 's fixes to LEGIC. *UNTESTED*
CHG: changed the CRC implementations.
This commit is contained in:
@@ -1058,6 +1058,10 @@ void UsbPacketReceived(uint8_t *packet, int len)
|
||||
LegicRfWriter(c->arg[1], c->arg[0]);
|
||||
break;
|
||||
|
||||
case CMD_RAW_WRITER_LEGIC_RF:
|
||||
LegicRfRawWriter(c->arg[0], c->arg[1]);
|
||||
break;
|
||||
|
||||
case CMD_READER_LEGIC_RF:
|
||||
LegicRfReader(c->arg[0], c->arg[1]);
|
||||
break;
|
||||
|
||||
934
armsrc/legicrf.c
934
armsrc/legicrf.c
File diff suppressed because it is too large
Load Diff
@@ -14,5 +14,9 @@
|
||||
extern void LegicRfSimulate(int phase, int frame, int reqresp);
|
||||
extern int LegicRfReader(int bytes, int offset);
|
||||
extern void LegicRfWriter(int bytes, int offset);
|
||||
extern void LegicRfRawWriter(int offset, int bytes);
|
||||
|
||||
int ice_legic_select_card();
|
||||
void ice_legic_setup();
|
||||
|
||||
#endif /* __LEGICRF_H */
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "common.h"
|
||||
#include "string.h"
|
||||
#include "apps.h"
|
||||
#include "BigBuf.h"
|
||||
#include "proxmark3.h"
|
||||
|
||||
#define BYTEx(x, n) (((x) >> (n * 8)) & 0xff )
|
||||
|
||||
@@ -27,9 +31,17 @@
|
||||
#define BUTTON_DOUBLE_CLICK -2
|
||||
#define BUTTON_ERROR -99
|
||||
|
||||
#ifndef BSWAP_16
|
||||
# define BSWAP_16(x) ((( ((x) & 0xFF00 ) >> 8))| ( (((x) & 0x00FF) << 8)))
|
||||
#endif
|
||||
#ifndef BITMASK
|
||||
# define BITMASK(X) (1 << (X))
|
||||
#endif
|
||||
|
||||
void print_result(char *name, uint8_t *buf, size_t len);
|
||||
size_t nbytes(size_t nbits);
|
||||
uint32_t SwapBits(uint32_t value, int nrbits);
|
||||
uint32_t reflect(uint32_t v, int b);
|
||||
void num_to_bytes(uint64_t n, size_t len, uint8_t* dest);
|
||||
uint64_t bytes_to_num(uint8_t* src, size_t len);
|
||||
void rol(uint8_t *data, const size_t len);
|
||||
@@ -52,6 +64,7 @@ uint32_t RAMFUNC GetCountUS();
|
||||
//uint32_t RAMFUNC GetDeltaCountUS();
|
||||
|
||||
void StartCountSspClk();
|
||||
void ResetSspClk(void);
|
||||
uint32_t RAMFUNC GetCountSspClk();
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user