Commit graph

749 commits

Author SHA1 Message Date
iceman1001 77a689dbeb CHG: revert legiccrc8 to old algo.
CHG: "hf legic decode" now loads EML memory
CHG: legic timings is better.
2016-10-04 00:07:07 +02:00
iceman1001 0b0b182fe2 CHG: changed to use BigBuff_Eml memory instead of big_buff_malloc.
CHG: downloading eml memory from device should use uint's
CHG: "hf legic read" has a different printing. It now prints 32bytes / row
2016-10-03 23:24:59 +02:00
iceman1001 c649c43389 CHG: finally, the ticks timer does what it is supposed to do. 32bits and working. 2016-09-29 21:36:43 +02:00
iceman1001 fabef615ec CHG: added addresize to legic select struct.
CHG: TIMER, it turns out the TC0, TC1 and TC2 is only 16bit.  So adjust to use two clocks to get a 32bit timer.
CHG: code clean up in legic device side.  consistency with variable names..
2016-09-29 17:43:39 +02:00
iceman1001 cb7902cdcd CHG: removed some debug data
CHG: reverted back to old crc imp.
2016-09-29 14:46:12 +02:00
iceman1001 a39944216d CHG: a select_legic function with structs and stuff and 2016-09-29 12:23:09 +02:00
iceman1001 d7e24e7c5f CHG: 'hf list legic' doesn't print the parity now.
CHG: 'hf legic read' the device side timings is starting to look much better. HUGE Thanks to @will-rbnt for endless checks and logic analyser feedback. Without his effort this would not work. What does work? We can now use ANY IV in legic. The PM3 Master version is flawed, will only work with IV=0x55.

---still broke--- my crc implementation.. I know I'm about to look into it.
2016-09-28 21:37:08 +02:00
iceman1001 584e28e54b CHG: Minor tweaks, the tracing dissappeared, the spindelay for powering up too long. 2016-09-26 21:40:05 +02:00
iceman1001 62577a62ae FIX: Much of my added extra legic code is commented away now.
FIX: the gcc6.1.1 warning broke my gcc 4.8.4 build env..
2016-09-26 20:21:31 +02:00
iceman1001 3e750be37c ADD: started to add a legic detection to "HF SEARCH" 2016-09-26 20:01:23 +02:00
iceman1001 faabfafe30 CHG: using bitsend to determind the legic annotation in "hf list legic" makes false positives much less. 2016-09-26 12:26:37 +02:00
iceman1001 e1deabc0eb CHG: fixes a "indent" warning 2016-09-26 11:04:04 +02:00
iceman1001 25d52dd261 CHG: according to measureement by @wilrn the actual timing for receiving tag data, is 90us (ONE) and 100us (ZERO) which is not mentioned anywhere before. What a find! 2016-09-24 15:15:24 +02:00
iceman1001 d5bded10e2 CHG: lowered the timout again, but re-added the spindelay since 14a requires 5ms powerup before entering the idle-state where tag starts to listen.
CHG: fix the ticks compare xx > 1 into  xx >= 1
2016-09-23 23:23:17 +02:00
iceman1001 f885043422 FIX: "hf 14a read" / "hf mf *" / "hf mfdes info" and failure when calling these commands serveral times in row.
For long transactions the sspclock compare with >1 instead of >=1 ..   Now the timer resets properly.
CHG: use some #define constants for iso-commands.
2016-09-23 21:28:07 +02:00
iceman1001 24c49d36ba FIX: This commit fixes the broken LF since I change the spindelay calls. The original problem is that spindelayus calls is incremented with21.3us each step, making it very hard to find exact timings found in the datasheets for T55x7, HID etcetc. When @marshmellow and I looked into this 2014, I had this on my back of my mind but forgot it since I didn't know how the source code / pm3 worked. This behavior in spindelayus has given the bit-period for ON/OFF measured in (us) very hard to find. Its kind of magic that it worked so far so good. Well until I started to look into the "hf legic" bitbanging ASK ON/OFF keying and that one needs a much more precis timer. Same goes for the PCF7931 code.
I've added a precise timer in the new files ticks.c and moved some older stuff from util.c to have a solid base for this.
UNTESTED,  and the timings measured for t55x7 in lfops.c and other parts has not been adjusted to this "correct" timer.
2016-09-23 16:35:26 +02:00
iceman1001 22f4dca88c CHG: extracted some timers functionality, to get unified access to a timer/clock which counts in ticks. Moved stuff from util.c 2016-09-21 19:03:32 +02:00
iceman1001 87342aadbc CHG: adjusted timing according to @sentinel 's traces 2016-09-14 16:18:04 +02:00
René Werner 1cb9b2a3cf used tabs instead of spaces 2016-09-13 21:04:13 +02:00
René Werner 78f59945a7 fixed indentation to get rid of warnings
warnings are treated as errors, so a warning due to misleading
indentation is kinda annoying
2016-09-13 20:57:25 +02:00
iceman1001 111c6934d4 CHG: Small steps, the waiting time between frames was unclear. At least now the tags answers to a readbyte command after the setup phase. 2016-09-12 09:19:49 +02:00
iceman1001 76471e5d17 CHG: reverted back from the idea of measureing in (us) microseconds, the timer is too raw, gives 10-15us delays. Now we are measuring ticks, which is (1 us = 1.5ticks)
like it was before.   ie:  80us = 80*1.5 = 120ticks.
2016-09-11 11:14:12 +02:00
iceman1001 db44e049b0 CHG: this timing should be quite good. needs to be verified. 2016-09-10 22:47:11 +02:00
iceman1001 b4a6775b5e CHG: a better micro second (us) spindely function. At average it has 8-10us delay, but its linear. Making error less when you want to wait longer..
SpinDelayCountUs(20) gives a delay of 28us.
SpinDelayCountUs(100) gives a delay of 110us.
SpinDelayCountUs(500) gives a delay of 508us.
2016-09-10 21:43:08 +02:00
iceman1001 5d15891e2b FIX: Even the US clock had the issues with not resetting properly. Now its always ZERO when you call StartCountUS. 2016-09-09 11:57:31 +02:00
iceman1001 ad5bc8cc8c In my attempts to make the LEGIC code better, its not working now. Timings if off.
CHG: switching to US clock.
CHG: better trace annotation for legic
CHG: Legic prng can now give a x bits in once.
2016-09-09 11:56:20 +02:00
iceman1001 f7b4257301 FIX: the acknowledgement response in setup phase now deals with MIN22, MIN256, MIN1024 tag accordingly. 2016-09-03 12:18:02 +02:00
iceman1001 c71c5ee156 ADD: started to add tracelog in legic
ADD: remake of legic codebase.
ADD: started with a annotation for LEGIC in 'hf list'
2016-09-02 16:25:54 +02:00
iceman1001 ab1112796e CHG: removed call to bigbuff free. 2016-09-01 20:31:22 +02:00
iceman1001 2deea574d3 CHG: reverting use of bigbuff, because I forgot that every switch between LF/HF images destroys BigBuff. 2016-09-01 00:52:54 +02:00
iceman1001 05aff802ae CHG: removed a redundant include to strings.h, which made compilation errors on OS X 2016-08-31 22:10:06 +02:00
iceman1001 cc70dd6b60 FIX: should fix the typedefintion error for OS X regarding bool cmd_send 2016-08-31 21:11:57 +02:00
iceman1001 153a4a78fe CHG: the loop in main, for usb_poll_validate_length, shouldn't do anything, it should be done inside the next call to usb_read... 2016-08-31 19:22:52 +02:00
iceman1001 8d61d9b114 CHG: this timeout doesn't influence the bad performance with my older pm3 device (green pcb). I think its too slow. 2016-08-31 19:18:48 +02:00
iceman1001 be818b1417 FIX: Forget that the prng was 0x8000 length and not 0xFFFF. Sorry. Also returned to the decomposed loop. Don't know if this armsrc optimises this at compilation time. Does someone know?
CHG: returned the iso14443a_setup order, it might influence my older PM3 device.

