]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge branch 'master' of https://github.com/Proxmark/proxmark3
authoriceman1001 <iceman@iuse.se>
Tue, 10 Mar 2015 08:18:35 +0000 (09:18 +0100)
committericeman1001 <iceman@iuse.se>
Tue, 10 Mar 2015 08:18:35 +0000 (09:18 +0100)
Conflicts:
client/cmddata.c
client/cmddata.h

1  2 
armsrc/appmain.c
armsrc/apps.h
armsrc/iso14443a.c
armsrc/lfops.c
client/cmddata.c
client/cmddata.h
client/cmdlf.c
client/lualibs/commands.lua
include/usb_cmd.h

Simple merge
diff --cc armsrc/apps.h
index dc8a9c935f29a569f34de3877e010e7fdcba19ef,928a3075f44391c80e51f9ffc1f6d511225aa2ce..3fe8acaece373079feaf6286b97bcf65bc7e7ecc
@@@ -118,10 -116,11 +118,13 @@@ void ReadTItag(void)
  void WriteTItag(uint32_t idhi, uint32_t idlo, uint16_t crc);
  void AcquireTiType(void);
  void AcquireRawBitsTI(void);
 -void SimulateTagLowFrequency(int period, int gap, int ledcontrol);
 +void SimulateTagLowFrequency( uint16_t period, uint32_t gap, uint8_t ledcontrol);
 +//void SimulateTagLowFrequencyA(int period, int gap);
 +
  void CmdHIDsimTAG(int hi, int lo, int ledcontrol);
+ void CmdFSKsimTAG(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream);
+ 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 CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol);
  void CmdEM410xdemod(int findone, int *high, int *low, int ledcontrol);
  void CmdIOdemodFSK(int findone, int *high, int *low, int ledcontrol);
index f2fa1ff29e3e766ad1581dfaca5304cecb088689,f2fa1ff29e3e766ad1581dfaca5304cecb088689..fe5533e09440846f4ac254cf04e19282e403f06f
@@@ -2301,8 -2301,8 +2301,6 @@@ void Mifare1ksim(uint8_t flags, uint8_
                } 
                if(cardSTATE == MFEMUL_NOFIELD) continue;
  
