Oleg Moiseenko [Mon, 8 Oct 2018 05:48:37 +0000 (08:48 +0300)]
Added loading parameters from json to several emv commands (#686)
* added loading params from GPO
* `hf emv pdol` added help and warning
* started `hf emv ac`
* dol calculation implemented in genac and intauth
* help fix
AntiCat [Mon, 8 Oct 2018 05:20:21 +0000 (07:20 +0200)]
osx: fix annoying focus behaviour (#689)
OS X has a global menu bar and a per app dock icon. Therefore, all
GUI applications launched from a terminal will become focused - even
if they don’t show any windows. Thereby the terminal loses focus.
Since is it very annoying to re-focus the terminal after each proxmark
client launch, this change makes the client unfocusable during launch
and restores the regular behaviour when a window is created.
AntiCat [Mon, 8 Oct 2018 05:15:29 +0000 (07:15 +0200)]
osx: disable app-nap during serial comm (#687)
Apple introduced app-nap with OS X 10.10. This feature
saves power by throttling apps running in background.
However, it also less accurate timers in systemcalls. In
our case a 30ms select timeout would take up to 10s.
This patch uses an API also added with 10.10 to disable
app-nap as long as the serial port is polled.
pwpiwi [Sun, 7 Oct 2018 15:32:03 +0000 (17:32 +0200)]
start fixing hf 15: (#684)
* implement a real time Decoder for tag responses (will be required for sniffing)
* switch off field after each command (protect rdv40)
* correctly signal field status with LED D
Oleg Moiseenko [Mon, 1 Oct 2018 18:12:14 +0000 (21:12 +0300)]
modify argtable parser to parse ints with spaces (#683)
* modify argtable parser to parse ints with spaces
* added arg_strx1 and arg_strx0 for x str arguments in one
* added option to clue data in arg parser
* add new argtable logic to emv commands and small fix
* small fix in GPO help
* small GPO fix
* detect and use RDV40 higher voltage ADC channel for hw tune, hf tune, hw detectreader
* fix mode switching in hw detectreader
* detect Smartcard Slot in hw version
* i2c changes from https://github.com/RfidResearchGroup/proxmark3
* some formatting in proxmark3.h
Added loading EMV transaction parameters from json file (#659)
* added default params file
* added jansson
* added test function.
* added tlv tree to function
* add params from json works
* added to `hf emv exec`: load params from json and some refactoring
* added `scan` command
rework iso14443b device functions including FPGA I/Q signal transfer (#669)
* rework iso14443b device functions
* hf_read_rx_xcorr.v: transfer i/q pair in one 16bit frame
* hi_read_tx.v: invert ssp_dout. When nothing is transferred (ssp_dout=0), this results in no modulation (carrier on)
* adjust arm sources accordingly
* iso14443b.c: switch off carrier after hf 14b sri512read and hf 14b srix4kread
* iso14443b.c: fix DMA circular buffer handling
As approved by @0xFFFF on RfidResearchGroup/proxmark3 and provided by @xilni, this commit adds the format into the official repo as well. As I don't have any of the cards available for testing, I have been unable to personally verify the format encodes/decodes as intended.
* FPGA Hi-Simulate: Formatted code
* FPGA Hi-Simulate: Fixed documantation
* FPGA Hi-Simulate: Freed up 4 LUTs
* FPGA Hi-Simulate: Added 212kHz SSP-Clock option
* Legic: Moved card simulator into separate file & cleaned interface.
Reader and card simulation have almost no common code. Moreover the sim
uses an SSP Clock at 212kHz for all timings to prevent any drifting from
the PRNG. This clock speed is not available in reader simulation mode (SSP
runs at up to 3.4MHz, and changes speed between TX and RX). For these
reasons having the code in separate files makes it significantly cleaner.
* Legic: Implemented RX and TX for card simulation
* Legic: Implemented setup phase for card simulation
* Legic: Implemented read command for card simulation
* Legic: Implemented write command for card simulation
* added `hf 14a reader` to source and added functionality to exec empty commands
* added `hf 14a raw`
* added samples to command's help
* added some help
* added changelog
* update to new argtable3 --- https://github.com/argtable/argtable3
* changed included getopt to `https://github.com/freebsd/freebsd/blob/master/include/getopt.h` (getopt from freebsd with simplified BSD license)
grauerfuchs [Fri, 31 Aug 2018 01:01:21 +0000 (21:01 -0400)]
lf hid improvements - encoding and long tag simulation
**DEVICE FIRMWARE UPDATE**
The code changes needed to support long tag emulation required an update to the device firmware. As of this patch, devices running older firmware will not be able to read or emulate HID tags until the firmware is updated. Additionally, devices with the firmware from this update or newer will not properly read or encode HID tags with a prior version client.
The 'lf hid encode' command has been further refined, and is now entirely parameterized to support use of fields other than facility code and card number. The client help data has been updated to show the correct syntax.
grauerfuchs [Tue, 28 Aug 2018 17:34:21 +0000 (13:34 -0400)]
lf hid: Added encode/decode support for Issue Level
Issue Level added to encode/decode support
By default, invalid parity will not show on decode (with option to show)
Added two new 36-bit formats including first format to use issue level
grauerfuchs [Mon, 27 Aug 2018 18:03:46 +0000 (14:03 -0400)]
Redesign of lf hid card format handler as discussed with @marshmellow42
The new handler accepts multiple formats of the same length.
Because of this, the existing pack/unpack commands are unsupported
and have been removed and replaced with 'lf hid encode' and 'lf hid decode'.
The decode command will test a packed Prox ID against all programmed
formats and return results for all matching formats.
The encode command takes the parameter of format name instead of
bit length (as per the old pack command). Additionally, an 'lf hid write'
command has been added as a single-command combination of encode and clone.
To support easier addition of new formats, a library for handling card
fields has been added. This will allow direct access to the card bits,
to linear fields, and to non-linear (jumping) fields in a single line
of code without having to resort to managing bit positions or masks
on the underlying data. A number of new formats have been added as working
examples of the new support functions.
AntiCat [Mon, 20 Aug 2018 20:29:34 +0000 (22:29 +0200)]
Legic: rewrite reader to use xcorrelation and precise timing (#654)
* Legic: rewrite reader to use xcorrelation and precise timing
- Even tough Legic tags transmit just AM, receiving using
xcorrelation results in a significantly better signal
quality.
- Switching from bit bang to a hardware based ssc frees
up CPU time for other tasks e.g. prng and demodulation
- Having all times based on a fixed ts, results in perfect
rwd-tag synchronization without magic +/- calculations.
* hi_read_tx: remove jerry-riged hysteresis based receiver
- This feature got obsolete by a x-correlation based receiver.
* Legic: adjusted sampling to new ssp clock speed
- Sampling is 4 times faster and pipeline daly reduced to 1/4.
The new code samples each bit earyler to account for the
shorter pipeline. That introduced bit errors by leeking the
next bit into the current one.
* Legic: average 8 samples for better noise rejection.
* Update CHANGELOG.md
grauerfuchs [Sun, 19 Aug 2018 15:14:52 +0000 (11:14 -0400)]
Adding native support for HID long-format
Removal of "l" flag for long writes; not needed anymore.
Added HID Corporate 1000 48-bit format to known formats list
Simulation not yet updated; need to modify ARM commands to support it
Completed parity support on all included HID formats
pwpiwi [Wed, 15 Aug 2018 12:03:20 +0000 (14:03 +0200)]
ISO15693 device side improvements (#652)
* ISO15693 device side improvements
* increase accuracy by doubling the sample frequency (hi_read_rx_xcorr.v)
* adjust armsrc/iso15693.c and client/cmdhf15.c accordingly
* use more accurate approximation for sqrt(ci^2 + cq^2)
* improve EOF detection (was often mistaken for Logic0, resulting in "error, uneven octet! (extra bits!)")
* hi_read_r_xcorr.v: avoid overflows during accumulation and truncation
* explicitely cast unsigned ADC samples to signed
AntiCat [Tue, 14 Aug 2018 07:24:02 +0000 (09:24 +0200)]
fix: 32bit tick timer based on TC0 and TC1 (#653)
TC1 counts the number of TC0 overflows (carry bits).
In random conditions TC1 would return or stay at zero,
instead of counting up. This due to the behavior of the
reset signal.
SAM7S Series Datasheet, 33.5.6 Trigger:
Regardless of the trigger used, it will be taken into account
at the following active edge of the selected clock. This means
that the counter value can be read differently from zero just
after a trigger, especially when a low frequency signal is
selected as the clock.
The new code first prepares TC1 and asserts TC1 trigger and
then prepares TC0 and asserts TC0 trigger. The TC0 start-up
will reset TC1.
pwpiwi [Sun, 5 Aug 2018 16:15:03 +0000 (18:15 +0200)]
mod hw version: (#631)
* create fpga version info at compile time (by additional functionality in fpgacompress)
* remove hw version caching (prepare USB reconnect)
* fix calculation of available compressed bytes in fpga_loader.c
* These are used to pack and unpack the bit length, facility code and card number from "short" HID Prox IDs.
* This also simplifies some repeated code that is used to parse hex digits in lfhid, and adds basic client-side validation to the `lf hid clone` and `lf hid sim` commands, for when an ID that is too long is entered.
* Implements parity checks/calculation for 26-bit H10301 cards.
* Adds links to useful resources for HID Prox cards.
* Adds an explicit warning about the lack of parities on non-26-bit cards.
* Changes all the examples to use 26-bit IDs that have a parity bit set.
pwpiwi [Sun, 3 Jun 2018 12:25:20 +0000 (14:25 +0200)]
USB comms: part 4 towards @micolous PR #463
* make uart_communication(), storeCommand() and getCommand() static in comms.c
* move receiver thread creation and respective mutexes to comms.c
* add mutex and signal for tx buffer
* use comms.c for flasher as well
* remove comm functions from client/proxmark3.h
* this completes isolating all USB communication related functions in comms.c
* don't assume a port to be defined by a name. Change parameter in OpenProxmark() to void*
* comms.c: set sp and serial_port_name to NULL when offline
pwpiwi [Tue, 8 May 2018 05:54:49 +0000 (07:54 +0200)]
rework of GetFromBigBuf() (#597)
* this should fix crashes reported in issue #497
* don't allow receiver thread to write directly into arbitrary main thread's memory
* instead use cmdBuffer[] for CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K as well
* add timeout and warning options to GetFromBigBuf(), same as in WaitForResponseTimeoutW()
* move GetFromBigBuf() from data.c to comms.c
* remove data.c and data.h
* change variable 'sp' from global to static
* move code to open and close USB port to comms.c (OpenProxmark() and CloseProxmark())
* change scope of USBCommandReceived() to static
* (flasher still unchanged)
* change variable 'offline' from global to static
* change variable 'FlushAfterWrite' from global to static
* remove unused global variable 'current_command'
* WaitForResponseTimeoutW(CMD_UNKNOWN, ...) waits for any command
* #include "printf.h" or <stdio.h> in iso15693tools.c to define sprintf()
* and some minor changes/comments
pwpiwi [Sat, 31 Mar 2018 07:52:43 +0000 (09:52 +0200)]
USB comm: prepare for @micolous change (PR#463) (#587)
* move communication related code from proxmark3.c and cmdmain.c to new file comms.c
* replace byte_t by uint8_t in uart_posix.c and uart_win32.c
* move OpenProxmark() and CloseProxmark() from flasher.c to flash.c
* move print_lock mutex including initializer to ui.c
* minor changes in printing help texts
* no changes in comms functionality yet
Matthew Daley [Wed, 28 Mar 2018 10:37:07 +0000 (23:37 +1300)]
Fix offset Indala UID display
Commit 1dae9811f22b7f2cea340cee6945cb349046129d extended the amount of
fixed bits searched for when decoding 64-bit Indala. These additional
bits come from the end of one UID, and therefore need to be skipped past
when actually retrieving the UID.