*Note*  my Elechouse revisions PM3 works great with this but my older xpfga (green pcb) is hopeless.  It can't fix onto the nonces in 'hf mf mifare'  I think its too slow.
2016-08-31 19:17:39 +02:00
iceman1001 cc70889743 FIX: fixes the broken build,...
FIX:  increased the timeout,  to make 'hf mf chk' work better.
2016-08-26 17:17:40 +02:00
iceman1001 f121b478a1 FIX: 'lf awid bruteforce' cleaning up all debug messages 2016-08-26 16:35:30 +02:00
iceman1001 ed8c2aeb63 CHG: forgot a semicolon... 2016-08-24 15:05:10 +02:00
iceman1001 bcacb3168b CHG: removed some extra time to sync,
CHG: first_try ,  it must recalibrate all the times when it comes from the client.
2016-08-24 15:01:36 +02:00
iceman1001 63a1d80130 FIX: the underlaying bug on deviceside code. The SSPCLOCK wasn't reset to zero sometimes. More specific, TC2 wasn't reset cause all sorts of timing issues for the device side randomly. Like 'hf mf mifare', like iclass, like 'hf mf sim' etc etc. 2016-08-24 12:37:31 +02:00
iceman1001 f38cfd6693 CHG: fixed the collapsing comments when opening this file in notepad++ Need spaces between // text or /* ... 2016-08-24 12:34:34 +02:00
iceman1001 4c44d88500 REM: removed an test function 2016-08-24 12:32:43 +02:00
iceman1001 6067df30c5 FIX: at least now the special zero parity attack, repeats and doesn't crash. However it doesn't find the key either :( 2016-08-10 10:55:29 +02:00
iceman1001 86db8973b0 CHG; still looking at 14b, this time started to look at the tracelog times not working. 2016-08-09 23:13:18 +02:00
iceman1001 c2df2883f8 fix: forgot something small.. sloppy. 2016-08-07 22:15:35 +02:00
iceman1001 29f8c2cc15 ADD: added the 'max frame size' parameter set, valid sizes: 16|24|32|40|48|64|96|128|256
it can be verified by setting debuglevel to 3 or more.
2016-08-07 22:05:10 +02:00
iceman1001 d8b7a5f294 CHG: applied some of the changes unto "hf 14b snoop" *untested* Hard to test without a proper reader/tag to snoop 2016-08-07 18:49:36 +02:00
iceman1001 b86225188e CHG: iso14443b.c got some more love. using the "hf 14b raw" command gives now a much stabil read from more distances than before. 2016-08-07 17:49:33 +02:00
iceman1001 df007486f5 ADD: @donwan581 select keytype for the darkside attack. 2016-08-04 21:51:26 +02:00
iceman1001 6b23be6b7e CHG: cleaning up. 2016-08-04 21:37:43 +02:00