mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-13 01:57:25 -07:00
Update hf_bog.c
This commit is contained in:
parent
9bd7770dfe
commit
43f90181b3
1 changed files with 9 additions and 10 deletions
|
@ -11,7 +11,7 @@
|
||||||
#define DELAY_TAG_AIR2ARM_AS_SNIFFER (3 + 14 + 8)
|
#define DELAY_TAG_AIR2ARM_AS_SNIFFER (3 + 14 + 8)
|
||||||
|
|
||||||
// Maximum number of auth attempts per standalone session
|
// Maximum number of auth attempts per standalone session
|
||||||
#define MAX_PWDS_PER_SESSION 20
|
#define MAX_PWDS_PER_SESSION 64
|
||||||
|
|
||||||
|
|
||||||
uint8_t FindOffsetInFlash() {
|
uint8_t FindOffsetInFlash() {
|
||||||
|
@ -19,16 +19,16 @@ uint8_t FindOffsetInFlash() {
|
||||||
uint8_t eom[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
|
uint8_t eom[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||||
uint8_t memcnt = 0;
|
uint8_t memcnt = 0;
|
||||||
|
|
||||||
while (1)
|
while (memcnt < 4096)
|
||||||
{
|
{
|
||||||
Flash_ReadData(memcnt, mem, 4);
|
Flash_ReadData(memcnt, mem, 4);
|
||||||
if (memcmp(mem, eom, 4) == 0) {
|
if (memcmp(mem, eom, 4) == 0) {
|
||||||
break;
|
return memcnt;
|
||||||
}
|
}
|
||||||
memcnt += 4;
|
memcnt += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return memcnt;
|
return 0; // wrap-around
|
||||||
}
|
}
|
||||||
|
|
||||||
void EraseMemory()
|
void EraseMemory()
|
||||||
|
@ -48,11 +48,6 @@ void EraseMemory()
|
||||||
|
|
||||||
void RAMFUNC SniffAndStore(uint8_t param) {
|
void RAMFUNC SniffAndStore(uint8_t param) {
|
||||||
|
|
||||||
// Array to store the authpwds
|
|
||||||
uint8_t *capturedPwds = BigBuf_malloc(4 * MAX_PWDS_PER_SESSION);
|
|
||||||
|
|
||||||
SpinDelay(500);
|
|
||||||
|
|
||||||
/* This is actually copied from SniffIso14443a */
|
/* This is actually copied from SniffIso14443a */
|
||||||
|
|
||||||
iso14443a_setup(FPGA_HF_ISO14443A_SNIFFER);
|
iso14443a_setup(FPGA_HF_ISO14443A_SNIFFER);
|
||||||
|
@ -63,6 +58,9 @@ void RAMFUNC SniffAndStore(uint8_t param) {
|
||||||
clear_trace();
|
clear_trace();
|
||||||
set_tracing(true);
|
set_tracing(true);
|
||||||
|
|
||||||
|
// Array to store the authpwds
|
||||||
|
uint8_t *capturedPwds = BigBuf_malloc(4 * MAX_PWDS_PER_SESSION);
|
||||||
|
|
||||||
// The command (reader -> tag) that we're receiving.
|
// The command (reader -> tag) that we're receiving.
|
||||||
uint8_t *receivedCmd = BigBuf_malloc(MAX_FRAME_SIZE);
|
uint8_t *receivedCmd = BigBuf_malloc(MAX_FRAME_SIZE);
|
||||||
uint8_t *receivedCmdPar = BigBuf_malloc(MAX_PARITY_SIZE);
|
uint8_t *receivedCmdPar = BigBuf_malloc(MAX_PARITY_SIZE);
|
||||||
|
@ -265,7 +263,8 @@ void RAMFUNC SniffAndStore(uint8_t param) {
|
||||||
void RunMod()
|
void RunMod()
|
||||||
{
|
{
|
||||||
Dbprintf("Sniffing started");
|
Dbprintf("Sniffing started");
|
||||||
SpinDelay(200);
|
|
||||||
|
SpinDelay(200);
|
||||||
|
|
||||||
// param:
|
// param:
|
||||||
// bit 0 - trigger from first card answer
|
// bit 0 - trigger from first card answer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue