Commit graph

2394 commits

Author SHA1 Message Date
pwpiwi 7a53739728 fixing some fpga and iclass issues
* make fpga_version_info.c phony and delete it on 'make clean'
* wait for transfer to complete before returning from FpgaSendCommand()
* log correct tag times in iclass simulation
* shorten pulse from TC1 to TC0 in StartCountSspClk()
* shorten ssp_frame pulse in fpga/hi_reader.v
* some reformatting and whitespace fixes
2020-03-31 08:39:16 +02:00
pwpiwi bedae7768c
Merge pull request #913 from 0x2b3bfa0/patch-1
Fix #912: ukbhit() false positive
2020-02-13 08:37:17 +01:00
Helio Machado 8f831ceb0b Fix #912 2020-02-09 18:04:46 +01:00
pwpiwi d6e1d48284
Merge pull request #910 from pwpiwi/small_USB_response
Improve USB communications
2020-02-06 21:49:15 +01:00
pwpiwi df7b80fecc fix WaitForResponse (without timeout) 2020-02-06 07:59:18 +01:00
pwpiwi 01aa068b6f reenable intermediate "Waiting for a response from the proxmark..." message 2020-02-04 08:21:17 +01:00
pwpiwi 3458bb279b replace msleep() by thread signalling in comms.c 2020-01-27 14:55:40 -05:00
pwpiwi d2ca5dbfe8 uart_posix.c rework
* added some LED handling in appmain.c (helped with debugging)
* finally replaced the infamous device unlink by msleep(1000)
* fixed some format strings in comms.c (with -DCOMMS_DEBUG)
* made uart_receive() and uart_send() behave as described in header
* some formating
2020-01-27 14:14:40 -05:00
pwpiwi fd66752193 cleaning up uart_posix.c
* whitespace fixes
* sorting out #includes
2020-01-24 03:24:39 -05:00
pwpiwi ac37ee816b Add missing includes 2020-01-23 17:02:33 -05:00
pwpiwi 929b61c670 Always enable fast response mode (was enabled for flasher only)
* ensure that CMD_ACK is used exclusively for the very last response of each PM3 operation. All Dbprintf() must be before.
* always switch off field before exiting
* append null packet for USB transfers % 64 bytes
* reformatting and whitespace fixes
2020-01-23 22:18:51 +01:00
pwpiwi b8ed9975e5 modify USB communications
* use different data types for commands and responses
* use variable length responses
* maintain client/flasher compatibility with old format (e.g. when using old bootloader)
* maintain bootloader compatibility with old format (e.g. when using old or RRG flasher.exe)
* fix length of version string in appmain.c
2020-01-17 09:31:14 +01:00
pwpiwi 867e10a5fd usb communication (device side) refactoring
* merge cmd.c into usb_cdc.c
* move back usb_cdc.[ch] to common/
* declare low level functions usb_read() and usb_write() and more functions as static
* use cmd_receive() in bootrom.c and appmain.c
* remove unused memory wasting csrTab[100] in usb_cdc.c
* replace more byte_t by uint8_t
* more whitespace fixes
2020-01-15 18:49:28 +01:00
pwpiwi 72622d6429 usb communication (device side) housekeeping
* move cmd.[ch] and usb_cdc.[ch] to armsrc
* sorting out #includes
* replace byte_t by uint8_t
* some reformatting
* whitespace fixes
* (no functional changes)
2020-01-15 18:46:09 +01:00
pwpiwi d00a30d56f
Merge pull request #909 from pwpiwi/fix_button_break
Fix "Sending bytes to proxmark failed" with BUTTON_PRESS()
2020-01-15 18:31:56 +01:00
pwpiwi 6b34699adc fix "Sending bytes to proxmark failed" after BUTTON_PRESS() 2020-01-10 08:45:45 +01:00
pwpiwi 1d04b933df appmain.c cleanup
* reformatting
* whitespace fixes
* replace byte_t by uint8_t
2020-01-10 08:21:07 +01:00
pwpiwi a749b1e58b
speedup 'hf mf chk' (#901)
* add separate timeout for tag response to nr_ar
* measure response time and use it for response timeout
* don't drop field between keyblocks
* some reformatting
* some whitespace fixes
* fishing for microseconds in TransmitFor14443a()
* allow arbitrary number of keys in MifareChkKeys()
* and move progress printing to MifareChkKeys()

Co-authored-by: uzlonewolf <github_com@hacker-nin.com>
2020-01-09 15:42:31 +01:00
pwpiwi f0c48553cb
fix hf search (#908)
* fix memory access violation in HF14B_Other_Reader()
2020-01-07 22:33:55 +01:00
pwpiwi fef3084ec2
fix gcc8 compiler warnings on string overflows (#905) 2020-01-03 07:17:21 +01:00
pwpiwi a4ff62be63
fix 'hf iclass writebl' and 'hf iclass clone' (#896)
* check for correct responses after block updates
* reduce number of tries from 10 to 3
* Allow to override warning on attempt to clone blocks < 5
* add same warning and override option to 'hf iclass writebl'
* some reformatting and minor refactoring
* Drop field after dump and clone functions
* If dumping AA1 with Credit Key, authenticate as Debit Key
* Initialize reader when beginning to clone
2019-12-28 17:03:20 +01:00
Phil 1d4b67cb3d "hf mf ekeyprn d" doesn't works properly (#904)
FIX: command "hf mf ekeyprn  d" doesn't use the correct offset to locate the A key in data[] array and record the 2 last bytes followed by 4 0x00 instead of the 6 good bytes (All the A keys are corrupted in file dumpkeys.bin). B keys are not affected.
2019-12-28 14:04:46 +01:00
uzlonewolf 5a03ea993f Nested loop fix for static nonces
* add detection of static tag nonces
* add tag nonce to error message
* modify mfCheckKeys() to pass button press events upstream
* don't abort nested when a static nonce is encountered
* modify nested to try multiple keys in a single operation
* Print keys remaining only every 10 seconds, and add estimated worst-case time
2019-12-23 16:08:23 +01:00
pwpiwi 1f4789fe53
fix 'hf 15 csetuid' (#890)
* fix 'hf 15 csetuid'
* check for error codes, prevent client crash
* some include file refactoring
* some whitespace fixes
* allow longer timeout for write commands
* add function to send EOF only
* modify 'hf list 15' to display "<EOF>"
* add tracing of Reader commands
* if REQ_OPTION is set on write commands, send separate EOF to request tag response
* use #defines instead of hex constants
* switch off field after UID update
* return last tag response (if there is any)
* iso15693: decode WRITE_MULTI_BLOCK in 'hf list 15'
2019-12-20 08:25:14 +01:00
pwpiwi e73c9f1bd4
fix 'hf iclass chk' (#894)
* Check for Credidt Keys as well
* reduce authentication tries from 6 to 3
* correct text in 'hf iclass clone' for 'l' parameter
* some reformatting and whitespace fixes
2019-12-09 08:27:42 +01:00
grauerfuchs 763d1befc1 Bugfix: Output typing on print of HID card formats (#895)
* Bugfix: Output typing on print of HID card formats

The 'PrintAndLog' calls were using signed types and sometimes too few bits in width for formatting/outputting the data as was revealed in the forums. This commit will correct the printf-formatted output typing on display of the fields.

* Update hidcardformats.c

Updated to use macros as requested by @pwpiwi
2019-12-06 16:06:24 +01:00
pwpiwi 28ae37b746
fix 'hf iclass replay' (#888)
* implement option -n for authentication with replayed NR/MAC pairs in 'dump' and 'readbl'
* delete 'hf iclass replay'
2019-12-04 18:34:53 +01:00
pwpiwi 00848e096b
Hitag fixes (#887)
* don't display error message during 'lf search' when no Hitag tag is present
* remove superfluous options in 'lf hitag read'
* fix setting of default threshold when selecting FPGA_CMD_SET_EDGE_DETECT_THRESHOLD major mode
* some refactoring
2019-11-25 08:38:23 +01:00
pwpiwi e938f71011
Merge pull request #884 from pwpiwi/fix_iclass_snoop
* determine and write meaningful times into trace
* code deduplication: use ISO15693 snoop function
* speed up SnoopIso15693(), reduce DMA buffer size
* add jamming option '-j' to 'hf iclass snoop'
* fix issue #882
* whitespace fixes
* make room for one more bit for FPGA minor mode
* new mode FPGA_HF_READER_MODE_SEND_JAM
* implement jamming in Handle15693SampleFromReader
2019-11-19 18:11:26 +01:00
pwpiwi cd028159be implement 'hf iclass snoop -j'
* fix long option --jam
* make room for one more bit for FPGA minor mode
* new mode FPGA_HF_READER_MODE_SEND_JAM
* implement jamming in Handle15693SampleFromReader
2019-11-13 18:03:40 +01:00
pwpiwi be09ea8603 fix 'hf iclass snoop'
* code deduplication: use ISO15693 snoop function
* speed up SnoopIso15693(), reduce DMA buffer size
* add jamming option '-j' to 'hf iclass snoop'
* fix issue #882
* whitespace fixes
2019-11-13 18:03:39 +01:00
pwpiwi 1ce689684f fix 'hf iclass snoop'
* 'hf 15 snoop': determine and write meaningful times into trace
2019-11-13 18:03:37 +01:00
pwpiwi d3bcdbdabf
mod 'hf list' (#881)
* switch to argtable command line parsing (i.e. options must now be preceded by '-')
* add option '-r' to display relative times
* add option '-u' to display times in microseconds
* fix: graceful exit if trace is requested from offline PM3
2019-11-13 18:00:51 +01:00
pwpiwi 496bb4be33
fix 'hf iclass' (#879)
* add loooong timeout for UPDATE command
* add flags FLAG_ICLASS_READER_INIT and FLAG_ICLASS_READER_CLEARTRACE
* don't overwrite trace buffer during 'hf iclass dump'
* fix long waiting time when start_time==0 in TransmitTo15693Tag()
* remove some additional debug prints
* refactoring: move helper functions from protocols.c to cmdhficlass.c
* add 'h' and '1' options to 'hf iclass reader' (from RRG repository)
* use correct key when only CreditKey is given in 'hf iclass dump'
* separate select_and_auth
* DropField() on errors
* dump last block in 'hf iclass dump'
* display correct memory size (number of blocks) in 'hf iclass reader' and dump
* more whitespace fixes
2019-11-13 18:00:33 +01:00
pwpiwi ea5e5d042e
fix 'hf 14b sriwrite' (#880) 2019-11-05 11:43:03 +01:00
pwpiwi e55b441992
Merge pull request #876 from pwpiwi/fix_iclass_reader
fix 'hf iclass reader'
* code deduplication. Use functions from iso15693.c
* speedup CodeIso15693AsReader()
* invert reader command coding. 0 now means 'unmodulated' ( = field on)
* decode SOF only as a valid tag response in Handle15693SamplesFromTag()
* complete decoding of EOF in Handle15693SamplesFromTag()
* determine and write correct times to trace
* FPGA-change: generate shorter frame signal to allow proper sync in StartCountSspClk()
* modify StartCountSspClk() for 16bit SSC transfers
* whitespace in util.c
* add specific LogTrace_ISO15693() with scaled down duration. Modify cmdhflist.c accordingly.
* allow 'hf 15 raw' with single byte commands
* check for buffer overflow, card timeout and single SOF in 'hf 15 raw'
* decode and handle SOF only responses in Handle14443bSamplesDemod()
* allow 1 byte commands with 'hf 14b raw'
* don't do READCHECK when not trying to authenticate
* standard LED handling
* remove unused FLAG_ICLASS_READER_ONLY_ONCE and FLAG_ICLASS_READER_ONE_TRY
* sanity check for negative times in TransmitTo15693Tag()
* increase reader timeout for 'hf 15' functions to be enough for slot 7 answers to ACTALL
* add 'hf iclass permute' inspired by RRG repository
* whitespace in cmdhficlass.c
2019-10-30 18:55:13 +01:00
pwpiwi ece38ef311 fix 'hf iclass reader' and 'hf iclass readblk'
* don't do READCHECK when not trying to authenticate
* standard LED handling
* remove unused FLAG_ICLASS_READER_ONLY_ONCE and FLAG_ICLASS_READER_ONE_TRY
* sanity check for negative times in TransmitTo15693Tag()
* increase reader timeout for 'hf 15' functions to be enough for slot 7 answers to ACTALL
* add 'hf iclass permute' inspired by RRG repository
* whitespace fixes
2019-10-27 17:32:22 +01:00
pwpiwi a3bef9863b iso14443b: trying to approach iClass
* decode and handle SOF only responses in Handle14443bSamplesDemod()
* allow 1 byte commands with 'hf 14b raw'
2019-10-23 09:09:13 +02:00
pwpiwi a334de73d2 'hf 14b' formatting
* renaming a few functions
* whitespace
* moving a bit towards RRG repo
2019-10-22 21:02:02 +02:00
pwpiwi c41dd5f9f6 fix 'hf iclass reader'
* code deduplication. Use functions from iso15693.c
* speedup CodeIso15693AsReader()
* invert reader command coding. 0 now means 'unmodulated' ( = field on)
* decode SOF only as a valid tag response in Handle15693SamplesFromTag()
* complete decoding of EOF in Handle15693SamplesFromTag()
* determine and write correct times to trace
* FPGA-change: generate shorter frame signal to allow proper sync in StartCountSspClk()
* modify StartCountSspClk() for 16bit SSC transfers
* whitespace in util.c
* add specific LogTrace_ISO15693() with scaled down duration. Modify cmdhflist.c accordingly.
* allow 'hf 15 raw' with single byte commands
* check for buffer overflow, card timeout and single SOF in 'hf 15 raw'
2019-10-21 21:48:08 +02:00
pwpiwi b41be3cb11
Merge pull request #862 from pwpiwi/fix_iclass_sim
fix hf iclass sim:
* sim 2: add responses to read(1) (Config) and read(5) (AIA)
* sim 2/3: don't restrict CC to 00 bytes only
* sim 3: add responding to read block commands
* sim 2/3: add responding to READ_CHECK_KC
* fix sizes of pre-encoded tag answers
* sim 2: change default card challenge
* remove commented code
* use #defines instead of numerical constants for simulation modes
* some reformatting and whitespace fixes
* fix debug print on unhandled commands
* deduplicate: use sim functions from iso15693.c
* fix times in tracelog and 'hf list iclass' (sim only)
* don't check parity in 'hf list iclass'
* fix timing in TransmitTo15693Reader()
* add simulation of block 3 and 4 (Kd and Kc) reads
* add simulation of READ4 (4 blocks read)
* FPGA change (hi_simulate.v): avoid spp_clk phase changes
* chg to reader command decoder in iso15693.c (require no modulation before SOF)
* add 'has_been_low_for' logic to hi_simulate.v (same as in other FPGA modes, default to "no modulation")
* add simulation of chip status (IDLE, ACTIVE, SELECTED, HALTED)
* check ACSN on SELECT
* add simulation of RESELECT
* always check length of reader commands
* fix printing of NR, MAC in sim 2 mode
* fix response length to CHECK command
* implement UPDATE and CHECK[Kc]
* add simulation of multiple pages (PAGESEL by @sherhannn9)
* maintain cipher states per page
* update cipher state after UPDATE commands (@sherhannn9)
* add simulation of personalization mode
* respond with SOF on HALT
* display "\<SOF\>" instead of "0f" in 'hf list iclass'
* standard LED handling
* speedup CodeIso15693AsTag()
* TransmitTo15693Tag(): don't send unmodulated start of SOF
* reduce modulation depth in hi_simulate.v
2019-10-21 21:25:44 +02:00
Iceman 3fb6e1fa40
Merge pull request #873 from quantum-x/patch-2
Update README.md
2019-10-08 14:47:17 +02:00
quantum-x 5eacacfd9a
Update README.md
Updated as per PR discussion thead
2019-10-08 14:40:11 +02:00
quantum-x a534629505
Update README.md
Updated reference to Lab401 as an EU reseller, not a HK reseller.
2019-10-08 13:24:25 +02:00
pwpiwi f31b4cd888 Merge branch 'master' into fix_iclass_sim 2019-10-08 11:54:22 +02:00
pwpiwi f784539dfb
fix iclass reader functions
* remove unused CMD_ICLASS_READCHECK
* fix wrong command coding in CodeIClassCommand()
* switch field off at end of commands to avoid RDV4 overheating
2019-10-08 11:48:49 +02:00
pwpiwi 8efd0b80f2 fix 'hf iclass sim'
* fix tag response timing. iClass differs from ISO15693 in this respect.
* speedup CodeIso15693AsTag()
* TransmitTo15693Tag(): don't send unmodulated start of SOF
* reduce modulation depth in hi_simulate.v
* calculate CRC for configuration block when simulating
* Show real response time instead of planned response time in 'hf list iclass'
2019-10-08 11:04:30 +02:00
pwpiwi ae60ceca92 fix 'hf iclass sim'
* add simulation of multiple pages (PAGESEL by @sherhannn9)
* maintain cipher states per page
* update cipher state after UPDATE commands (@sherhannn9)
* add simulation of personalization mode
* respond with SOF on HALT
* display "<SOF>" instead of "0f" in 'hf list iclass'
* standard LED handling
2019-10-02 08:20:17 +02:00
pwpiwi 26d0156a46
fix 'hf iclass eload' (thanks to @sherhannn79) 2019-09-30 07:29:20 +01:00
pwpiwi 8ddb81a217 fix 'hf iclass sim':
* implement CHECK[Kc] based on @sherhannn79
* implement UPDATE based on @sherhannn79
2019-09-25 18:40:05 +02:00