]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge branch 'master' of https://github.com/Proxmark/proxmark3
authoriceman1001 <iceman@iuse.se>
Thu, 12 Feb 2015 08:54:21 +0000 (09:54 +0100)
committericeman1001 <iceman@iuse.se>
Thu, 12 Feb 2015 08:54:21 +0000 (09:54 +0100)
Conflicts:
armsrc/epa.c

1  2 
armsrc/epa.c
armsrc/iso14443a.h
client/Makefile
client/cmdlf.c
client/cmdlft55xx.c

diff --cc armsrc/epa.c
index 7bff9f1987082b511524a36cea10634ae5e98629,0006d59d01c03fd4944caefef829771b1b8068fc..86f7c864d904d4dde9fe0d39e4a43ff449cce782
@@@ -433,11 -422,7 +429,9 @@@ int EPA_Setup(
  
        // 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) {
Simple merge
diff --cc client/Makefile
index fcbd4d7ca1e3c27398fd442c56df74aa7b5ec4c7,e63581ba1ff864520167f5406c96b7dcf53dbe23..48a18c94b39f8ee7d70691065e812b0693695fc8
@@@ -12,9 -12,9 +12,9 @@@ CXX=g+
  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
@@@ -146,6 -137,6 +146,17 @@@ clean
  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)
diff --cc client/cmdlf.c
index b7c1b13f75e8a61ee7766b75d8265bbb0cbbd7ee,b7c1b13f75e8a61ee7766b75d8265bbb0cbbd7ee..136b05334a5e0446a6be3e7cf15decea79d15ecb
@@@ -756,12 -756,12 +756,18 @@@ int CmdLFfind(const char *Cmd
  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}
  };
  
index 4ac466d199cae0fb85b5925d610476f79862fb85,a719c7ad7a56e4a6216e910aa4d28cad3069007d..b060bdee83b94aaa829b06b43a31ccff51b1d3e1
@@@ -76,91 -20,52 +76,104 @@@ int usage_t55xx_dump()
  \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
Impressum, Datenschutz