X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/bf85d22f963d607b8d5eb019af3056df628f0048..537f80f2c8a84c8d48e66af78ed28d96306b8d9f:/client/cmdlft55xx.c diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c index 123c2064..ed8e3152 100644 --- a/client/cmdlft55xx.c +++ b/client/cmdlft55xx.c @@ -141,15 +141,16 @@ int usage_t55xx_detect(){ return 0; } int usage_t55xx_detectP1(){ - PrintAndLog("Usage: lf t55xx page1detect [1] [p ]"); + PrintAndLog("Command: Detect Page 1 of a t55xx chip"); + PrintAndLog("Usage: lf t55xx p1detect [1] [p ]"); PrintAndLog("Options:"); PrintAndLog(" 1 - if set, use Graphbuffer otherwise read data from tag."); PrintAndLog(" p - OPTIONAL password (8 hex characters)"); PrintAndLog(""); PrintAndLog("Examples:"); - PrintAndLog(" lf t55xx page1detect"); - PrintAndLog(" lf t55xx page1detect 1"); - PrintAndLog(" lf t55xx page1detect p 11223344"); + PrintAndLog(" lf t55xx p1detect"); + PrintAndLog(" lf t55xx p1detect 1"); + PrintAndLog(" lf t55xx p1detect p 11223344"); PrintAndLog(""); return 0; } @@ -506,8 +507,8 @@ bool tryDetectModulation(){ t55xx_conf_block_t tests[15]; int bitRate=0; uint8_t fc1 = 0, fc2 = 0, ans = 0; - int clk=0; - ans = fskClocks(&fc1, &fc2, (uint8_t *)&clk, false); + int clk = 0, firstClockEdge = 0; + ans = fskClocks(&fc1, &fc2, (uint8_t *)&clk, false, &firstClockEdge); if (ans && ((fc1==10 && fc2==8) || (fc1==8 && fc2==5))) { if ( FSKrawDemod("0 0", false) && test(DEMOD_FSK, &tests[hits].offset, &bitRate, clk, &tests[hits].Q5)) { tests[hits].modulation = DEMOD_FSK; @@ -809,6 +810,7 @@ bool test(uint8_t mode, uint8_t *offset, int *fndBitRate, uint8_t clk, bool *Q5) if (!testBitRate(bitRate, clk)) continue; } else { //extended mode bitrate = same function to calc bitrate as em4x05 if (EM4x05_GET_BITRATE(bitRate) != clk) continue; + } //test modulation if (!testModulation(mode, modread)) continue; @@ -868,7 +870,7 @@ int special(const char *Cmd) { int printConfiguration( t55xx_conf_block_t b){ PrintAndLog("Chip Type : %s", (b.Q5) ? "T5555(Q5)" : "T55x7"); PrintAndLog("Modulation : %s", GetSelectedModulationStr(b.modulation) ); - PrintAndLog("Bit Rate : %s", GetBitRateStr(b.bitrate, (b.block0 & T55x7_X_MODE)) ); + PrintAndLog("Bit Rate : %s", GetBitRateStr(b.bitrate, (b.block0 & T55x7_X_MODE && (b.block0>>28==6 || b.block0>>28==9))) ); PrintAndLog("Inverted : %s", (b.inverted) ? "Yes" : "No" ); PrintAndLog("Offset : %d", b.offset); PrintAndLog("Seq. Term. : %s", (b.ST) ? "Yes" : "No" ); @@ -1232,11 +1234,7 @@ int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password ){ PrintAndLog("command execution time out"); return 0; } - - uint8_t got[12000]; - GetFromBigBuf(got,sizeof(got),0); - WaitForResponse(CMD_ACK,NULL); - setGraphBuf(got, sizeof(got)); + getSamples(12000,true); return 1; } @@ -1557,7 +1555,7 @@ bool tryDetectP1(bool getData) { uint8_t preamble[] = {1,1,1,0,0,0,0,0,0,0,0,1,0,1,0,1}; size_t startIdx = 0; uint8_t fc1 = 0, fc2 = 0, ans = 0; - int clk = 0; + int clk = 0, firstClockEdge = 0; bool st = true; if ( getData ) { @@ -1566,7 +1564,7 @@ bool tryDetectP1(bool getData) { } // try fsk clock detect. if successful it cannot be any other type of modulation... (in theory...) - ans = fskClocks(&fc1, &fc2, (uint8_t *)&clk, false); + ans = fskClocks(&fc1, &fc2, (uint8_t *)&clk, false, &firstClockEdge); if (ans && ((fc1==10 && fc2==8) || (fc1==8 && fc2==5))) { if ( FSKrawDemod("0 0", false) && preambleSearchEx(DemodBuffer,preamble,sizeof(preamble),&DemodBufferLen,&startIdx,false) &&