From: iceman1001 Date: Wed, 3 Jun 2015 19:35:03 +0000 (+0200) Subject: ADD: next step ISO11784/85 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/0df669a29847cb0db5fc45389b52ee64ce7f15d7 ADD: next step ISO11784/85 --- diff --git a/client/cmddata.c b/client/cmddata.c index 90a0921c..87cf4bac 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -1457,21 +1457,65 @@ int CmdFSKdemodPyramid(const char *Cmd) return 1; } +// ISO11784/85 demod (aka animal tag) BIPHASE rf/32, with preamble of 00000000001 (128bits) +// 8 databits 1 parity +// CIITT 16 chksum +// NATIONAL CODE, ICAR database +// COUNTRY CODE (ISO3166) +// FLAG (animal/non-animal) int CmdIso11784demodBI(const char *Cmd){ - //ASK/Biphase demod, - uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0}; - size_t size = getFromGraphBuf(BitStream); - if (size==0) return 0; - - //get binary from Biphase wave - int idx = ISO11784demodBI(BitStream, &size); - setDemodBuf(BitStream,128,idx); + + if (!ASKbiphaseDemod(Cmd, FALSE)){ + if (g_debugMode) PrintAndLog("ASKbiphaseDemod failed 1st try"); + return 0; + } + size_t size = DemodBufferLen; - size = removeParity(BitStream, idx+8, 4, 1, 88); - // if (size != 66){ - // if (g_debugMode==1) PrintAndLog("DEBUG: Error - at parity check-tag size does not match AWID format"); - // return 0; - // } + int ans = ISO11784demodBI(DemodBuffer, &size); + if (ans < 0){ + if (g_debugMode) PrintAndLog("Error ISO11784Demod"); + return 0; + } + + //size = removeParity(BitStream, idx+11, 9, 1, 104); + + //got a good demod + uint32_t ByteStream[13] = {0x00}; + uint8_t xorKey=0; + uint8_t keyCnt=0; + uint8_t bitCnt=0; + uint8_t ByteCnt=0; + size_t startIdx = ans + 11; //start after preamble + for (size_t idx = 0; idx