Commit graph

150 commits

Author SHA1 Message Date
iceman1001 40cc0a402b chG: adjust some "." progress dots, that shouldn't use NORMAL.. 2018-03-01 14:10:52 +01:00
Brian Pow 858224244d tweak messages 2018-02-21 20:43:53 +08:00
Brian Pow d34e95b9a8 use PrintAndLogEx() instead of PrintAndLog() 2018-02-21 20:43:50 +08:00
Brian Pow b1d414c680 CHG: replace 'samples:' with 'Examples:', unify some usage text 2018-02-09 22:56:16 +08:00
iceman1001 c04ac4f9ac ADD: 'hf felica reader' - added pm3 as FeliCa reader
ADD:  raw commands -  added the basis for sending RAW commands to FeliCa.
CHG: CRC16 rework,  uses table based implementation.  This will change more functions as I go on.
2018-01-29 13:42:02 +01:00
iceman1001 2f3dbbcaa3 rename: ul_switch_off_field -> DropField (inside cmdhf14a.c)
chg:  Fix memory bounds error (@wsmoses)
 c3511781a1
2017-11-11 23:23:01 +01:00
iceman1001 d8c72242a2 chg: some more fflush... 2017-08-28 17:18:54 +02:00
iceman1001 26f786bfe4 chg: removed some warnings in ubuntu17.04 2017-08-25 20:28:16 +02:00
iceman1001 f28da2da6e monster merge...
all those changes marshmellow did..  and more...
2017-07-30 09:17:48 +02:00
iceman1001 195102e9ae fixes 2017-07-14 21:22:03 +02:00
iceman1001 e8015142cd fix: TRUE/FALSE -> bools
fix: 'iclass'  filepath 255, to use FILE_PATH_SIZE
fix: unified params test
2017-07-14 20:54:11 +02:00
ikarus 926ea42b76 FIX: hf legic crc data parameter 'd' was inconsistently declared. 2017-04-14 11:24:49 +02:00
iceman1001 9c624f67b3 chg: @piwi's code cleanup and some more.
ref: 43534cbad2
2017-02-23 00:03:10 +01:00
iceman1001 ceb34a3c1b CHG: syntax sugar 2017-01-11 23:09:47 +01:00
iceman1001 2a1a6aa382 FIX: "hf legic write" - removed a warning message and made the overwrite question working. 2016-10-14 16:39:38 +02:00
iceman1001 1f247f6ac6 ADD: "hf legic wipe" - it autodetects tagtype and fills all bytes from offset 7 to end with zeros.
Fills a legic tag memory with zeros. From byte7 and to the end.
 Usage:  hf legic wipe [h]
Options:
      h             : this help

Samples:
      hf legic wipe
2016-10-14 15:23:20 +02:00
iceman1001 25cb718daf FIX: this should remove a warning. 2016-10-10 21:55:18 +02:00
iceman1001 f9eeab99a4 chg: textual changes. 2016-10-09 16:04:31 +02:00
iceman1001 564c9ae2b6 FIX: increased time-out to match 2.7sec it takes to write 256bytes. 2016-10-09 15:49:59 +02:00
iceman1001 539fd59ebe CHG: "hf legic write" - now writes on the limits better.
CHG: "hf legic restore" - now restors :)
CHG: "hf legic rdmem" - now has a nice offset row above the read data.  try:  'hf legic rdmem 0 100'
2016-10-09 15:41:31 +02:00
iceman1001 367996567b CHG: "hf legic restore" - added a filesize and cardsize check 2016-10-08 19:25:23 +02:00
iceman1001 5b9fb6f454 REM: "hf legic load" has been removed. It doesnt have a purpose anymore.
REM: "hf legic save"  has been removed. It doesnt have a purpose anymore.

