mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
fix: high and low variable should now contain raw hex.
This commit is contained in:
parent
0ef6e190e7
commit
bc131dd105
3 changed files with 96 additions and 91 deletions
|
@ -614,7 +614,8 @@ void UsbPacketReceived(uint8_t *packet, int len) {
|
||||||
CopyIOtoT55x7(c->arg[0], c->arg[1]);
|
CopyIOtoT55x7(c->arg[0], c->arg[1]);
|
||||||
break;
|
break;
|
||||||
case CMD_EM410X_DEMOD: {
|
case CMD_EM410X_DEMOD: {
|
||||||
uint32_t high, low;
|
uint32_t high;
|
||||||
|
uint64_t low;
|
||||||
CmdEM410xdemod(c->arg[0], &high, &low, 1);
|
CmdEM410xdemod(c->arg[0], &high, &low, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ void CmdASKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream)
|
||||||
void CmdPSKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream);
|
void CmdPSKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream);
|
||||||
void CmdHIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol);
|
void CmdHIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol);
|
||||||
void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol); // Realtime demodulation mode for AWID26
|
void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol); // Realtime demodulation mode for AWID26
|
||||||
void CmdEM410xdemod(int findone, uint32_t *high, uint32_t *low, int ledcontrol);
|
void CmdEM410xdemod(int findone, uint32_t *high, uint64_t *low, int ledcontrol);
|
||||||
void CmdIOdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol);
|
void CmdIOdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol);
|
||||||
void CopyIOtoT55x7(uint32_t hi, uint32_t lo); // Clone an ioProx card to T5557/T5567
|
void CopyIOtoT55x7(uint32_t hi, uint32_t lo); // Clone an ioProx card to T5557/T5567
|
||||||
void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT); // Clone an HID card to T5557/T5567
|
void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT); // Clone an HID card to T5557/T5567
|
||||||
|
|
|
@ -634,7 +634,7 @@ void CmdHIDsimTAGEx( uint32_t hi, uint32_t lo, int ledcontrol, int numcycles) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CmdHIDsimTAG( uint32_t hi, uint32_t lo, int ledcontrol) {
|
void CmdHIDsimTAG( uint32_t hi, uint32_t lo, int ledcontrol) {
|
||||||
void CmdHIDsimTAG( hi, lo, ledcontrol, -1);
|
void CmdHIDsimTAGEx( hi, lo, ledcontrol, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare a waveform pattern in the buffer based on the ID given then
|
// prepare a waveform pattern in the buffer based on the ID given then
|
||||||
|
@ -815,7 +815,7 @@ void CmdPSKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop to get raw HID waveform then FSK demodulate the TAG ID from it
|
// loop to get raw HID waveform then FSK demodulate the TAG ID from it
|
||||||
void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol) {
|
void CmdHIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
||||||
uint8_t *dest = BigBuf_get_addr();
|
uint8_t *dest = BigBuf_get_addr();
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
uint32_t hi2 = 0, hi = 0, lo = 0;
|
uint32_t hi2 = 0, hi = 0, lo = 0;
|
||||||
|
@ -842,10 +842,10 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol) {
|
||||||
// go over previously decoded manchester data and decode into usable tag ID
|
// go over previously decoded manchester data and decode into usable tag ID
|
||||||
if (hi2 != 0){ //extra large HID tags 88/192 bits
|
if (hi2 != 0){ //extra large HID tags 88/192 bits
|
||||||
Dbprintf("TAG ID: %x%08x%08x (%d)",
|
Dbprintf("TAG ID: %x%08x%08x (%d)",
|
||||||
(unsigned int) hi2,
|
hi2,
|
||||||
(unsigned int) hi,
|
hi,
|
||||||
(unsigned int) lo,
|
lo,
|
||||||
(unsigned int) (lo>>1) & 0xFFFF
|
(lo >> 1) & 0xFFFF
|
||||||
);
|
);
|
||||||
} else { //standard HID tags 44/96 bits
|
} else { //standard HID tags 44/96 bits
|
||||||
uint8_t bitlen = 0;
|
uint8_t bitlen = 0;
|
||||||
|
@ -857,7 +857,7 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol) {
|
||||||
lo2=(((hi & 31) << 12) | (lo>>20)); //get bits 21-37 to check for format len bit
|
lo2=(((hi & 31) << 12) | (lo>>20)); //get bits 21-37 to check for format len bit
|
||||||
uint8_t idx3 = 1;
|
uint8_t idx3 = 1;
|
||||||
while (lo2 > 1){ //find last bit set to 1 (format len bit)
|
while (lo2 > 1){ //find last bit set to 1 (format len bit)
|
||||||
lo2=lo2 >> 1;
|
lo2 >>= 1;
|
||||||
idx3++;
|
idx3++;
|
||||||
}
|
}
|
||||||
bitlen = idx3 + 19;
|
bitlen = idx3 + 19;
|
||||||
|
@ -890,12 +890,13 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dbprintf("TAG ID: %x%08x (%d) - Format Len: %dbit - FC: %d - Card: %d",
|
Dbprintf("TAG ID: %x%08x (%d) - Format Len: %dbit - FC: %d - Card: %d",
|
||||||
(unsigned int) hi,
|
hi,
|
||||||
(unsigned int) lo,
|
lo,
|
||||||
(unsigned int) (lo>>1) & 0xFFFF,
|
(lo >> 1) & 0xFFFF,
|
||||||
(unsigned int) bitlen,
|
bitlen,
|
||||||
(unsigned int) fc,
|
fc,
|
||||||
(unsigned int) cardnum);
|
cardnum
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (findone){
|
if (findone){
|
||||||
if (ledcontrol) LED_A_OFF();
|
if (ledcontrol) LED_A_OFF();
|
||||||
|
@ -914,12 +915,16 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol) {
|
||||||
|
|
||||||
// loop to get raw HID waveform then FSK demodulate the TAG ID from it
|
// loop to get raw HID waveform then FSK demodulate the TAG ID from it
|
||||||
void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
||||||
|
|
||||||
uint8_t *dest = BigBuf_get_addr();
|
uint8_t *dest = BigBuf_get_addr();
|
||||||
size_t size;
|
|
||||||
|
//big enough to catch 2 sequences of largest format
|
||||||
|
size_t size = 12800; //50 * 128 * 2;
|
||||||
|
|
||||||
int idx = 0, dummyIdx = 0;
|
int idx = 0, dummyIdx = 0;
|
||||||
//clear read buffer
|
|
||||||
BigBuf_Clear_keep_EM();
|
BigBuf_Clear_keep_EM();
|
||||||
// Configure to go in 125Khz listen mode
|
|
||||||
LFSetupFPGAForADC(95, true);
|
LFSetupFPGAForADC(95, true);
|
||||||
|
|
||||||
while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
||||||
|
@ -929,7 +934,7 @@ void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol)
|
||||||
|
|
||||||
DoAcquisition_default(-1, true);
|
DoAcquisition_default(-1, true);
|
||||||
// FSK demodulator
|
// FSK demodulator
|
||||||
size = 50*128*2; //big enough to catch 2 sequences of largest format
|
|
||||||
idx = detectAWID(dest, &size, &dummyIdx);
|
idx = detectAWID(dest, &size, &dummyIdx);
|
||||||
|
|
||||||
if (idx <= 0 || size != 96) continue;
|
if (idx <= 0 || size != 96) continue;
|
||||||
|
@ -991,8 +996,8 @@ void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol)
|
||||||
}
|
}
|
||||||
if (findone){
|
if (findone){
|
||||||
if (ledcontrol) LED_A_OFF();
|
if (ledcontrol) LED_A_OFF();
|
||||||
*high = hi;
|
*high = rawHi;
|
||||||
*low = lo;
|
*low = rawLo;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// reset
|
// reset
|
||||||
|
@ -1004,16 +1009,16 @@ void CmdAWIDdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol)
|
||||||
if (ledcontrol) LED_A_OFF();
|
if (ledcontrol) LED_A_OFF();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CmdEM410xdemod(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
void CmdEM410xdemod(int findone, uint32_t *high, uint64_t *low, int ledcontrol) {
|
||||||
uint8_t *dest = BigBuf_get_addr();
|
uint8_t *dest = BigBuf_get_addr();
|
||||||
|
|
||||||
size_t size = 0, idx = 0;
|
size_t size = 0, idx = 0;
|
||||||
int clk = 0, invert = 0, errCnt = 0, maxErr = 20;
|
int clk = 0, invert = 0, errCnt = 0, maxErr = 20;
|
||||||
uint32_t hi = 0;
|
uint32_t hi = 0;
|
||||||
uint64_t lo = 0;
|
uint64_t lo = 0;
|
||||||
//clear read buffer
|
|
||||||
BigBuf_Clear_keep_EM();
|
BigBuf_Clear_keep_EM();
|
||||||
// Configure to go in 125Khz listen mode
|
|
||||||
LFSetupFPGAForADC(95, true);
|
LFSetupFPGAForADC(95, true);
|
||||||
|
|
||||||
while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
while(!BUTTON_PRESS() && !usb_poll_validate_length()) {
|
||||||
|
@ -1066,15 +1071,14 @@ void CmdEM410xdemod(int findone, uint32_t *high, uint32_t *low, int ledcontrol)
|
||||||
}
|
}
|
||||||
|
|
||||||
void CmdIOdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
void CmdIOdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
||||||
|
|
||||||
uint8_t *dest = BigBuf_get_addr();
|
uint8_t *dest = BigBuf_get_addr();
|
||||||
int dummyIdx = 0;
|
|
||||||
int idx = 0;
|
int dummyIdx = 0, idx = 0;
|
||||||
uint32_t code = 0, code2 = 0;
|
uint32_t code = 0, code2 = 0;
|
||||||
uint8_t version = 0;
|
uint8_t version = 0, facilitycode = 0, crc = 0;
|
||||||
uint8_t facilitycode = 0;
|
uint16_t number = 0, calccrc = 0;
|
||||||
uint16_t number = 0;
|
|
||||||
uint8_t crc = 0;
|
|
||||||
uint16_t calccrc = 0;
|
|
||||||
size_t size = BigBuf_max_traceLen();
|
size_t size = BigBuf_max_traceLen();
|
||||||
|
|
||||||
BigBuf_Clear_keep_EM();
|
BigBuf_Clear_keep_EM();
|
||||||
|
@ -1137,8 +1141,8 @@ void CmdIOdemodFSK(int findone, uint32_t *high, uint32_t *low, int ledcontrol) {
|
||||||
// if we're only looking for one tag
|
// if we're only looking for one tag
|
||||||
if (findone){
|
if (findone){
|
||||||
if (ledcontrol) LED_A_OFF();
|
if (ledcontrol) LED_A_OFF();
|
||||||
*high = hi;
|
*high = code;
|
||||||
*low = lo;
|
*low = code2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
code = code2 = 0;
|
code = code2 = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue