chg: 'standalone mode BogRun' - cleaning

This commit is contained in:
Chris 2018-11-06 19:14:19 +01:00
parent 4d124c46f2
commit 5a03ea7135

View file

@ -43,8 +43,7 @@ uint8_t FindOffsetInFlash() {
return 0; // wrap-around
}
void EraseMemory()
{
void EraseMemory() {
if (!FlashInit()){
return;
}
@ -257,10 +256,7 @@ void RAMFUNC SniffAndStore(uint8_t param) {
// Erase first page of flash mem
EraseMemory();
//for (int i=0; i<memoffset + 4 * auth_attempts; i++)
// if (MF_DBGLEVEL > 1) Dbprintf("[-] total_data[%d] = 0x%02x", i, total_data[i]);
// Write total data to flash mem
uint16_t writelen = Flash_WriteData(0, total_data, memoffset + 4 * auth_attempts);
if (MF_DBGLEVEL > 1) Dbprintf("[!] Wrote %u bytes into flash mem", writelen);
@ -272,18 +268,13 @@ void RAMFUNC SniffAndStore(uint8_t param) {
}
}
void RunMod()
{
void RunMod() {
Dbprintf("Sniffing started");
SpinDelay(200);
// param:
// bit 0 - trigger from first card answer
// bit 1 - trigger from first reader 7-bit request
SniffAndStore(0);
LEDsoff();
SniffAndStore(0);
LEDsoff();
SpinDelay(300);
}