CHG: "hf legic restore" started with the logic for the restore. Some compares and write to tag left.
2016-10-08 19:10:46 +02:00
iceman1001 59fc313d99 CHG: help text 2016-10-07 20:49:26 +02:00
iceman1001 b816886806 FIX: one send command bug fixed. Turns out that uint16_t is too small for 21/23bits size. Who figured? 2016-10-07 19:11:38 +02:00
iceman1001 f0fa663814 CHG: "hf legic write" got a make over in how its called. Now called with 'offset' and 'data'
'hf legic write o 10 d 11223344'  -  this will write 4 bytes (0x11,0x22,0x33,0x44) to tag from offset 10 (0x0A)
2016-10-07 11:58:14 +02:00
iceman1001 f6e01a3493 Renamed the calccrc8 functions and command. 2016-10-07 00:14:02 +02:00
iceman1001 77e1bab94a REM: "hf legic writeraw" has been removed.
FIX: "hf legic eload" uploads now correct to device mem.
2016-10-06 19:34:53 +02:00
iceman1001 0e8cabed8d ADD: "hf legic eload" - Load binary file to emulator memory. Use "h" for help text
ADD:  "hf legic esave" - Save emulator memory to binary file. Use "h" for help text
2016-10-06 19:13:23 +02:00
iceman1001 9015ae0f5d CHG: "hf legic dump" now automatically detects tagtype and dumps accordingly.
CHG:  still #define codestyle  should it be with or without semicolons?
2016-10-05 22:58:06 +02:00
iceman1001 00271f774a FIX: undeclared var on deviceside,
FIX:  "hf legic dump" is almost there.
2016-10-05 22:07:32 +02:00
iceman1001 633d068682 CHG: command name changes..
old "hf legic info" is now "hf legic reader"
old "hf legic read" is now "hf legic rdmem"
old "hf legic decode" is now "hf legic info"