--              //Now, get data
--
                res = EmGetCmd(receivedCmd, &len, receivedCmd_par);
                if (res == 2) { //Field is off!
                        cardSTATE = MFEMUL_NOFIELD;
                                uint32_t nr = bytes_to_num(&receivedCmd[4], 4);
  
                                //Collect AR/NR
--                              if(ar_nr_collected < 2){
++                              if(ar_nr_collected < 2 && cardAUTHSC == 2){
                                        if(ar_nr_responses[2] != ar)
                                        {// Avoid duplicates... probably not necessary, ar should vary. 
                                                ar_nr_responses[ar_nr_collected*4] = cuid;
                                                ar_nr_responses[ar_nr_collected*4+2] = ar;
                                                ar_nr_responses[ar_nr_collected*4+3] = nr;
                                                ar_nr_collected++;
++                                      }                                               
++                                      // Interactive mode flag, means we need to send ACK
++                                      if(flags & FLAG_INTERACTIVE && ar_nr_collected == 2)
++                                      {
++                                              finished = true;
                                        }
                                }
  
                                        mf_crypto1_encrypt(pcs, response, 18, response_par);
                                        EmSendCmdPar(response, 18, response_par);
                                        numReads++;
--                                      if(exitAfterNReads > 0 && numReads == exitAfterNReads) {
++                                      if(exitAfterNReads > 0 && numReads >= exitAfterNReads) {
                                                Dbprintf("%d reads done, exiting", numReads);
                                                finished = true;
                                        }
        if(flags & FLAG_INTERACTIVE)// Interactive mode flag, means we need to send ACK
        {
                //May just aswell send the collected ar_nr in the response aswell
--              cmd_send(CMD_ACK,CMD_SIMULATE_MIFARE_CARD,0,0,&ar_nr_responses,ar_nr_collected*4*4);
++              cmd_send(CMD_ACK,CMD_SIMULATE_MIFARE_CARD,1,0,&ar_nr_responses,ar_nr_collected*4*4);
        }
  
--      if(flags & FLAG_NR_AR_ATTACK)
++      if(flags & FLAG_NR_AR_ATTACK && MF_DBGLEVEL >= 1 )
        {
--              if(ar_nr_collected > 1) {
++              if(ar_nr_collected > 1 ) {
                        Dbprintf("Collected two pairs of AR/NR which can be used to extract keys from reader:");
                        Dbprintf("../tools/mfkey/mfkey32 %08x %08x %08x %08x %08x %08x",
                                        ar_nr_responses[0], // UID
                                        );
                } else {
                        Dbprintf("Failed to obtain two AR/NR pairs!");
--                      if(ar_nr_collected >0) {
++                      if(ar_nr_collected > 0 ) {
                                Dbprintf("Only got these: UID=%08x, nonce=%08x, AR1=%08x, NR1=%08x",
                                                ar_nr_responses[0], // UID
                                                ar_nr_responses[1], //NT
diff --cc armsrc/lfops.c
Simple merge
index 8b29dc9c989d6b8e10792c373491915a56d324f5,95c7dc87bc2df5a46758ec7fbbaf383d3aa38c2a..cea3bcfee9a7b4c46182d1c3cfc66ef0778603f3
@@@ -884,8 -1033,9 +1039,9 @@@ int FSKrawDemod(const char *Cmd, bool v
      if(size > (8*32)+2) size = (8*32)+2; //only output a max of 8 blocks of 32 bits  most tags will have full bit stream inside that sample size
      if (verbose) {
        PrintAndLog("FSK decoded bitstream:");
 -      printBitStream(BitStream,size);
 +    printBitStream(BitStream,size);
      }
      return 1;
    } else{
      if (verbose) PrintAndLog("no FSK data found");
@@@ -1634,11 -1788,11 +1795,11 @@@ int NRZrawDemod(const char *Cmd, bool v
      PrintAndLog("# Errors during Demoding (shown as 77 in bit stream): %d",errCnt);
    }
    if (verbose) {
 -    PrintAndLog("NRZ demoded bitstream:");
 -    // Now output the bitstream to the scrollback by line of 16 bits
 -    printDemodBuff();
 +  PrintAndLog("NRZ demoded bitstream:");
 +  // Now output the bitstream to the scrollback by line of 16 bits
 +  printDemodBuff();
    }
-   return 1;
+   return 1; 
  }
  
  int CmdNRZrawDemod(const char *Cmd)
index c7dbf29758211622a6d54610e906ec609dabbc66,6866bcb126b82662766c691e5deea61782c38572..48bd0d91c2e8035a21efad7ccbfdbf024e8ccd47
  command_t * CmdDataCommands();
  
  int CmdData(const char *Cmd);
+ void printDemodBuff(void);
+ void printBitStream(uint8_t BitStream[], uint32_t bitLen);
  void setDemodBuf(uint8_t *buff, size_t size, size_t startIdx);
- void printDemodBuff();
 +
  int CmdAmp(const char *Cmd);
  int Cmdaskdemod(const char *Cmd);
  int CmdAskEM410xDemod(const char *Cmd);
diff --cc client/cmdlf.c
index 849b96efdabff4deecb7d9f8cfd20a2025c63c80,79d6787bdee601a4abf49d5accb49288ffaa4460..9d62b2a886d35d3b1e7af62109cbdb1854b034f2
@@@ -777,10 -1119,17 +1130,13 @@@ static command_t CommandTable[] 
    {"read",        CmdLFRead,          0, "Read 125/134 kHz LF ID-only tag. Do 'lf read h' for help"},
    {"search",      CmdLFfind,          1, "[offline] ['u'] Read and Search for valid known tag (in offline mode it you can load first then search) - 'u' to search for unknown tags"},
    {"sim",         CmdLFSim,           0, "[GAP] -- Simulate LF tag from buffer with optional GAP (in microseconds)"},
+   {"simask",      CmdLFaskSim,        0, "[clock] [invert <1|0>] [manchester/raw <'m'|'r'>] [msg separator 's'] [d <hexdata>] -- Simulate LF ASK tag from demodbuffer or input"},
+   {"simfsk",      CmdLFfskSim,        0, "[c <clock>] [i] [H <fcHigh>] [L <fcLow>] [d <hexdata>] -- Simulate LF FSK tag from demodbuffer or input"},
+   {"simpsk",      CmdLFpskSim,        0, "[1|2|3] [c <clock>] [i] [r <carrier>] [d <raw hex to sim>] -- Simulate LF PSK tag from demodbuffer or input"},
    {"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"},
+   //{"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 6f309001da3b31dd96af6627f4c57dc103db788c,ad8f6e00c64ac44b1f7f7985051324a369b1bdf6..ef9b8f18a447cc4c24dabec2db202de9e970e1ef
@@@ -212,6 -217,7 +217,6 @@@ function Command:getBytes(
        local data  = self.data
        local cmd = self.cmd 
        local arg1, arg2, arg3 = self.arg1, self.arg2, self.arg3
 -      
        return bin.pack("LLLLH",cmd, arg1, arg2, arg3,data);
  end
- return _commands
+ return _commands
Simple merge
Impressum, Datenschutz