// power up the field
iso14443a_setup(FPGA_HF_ISO14443A_READER_MOD);
-
+
+ iso14a_set_timeout(10500);
+
- iso14a_set_timeout(10500);
-
// select the card
return_code = iso14443a_select_card(uid, &card_select_info, NULL);
if (return_code != 1) {
VPATH = ../common
OBJDIR = obj
--LDLIBS = -L/opt/local/lib -L/usr/local/lib ../liblua/liblua.a -lreadline -lpthread -lm
++LDLIBS = -L/mingw/lib -L/opt/local/lib -L/usr/local/lib ../liblua/liblua.a -lm -lreadline -lpthread -lgdi32
LDFLAGS = $(COMMON_FLAGS)
--CFLAGS = -std=c99 -I. -I../include -I../common -I/opt/local/include -I../liblua -Wall $(COMMON_FLAGS) -g -O4
++CFLAGS = -std=c99 -I. -I../include -I../common -I/mingw/include -I/opt/local/include -I../liblua -Wall $(COMMON_FLAGS) -g -O4
LUAPLATFORM = generic
ifneq (,$(findstring MINGW,$(platform)))
CXXFLAGS = -I$(QTDIR)/include -I$(QTDIR)/include/QtCore -I$(QTDIR)/include/QtGui
tarbin: $(BINS)
$(TAR) $(TARFLAGS) ../proxmark3-$(platform)-bin.tar $(BINS:%=client/%)
++# must be run as root
++install_kext: Info.plist
++ mkdir -p /System/Library/Extensions/Proxmark3.kext/Contents
++ cp Info.plist /System/Library/Extensions/Proxmark3.kext/Contents
++ chown -R root:wheel /System/Library/Extensions/Proxmark3.kext
++ chmod 755 /System/Library/Extensions/Proxmark3.kext /System/Library/Extensions/Proxmark3.kext/Contents
++ chmod 644 /System/Library/Extensions/Proxmark3.kext/Contents/Info.plist
++ rm -rf /System/Library/Caches/com.apple.kext.caches
++ touch /System/Library/Extensions
++ @echo "*** You may need to reboot for the kext to take effect."
++
lua_build:
@echo Compiling liblua, using platform $(LUAPLATFORM)
cd ../liblua && make $(LUAPLATFORM)
static command_t CommandTable[] =
{
{"help", CmdHelp, 1, "This help"},
-- {"cmdread", CmdLFCommandRead, 0, "<off period> <'0' period> <'1' period> <command> ['h'] -- Modulate LF reader field to send command before read (all periods in microseconds) (option 'h' for 134)"},
{"em4x", CmdLFEM4X, 1, "{ EM4X RFIDs... }"},
++ {"hid", CmdLFHID, 1, "{ HID RFIDs... }"},
++ {"hitag", CmdLFHitag, 1, "{ HITAG RFIDs... }"},
++ {"io", CmdLFIO, 1, "{ IOPROX RFIDs... }"},
++ {"pcf7931", CmdLFPCF7931, 1, "{ PCF7931 RFIDs... }"},
++ {"ti", CmdLFTI, 1, "{ TI RFIDs... }"},
++ {"t55xx", CmdLFT55XX, 1, "{ T55X7 RFIDs... }"},
++
{"config", CmdLFSetConfig, 0, "Set config for LF sampling, bit/sample, decimation, frequency"},
++
++ {"cmdread", CmdLFCommandRead, 0, "<off period> <'0' period> <'1' period> <command> ['h'] -- Modulate LF reader field to send command before read (all periods in microseconds) (option 'h' for 134)"},
{"flexdemod", CmdFlexdemod, 1, "Demodulate samples for FlexPass"},
-- {"hid", CmdLFHID, 1, "{ HID RFIDs... }"},
-- {"io", CmdLFIO, 1, "{ ioProx tags... }"},
{"indalademod", CmdIndalaDemod, 1, "['224'] -- Demodulate samples for Indala 64 bit UID (option '224' for 224 bit)"},
{"indalaclone", CmdIndalaClone, 0, "<UID> ['l']-- Clone Indala to T55x7 (tag must be in antenna)(UID in HEX)(option 'l' for 224 UID"},
{"read", CmdLFRead, 0, "Read 125/134 kHz LF ID-only tag. Do 'lf read h' for help"},
{"simbidir", CmdLFSimBidir, 0, "Simulate LF tag (with bidirectional data transmission between reader and tag)"},
{"simman", CmdLFSimManchester, 0, "<Clock> <Bitstream> [GAP] Simulate arbitrary Manchester LF tag"},
{"snoop", CmdLFSnoop, 0, "['l'|'h'|<divisor>] [trigger threshold]-- Snoop LF (l:125khz, h:134khz)"},
-- {"ti", CmdLFTI, 1, "{ TI RFIDs... }"},
-- {"hitag", CmdLFHitag, 1, "{ Hitag tags and transponders... }"},
{"vchdemod", CmdVchDemod, 1, "['clone'] -- Demodulate samples for VeriChip"},
-- {"t55xx", CmdLFT55XX, 1, "{ T55xx RFIDs... }"},
-- {"pcf7931", CmdLFPCF7931, 1, "{PCF7931 RFIDs...}"},
{NULL, NULL, 0, NULL}
};
\r
static int CmdHelp(const char *Cmd);\r
\r
++/*\r
++FSK1 / FSK1a\r
++size = fskdemod(dest, size, 32, 0, 8, 10); // fsk1 RF/32 \r
++size = fskdemod(dest, size, 32, 1, 8, 10); // fsk1a RF/32 \r
++\r
++FSK2 / FSK2a\r
++size = fskdemod(dest, size, 32, 0, 10, 8); // fsk2 RF/32 \r
++size = fskdemod(dest, size, 32, 1, 10, 8); // fsk2a RF/32 \r
++size = fskdemod(dest, size, 50, 1, 10, 8); // fsk2a RF/50 \r
++size = fskdemod(dest, size, 64, 1, 10, 8); // FSK2a RF/64 \r
++\r
++*/\r
+ \r
int CmdReadBlk(const char *Cmd)\r
{\r
- int Block = 8; //default to invalid block\r
- UsbCommand c;\r
+ int invert = 0;\r
+ int clk = 0;\r
+ int block = -1;\r
+ int password = 0xFFFFFFFF; //default to blank Block 7\r
+ int errCnt;\r
+ size_t bitlen;\r
+ int maxErr = 100;\r
+ //uint8_t askAmp = 0;\r
+ uint32_t blockData;\r
+ uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0x00};\r
+ \r
+ \r
+ char cmdp = param_getchar(Cmd, 0);\r
+ if (cmdp == 'h' || cmdp == 'H') {\r
+ usage_t55xx_rd();\r
+ return 0;\r
+ }\r
\r
- sscanf(Cmd, "%d", &Block);\r
+ int res = sscanf(Cmd, "%d %x", &block, &password);\r
\r
- if (Block > 7) {\r
- PrintAndLog("Block must be between 0 and 7");\r
- return 1;\r
- } \r
+ if ( res < 1 || res > 2 ){\r
+ usage_t55xx_rd();\r
+ return 1;\r
+ }\r
+ \r
+ if ((block < 0) | (block > 7)) {\r
+ PrintAndLog("Block must be between 0 and 7");\r
+ return 1;\r
+ } \r
\r
- PrintAndLog("Reading block %d", Block);\r
+ UsbCommand c = {CMD_T55XX_READ_BLOCK, {0, block, 0}};\r
+ c.d.asBytes[0] = 0x0; \r
\r
- c.cmd = CMD_T55XX_READ_BLOCK;\r
- c.d.asBytes[0] = 0x0; //Normal mode\r
- c.arg[0] = 0;\r
- c.arg[1] = Block;\r
- c.arg[2] = 0;\r
- SendCommand(&c);\r
- return 0;\r
-}\r
+ //Password mode\r
+ if ( res == 2 ) {\r
+ c.arg[2] = password;\r
+ c.d.asBytes[0] = 0x1; \r
+ }\r
\r
-int CmdReadBlkPWD(const char *Cmd)\r
-{\r
- int Block = 8; //default to invalid block\r
- int Password = 0xFFFFFFFF; //default to blank Block 7\r
- UsbCommand c;\r
+ SendCommand(&c);\r
+ if ( !WaitForResponseTimeout(CMD_ACK,NULL,1500) ) {\r
+ PrintAndLog("command execution time out");\r
+ return 2;\r
+ }\r
+ \r
+ CmdSamples("12000");\r
\r
- sscanf(Cmd, "%d %x", &Block, &Password);\r
+ bitlen = getFromGraphBuf(bits);\r
+ \r
+ //errCnt = askrawdemod(bits, &bitlen, &clk, &invert, maxErr, askAmp);\r
+ errCnt = askmandemod(bits, &bitlen, &clk, &invert, maxErr);\r
+ \r
+ //throw away static - allow 1 and -1 (in case of threshold command first)\r
+ if ( errCnt == -1 || bitlen < 16 ){ \r
+ PrintAndLog("no data found");\r
+ if (g_debugMode) \r
+ PrintAndLog("errCnt: %d, bitlen: %d, clk: %d, invert: %d", errCnt, bitlen, clk, invert);\r
+ return 3;\r
+ }\r
+ if (g_debugMode) \r
+ PrintAndLog("Using Clock: %d - invert: %d - Bits Found: %d", clk, invert, bitlen);\r
\r
- if (Block > 7) {\r
- PrintAndLog("Block must be between 0 and 7");\r
- return 1;\r
- } \r
+ //move bits back to DemodBuffer\r
+ setDemodBuf(bits, bitlen, 0);\r
+ printBitStream(bits,bitlen);\r
+ \r
+ // bits has the manchester encoded data.\r
+ errCnt = manrawdecode(bits, &bitlen); \r
+ if ( errCnt == -1 || bitlen < 16 ){ \r
+ PrintAndLog("no data found");\r
+ if (g_debugMode) \r
+ PrintAndLog("errCnt: %d, bitlen: %d, clk: %d, invert: %d", errCnt, bitlen, clk, invert);\r
+ return 4;\r
+ }\r
\r
- PrintAndLog("Reading block %d with password %08X", Block, Password);\r
+ blockData = PackBits(1, 32, bits);\r
\r
- c.cmd = CMD_T55XX_READ_BLOCK;\r
- c.d.asBytes[0] = 0x1; //Password mode\r
- c.arg[0] = 0;\r
- c.arg[1] = Block;\r
- c.arg[2] = Password;\r
- SendCommand(&c);\r
- return 0;\r
+ if ( block < 0)\r
+ PrintAndLog(" Decoded : 0x%08X %s", blockData, sprint_bin(bits+1,32) );\r
+ else\r
+ PrintAndLog(" Block %d : 0x%08X %s", block, blockData, sprint_bin(bits+1,32) );\r
+ \r
+ return 0;\r
}\r
\r
int CmdWriteBlk(const char *Cmd)\r