ADD:  new command "hf legic dump",  which will autodetect tagtype and dump all mem to a binary file.
2016-10-05 21:42:13 +02:00
iceman1001 c15e07f11d CHG: making timings a bit tighter == faster read of tag. Like 1ms for whole tag.
FIX:  off-by-one bug in read-byte-loop.
2016-10-04 23:08:39 +02:00
iceman1001 e1a0ed65ff FIX: forgot a LEN in print message. 2016-10-04 21:42:56 +02:00
iceman1001 1daa1226fd CHG: reading a complete MIM1024 takes about 2.8sec. This timeout is changed to 3sec now. 2016-10-04 21:41:21 +02:00
iceman1001 7a8db2f678 CHG: "hf legic read" - increased timeout values client side, reading MIM1024 takes a bit of time 2016-10-04 21:26:19 +02:00
iceman1001 86087eba00 Textual changes in helptext. Still no clear. 2016-10-04 18:43:11 +02:00
iceman1001 7bc3c99e7e CHG: "hf legic write" started to change this command to the updated code 2016-10-04 18:05:55 +02:00
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 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 323e05cc20 CHG: added the verbose flag, to make the output in "hf search" lesser. 2016-09-26 21:39:04 +02:00
iceman1001 3e750be37c ADD: started to add a legic detection to "HF SEARCH" 2016-09-26 20:01:23 +02:00
iceman1001 f1f7430ae0 CHG: removed the ubuntu build variable which is no needed anymore to build on ubunutu.
CHG: Some warnings in cmdhflegic.c is solved.
2016-09-26 17:19:35 +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
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 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 b98827ffc3 FIX: IV now is trunckated to 7bits in 'hf legic read,write, writeraw'
FIX: IV LSB bit is always set, in 'hf legic read,write, writeraw'
2016-09-03 12:19:05 +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 ffa306de61 CHG: starting to add the legic changes.. *work in progress* 2016-08-26 17:19:27 +02:00
iceman1001 26778ea772 FIX: coverity scan 133850, again. Why on earth did the 7 come from. I removed it. 2016-08-03 12:09:16 +02:00
iceman1001 e8fecd72bc FIX; coverity scan 133850, & operation should keep only topbit of lower nibble.
CHG: tabs fixed
2016-08-03 10:01:37 +02:00
iceman1001 a28d34f407 Coverity Scan 133850, need to ask @jason about this one. 2016-08-03 09:32:07 +02:00
Alexis Green 987c59849e FIX: CoverityScan 123358 and 133864 - Unchecked return value 2016-08-02 22:44:36 -07:00
Alexis Green e31a0f736e FIX: LEGIC - potential stack corruption calculating CRC from user input 2016-08-02 14:10:33 -07:00
Alexis Green 0892708119 FIX: CoverityScan 123465 - Resource leak 2016-08-02 13:57:44 -07:00
iceman1001 e719470c46 Merge branch 'master' of https://github.com/iceman1001/proxmark3 2016-08-02 16:06:40 +02:00
iceman1001 aeb128e2bb chg: another way of checking a array for NULL 2016-08-02 16:04:57 +02:00
Alexis Green 6e321dd8f3 Fixing warning:
warning: ignoring return va 'scanf', declared with attribute warn_unused_result [-Wunused-result]
2016-08-01 13:03:46 -07:00
iceman1001 cc4c8fd6cf FIX: getting rid of a compiler warning message. 2016-07-31 21:59:29 +02:00
iceman1001 514ddaa2ff CHG: help text changes in cmdlfjablotron.c
CHG: increase byte size to uint16_t in crc.c CRC16Legic
2016-07-29 20:58:52 +02:00
iceman1001 ba4ad25b37 FIX: Fixed some warnings I didn't take notice off.
- memcpy should have been "memset"
- forgot to add function declaration into header file.
2016-07-28 22:17:44 +02:00
iceman1001 3e134b4c20 CHG: merged the forum user @jason 's fixes to LEGIC. *UNTESTED*
CHG: changed the CRC implementations.
2016-07-28 21:41:44 +02:00
iceman1001 cbdcc89ae7 CHG: free the malloc:d memory in the crc8 function.
CHG: use the new GetEMLfrombigbuff  method.
ADD: added a usage_legic_read
2016-04-10 13:18:11 +02:00
iceman1001 eb5206bd20 FIX: resource leak, forgot a free 2016-02-18 20:39:41 +01:00
iceman1001 6cf8fcb002 FIX: corrected one of my own bugs which made the calccrc8 not accept the input hexstring. 2016-02-18 17:46:11 +01:00
iceman1001 aacb96d7ed FIX: Coverity scan fixes, hard to keep track of stringlengths while reading and copying in C. 2016-02-17 10:46:08 +01:00
iceman1001 f7f844d0ba CHG: added timeouts for downloading values from device, to make the client more responsive.
CHG: still curious for the printf_hex_breaks method, why it behavies strange.
2016-02-16 10:54:41 +01:00
iceman1001 a182a680b0 ADD: a print_hex_break function,
CHG: "hf legic decode" looks better.
2016-02-15 22:05:26 +01:00
iceman1001 9827020ac5 CHG: "hf legic decode" now prints nicely. Still a strange bug for first row.. 2016-02-15 19:56:08 +01:00
iceman1001 d7fd908447 FIX: change the "hf legid load", to use the WaitForResponseTimeout, instead of locking the client if device doesn't answer.
CHG: starting to fix the "hf legic decode" and printing the user segements.  *WORK IN PROGRESS*
2016-02-15 15:03:07 +01:00
iceman1001 60bb5ef73b FIX: "hf legic decode" the stamp_len variable was int, but its used as a uint8_t.
FIX: cmdlfem4x.c needed ref to cmdmain.h for clearCommandBuffer
2016-02-14 15:30:26 +01:00
iceman1001 c6e0a2ebeb FIX: Faster data load. 2016-02-14 13:29:20 +01:00
iceman1001 e579e76873 FIX: The "hf legic load" had an bug where it send the read byte as uint32_t to the device. 2016-02-14 12:36:42 +01:00
iceman1001 3b920280db ADD: Calc legic Crc8 method on given input hexstring. 2016-02-14 11:56:54 +01:00
iceman1001 810f53792e ADD: added the possibility to choose which block num to attack with "hf mf mifare" Before it only worked on block 0. 2016-01-20 22:26:01 +01:00
iceman1001 e7d099dcaa CHG: syntax suger, text edit 2016-01-20 17:46:23 +01:00
iceman1001 52cf34c1cc CHG: Syntax suger, space -> tabs. etc.
FIX: Coverity Scan says out-of-bounds,  Increased the databuffer. Legic List command needs to be re-done.
2016-01-19 19:33:23 +01:00
iceman1001 e1ad67eaf2 FIX: Coverity Scan fixes, a bunch of them. 2016-01-16 22:58:44 +01:00
iceman1001 395ec4e99c FIX: Coverity, CID# 121337, Out-of-bounds. In the loop, variable i, can be as much as 1051, overflowing the databuf with size 1024. 2016-01-12 23:16:20 +01:00
Martin Holst Swende 31d1caa526 Reverted some minor things, altered other things to get it to compile cleanly 2015-01-08 17:51:52 +01:00
iceman1001 b915fda392 FIX: a solution for the issue "hf mf esave - always saves 4K"
FIX: a solution for the issue "hf eload, esave, cload, save - filepath variable too short"
CHG: minor code clean up.
ADD: AES / CRC16 for lua. (and tnp3xx scripts.)
ADD: tnp3dump.lua  script to dump tnp3xx tags.
ADD: tnp3sim.lua script to let PM3 imitate an tnp3xx tag. Needs to be tested live
2015-01-07 22:00:29 +01:00
iceman1001 3fe4ff4f03 CHG: generic code clean up. Removal of commented code.
CHG: USB_CMD_DATA_SIZE is now used as maxsize for transfer of data between client and pm3device
CHG: suggested a fix for the underscore problem in ioclass\fileutils.c
ADD:  tnp3xx support
ADD:  nxp tag idents.
ADD:  identifiction of chinese backdoor commands to hf 14a reader.
2015-01-05 15:51:27 +01:00
martin.holst@gmail.com 4961e292aa More patches from en4rab to the hexsamples, plus patches to legicsave and legicdecode (also by en4rab). 2013-07-12 20:03:31 +00:00
roel@libnfc.org 1a07fd510d fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part2 2013-02-28 22:33:31 +00:00
roel@libnfc.org 125a98a110 fixed stupid 64-bit formatting for x86/amd64 and unix/windows 2013-02-28 22:22:24 +00:00
roel@libnfc.org 28fdb04fd8 Finally, rewrote bootrom and flasher program, much faster now 2013-02-28 15:11:52 +00:00
roel@libnfc.org 902cb3c00b major USB update 2012-12-04 23:39:18 +00:00
adam@algroup.co.uk 3612a8a8e2 legic write/simulate [Anon] 2010-05-06 11:24:01 +00:00
izsh@fail0verflow.com a553f26748 Add License/Copyright headers/notices. Please add your own copyright notice if you have made any nontrivial changes or additions to the code. There are several files without any attribution, currently. 2010-02-21 00:47:22 +00:00
adam@algroup.co.uk a2b1414f43 Andreas fix for LEGIC MIM1024 2010-02-06 09:43:33 +00:00
adam@algroup.co.uk 313322658c FIXME: will crash if sample buffer does not contain valid legic data (fixed by Sourcerer) 2010-02-05 20:08:02 +00:00
izsh.f0f 41dab15305 Alphabetical order ;) And cosmetic changes (remove duplicated includes) 2010-02-05 17:16:14 +00:00
adam@algroup.co.uk 669c1b80c5 add LEGIC decoder (submitted by Sourcerer, untested by me) 2010-02-05 13:56:33 +00:00
adam@algroup.co.uk 8e220a9126 put legic back in the system and add rumpletux's fast legic / prng code from forum 2010-02-05 08:18:02 +00:00
izsh.f0f 7fe9b0b742 Client cleanup and restructuring. Stage 1...
Next Step is refactoring some of the giant functions which are
just copy/paste of some other ones with just a few line changes,
removing unnecessary 'goto' etc.

The MS Windows version is broken with this commit but will be fixed
soon. Everything can't be done all at once :P

The commands are now hierarchical, for example:
"hf 14a read" vs. "hf 14b read".
You can also request help:
"hf help", "data help", "hf 15 help" etc.

Indents are now space-based, not tab-based anymore. Hopefully
no one will be trolling about it, considering the suicide-prone work
being done here ;)

client/cmdhw.c, client/proxusb.c, client/cmdhw.h, client/proxusb.h,
client/cmdmain.c, client/cmdlfhid.c, client/cmdmain.h, client/cmdlfhid.h,
client/data.c, client/data.h, client/cmdhf.c, client/cmdlf.c,
client/cmdhf.h, client/cmdhf15.c, client/cmdhf14b.c, client/cmdlf.h,
client/cmdhf15.h, client/cmdhf14b.h, client/cmddata.c, client/cmddata.h,
client/ui.c, client/cmdparser.c, client/cmdlfti.c, client/ui.h,
client/cmdlfem4x.c, client/cmdparser.h, client/cmdlfti.h, client/cmdlfem4x.h,
client/graph.c, client/graph.h, client/cmdhf14a.c, client/cmdhf14a.h,
client/cmdhflegic.c, client/cmdhflegic.c: New files.

client/cli.c, client/flasher.c, client/snooper.c, client/proxmark3.c,
client/proxmark3.h, client/Makefile: Update accordingly.

client/flash.h, client/flash.c, client/proxgui.cpp: Cosmetic changes.

client/translate.h, client/command.c, client/gui.c,
client/usb.c, client/prox.h: Remove.

include/usb_cmd.h (CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443_SIM): Remove dead cmd.

common/crc16.h: New file.
common/crc16.c: Modify accordingly.
common/iso14443crc.h: New file.
common/iso14443_crc.c: Rename to
common/iso14443crc.c: and modify accordingly.

armsrc/lfops.c, armsrc/iso14443.c,
armsrc/iso14443a.c: include .h files from
the common directory instead of including the c files.

common/Makefile.common, armsrc/Makefile: Modify accordingly.
2010-02-04 01:27:07 +00:00