Commit graph

147 commits

Author SHA1 Message Date
Philippe Teuwen 4761ea13f7 MF_DBGLEVEL => DBGLEVEL (pm3 side) 2019-06-06 10:05:09 +02:00
iceman1001 53f2058c7a chf: hf mf eget\nhf mf eset\nhf mf eclr - uses NG 2019-05-27 07:46:27 -04:00
Philippe Teuwen f0c0b854ac Fix mifare_ultra_readblockEx, copy full 16b of mful block (was 14) 2019-04-29 01:08:59 +02:00
osboxes.org ffd2c92584 style 2019-04-10 09:46:01 +02:00
iceman1001 6c1b8f809e chg: update armside debug to fit with offical repo. 2019-04-10 08:42:00 +02:00
iceman1001 8c4f8eaeca unused 2019-04-09 20:43:09 +02:00
McEloff 4588384587
Merge branch 'master' into temp 2019-04-08 10:26:30 +03:00
Eloff 791ff18381 'hf mf sim' - bugs fix, refactoring 2019-04-05 00:15:55 +03:00
vratiskol a068f7c2bc Mifare Sim
Compilation OK
Emulation 1k OK with android
2019-03-27 14:18:26 +01:00
vratiskol 3b06c9d8ee Merge remote-tracking branch 'upstream/master' into hf_mf_sim 2019-03-21 20:46:56 +01:00
iceman1001 ca9061bd32 changed byte_t -> uint8_t 2019-03-21 15:19:18 +01:00
vratiskol 619ef2ba37 Use Variable 2019-03-16 03:46:36 +01:00
vratiskol 64c3ae8b34 hf mf sim 2019-03-15 21:04:25 +01:00
Philippe Teuwen 961d929f4d changing {} style to match majority of previous style 2019-03-10 11:20:22 +01:00
Philippe Teuwen 0373696662 make style 2019-03-10 00:00:59 +01:00
Philippe Teuwen 8a7c6825b5 armsrc: fix mix of spaces & tabs 2019-03-09 20:34:41 +01:00
Philippe Teuwen 60f292b18e remove spurious spaces & tabs at end of lines 2019-03-09 08:59:13 +01:00
Philippe Teuwen edc19f202a Convert the few files with still Windows carriage returns 2019-03-09 08:49:41 +01:00
iceman1001 3e7576c86d fix: 'hf mfu rdbl'
fix: 'hf mfu dump'  -  bad exit strategy
2018-05-03 22:41:28 +02:00
iceman1001 0eca7e3977 chg: #define rename 2018-03-16 08:58:07 +01:00
iceman1001 3438d016c7 idea based on @jamchamb PR in official pm3 https://github.com/Proxmark/proxmark3/pull/584 2018-03-15 20:06:12 +01:00
iceman1001 ce418fb720 chg: 'hf mfu read'
chg: 'hf mfu dump'  - 5 retries if failed readblock.  Loop for CRC error or incomplete reads.

This will make reading / dumping more stable.
2018-03-15 19:59:33 +01:00
iceman1001 52d69ed4ee CHG: refactor CRC16 algos. This is a big change, most likely some parts broke, hard to test it all. 2018-02-01 15:19:47 +01:00
iceman1001 9665bd526a chg; less debug 2017-12-11 01:19:58 +01:00
iceman1001 f9e73b9c61 chg: adjusting debug levels 2017-12-10 23:23:08 +01:00
iceman1001 bf2b2afeeb cleaning up.
chg:  swapped random gen for mifare classic auth to known weak prng.
2017-12-10 23:09:53 +01:00
iceman1001 2d6fead9de fix... 2017-12-10 10:06:27 +01:00
iceman1001 a27a29c0c6 chg: use defines instead. 2017-12-10 09:52:26 +01:00
iceman1001 0e9f234f11 CHG: lessend the default debug level to MF_DBG_ERROR. 2017-12-09 08:27:56 +01:00
iceman1001 f906cb7f89 chg: 'hf mf sim' @piwi's changes part 1 2017-11-11 22:41:52 +01:00
iceman1001 4406f4ee2a CHG: removed some #DEFINE TRUE/FALSE 2017-07-07 12:52:51 +02:00
iceman1001 3ca3d401c0 FIX: some adjustments to prng detection 2017-07-04 20:11:25 +02:00
iceman1001 dfcf20d641 FIX: Coverity Scan fixes to emvcmd.c among others.
FIX: emclearmem bug.
2017-03-05 18:43:06 +01:00
iceman1001 aa5cba4ca3 CHG: coverity scan cpmplains.. 2017-02-26 00:40:19 +01:00
iceman1001 d32691f1da FIX: hf mf sim - authentication works again.
CHG: `lf em`- renamed.
CHG: removed functionality in whereami.c, not needed.
2017-02-25 23:00:20 +01:00
iceman1001 07bc72b880 CHG: continue code cleanup.
REM: removed stdint.h ,  since we are using c99 when compiling.
2017-02-23 00:32:14 +01:00
iceman1001 e99acd00cc CHG: the mifare Auth command can make use of a random nonce aswell.
CHG: since sim commands are timing critical, I'm testing a smaller prand prng function from Intel
2017-01-29 10:41:48 +01:00
iceman1001 53d5dc643f CHG: fiddled with the headerfiles... and makefile... Tried to make them behave nice. So it isnt a hell to add new functions from third-party (like des, aes etc)
Added a lot of #ifndef ,   extern C,
Move inside from ARMSRC -> THUMBS,  which made the compiled image smaller.. I don't know if it broke anything.
Moved MF_DBGLEVEL definitions into common.h
Moved print_result from util.c into appmain.c
Also split up some struct typedef  into header files so they could be reused in other code places.

''' danger '''  this might have broken stuff...
2017-01-25 00:33:03 +01:00
iceman1001 405944a0ac CHG: moved to header file 2017-01-21 10:31:54 +01:00
iceman1001 dd83c4572b CHG: coverity complains about not reading the value from mifare_send_short
CHG: ubuntu 14.04 gcc4.8.4 complains about mem_avail still. Don't know why.
2017-01-09 22:15:36 +01:00
iceman1001 325f26e25d CHG: removed unused variable 2016-11-03 15:15:25 +01:00
iceman1001 3a051ec10b CHG: don't consider the respons at all when sending the HALT command. 2016-11-03 15:00:17 +01:00
iceman1001 d209443322 CHG: 'HF MF C*' (chinese backdoor commands) According to douniwan5788 some magic/clone tags answers to the halt cmd and some not. I think I captured his ideas.
ref: 13b71e58fd
2016-10-28 20:43:07 +02:00
iceman1001 46f983fe9e REM: removed an unused method MifareCollectNonces
ADD:  added some set_tracing(FALSE) calls for consistency.
and.. syntax suger
2016-04-12 11:29:40 +02:00
iceman1001 2abdfa491c CHG: mostly syntax suger, trying to uniform the look 'n feel.. To make calls act to what is expected. 2016-04-10 12:56:59 +02:00
iceman1001 aaa1a9a2dc CHG: Added calling clear bigbuff to zero out it also, instead of just "free" it.
ADD:  downloading the EML part from BigBuffer specially.
2016-03-12 09:03:28 +01:00
iceman1001 838c15a643 ADD: added some time debug statements to be able to measure execution time.
CHG: change the auth_ex method to send usb package faster,
REM: removed some bucketsort changes.
2016-02-17 17:30:37 +01:00
iceman1001 bd9dfaa891 CHG: Syntax suger
EXperimented:  unfolded a loop.
2016-01-25 20:24:23 +01:00
iceman1001 d798d31cbe FIX: Coverity scans, uninitialized variables,
CHG: unfolded some loops..
2016-01-20 17:44:51 +01:00
iceman1001 7d5169a0e9 CHG: minor change initializing array. 2016-01-19 16:59:06 +01:00
iceman1001 f8ada309e9 ADD: @pwpiwi 's latest code from his 'hardnested' branch. 2015-12-15 08:51:29 +01:00
iceman1001 c2731f37be CHG: a major remake of the "hf mf c*" commands. Ie chinese magic tags. Tried to make them consistent in parameter calls and simplified. And fixed the annoying gen1 tags that answers with a ACK/NACK on HALT commands.. 2015-11-09 21:46:15 +01:00
iceman1001 0de8e3874d A lot of changes...
.. ntag simulation stuff from @marshmellows branch "ntag/sim"
.. hf mf mifare fixes from @pwpivi.
.. hw status command
.. speedtest function from @pwpivi
.. Viking Functionalities,   (not a proper DEMOD, but a start)
.. GetCountUS  better precision from @pwpivi
.. bin2hex,  hex2bin  from @holiman

...
starting with getting the T55x7 CONFIGURATION_BLOCK for different clone situations. Ripped from Adam Lauries RFidler,   nothing working or finished..
...
Started working with the T55x7 read command with password actually performs a write block...  See Issue #136  https://github.com/Proxmark/proxmark3/issues/136    Not solved yet.

...
Started add SHA256..   not working yet..
2015-10-04 18:01:33 +02:00
iceman1001 2d2f7d1948 ADD: @marshmellow42 's changes / fixes. 2015-05-31 21:47:33 +02:00
iceman1001 95aeb706d7 CHG: @marshmellow42 changes on deviceside.
ADD: increase debuglevel for printing a statment in ul_ev1_auth
2015-05-27 23:23:46 +02:00
iceman1001 ce432659f2 Adjustments after the big merge from PM3 master. 2015-05-23 08:38:46 +02:00
iceman1001 bcf61bd34a Merge branch 'master' of https://github.com/Proxmark/proxmark3
Conflicts:
	README.txt
	armsrc/appmain.c
	armsrc/apps.h
	armsrc/des.c
	armsrc/iclass.c
	armsrc/mifarecmd.c
	armsrc/mifareutil.c
	armsrc/mifareutil.h
	client/cmddata.c
	client/cmdhf.c
	client/cmdhf14a.c
	client/cmdhficlass.c
	client/cmdhfmfu.c
	client/cmdhfmfu.h
	client/cmdscript.c
	client/lualibs/commands.lua
	client/lualibs/html_dumplib.lua
	client/scripting.c
	client/util.c
	common/protocols.h
	include/usb_cmd.h
2015-05-23 08:16:40 +02:00
marshmellow42 29250969b0 @iceman1001 s comments/updates mfu cmds 2015-05-18 22:07:11 -04:00
iceman1001 e7e9508883 @Marshmellow42 's cleanup isn device-side "hf mfu" code. Looks nice. Dump uses bigbuffer now, and can dump NTAG216 :)
Consistency on the client-side code "hf mfu".  looks nice.
2015-05-18 20:58:33 +02:00
marshmellow42 9d87eb6650 MF ultralight code cleanup 2015-05-18 13:11:00 -04:00
marshmellow42 8258f40969 Iceman1001 s MFU clean up
cleaned up MF UL_C auth code device side.
2015-05-17 20:49:25 -04:00
iceman1001 4d2e4eea58 CHG: the "HF MFU" authentication changes.
CHG: name change from "hf 14a snoop"  ->  "hf 14a sniff"..
2015-05-16 15:34:01 +02:00
marshmellow42 cceabb79e6 mfu info / dump attempt at missing auths
NOT TESTED.  will test soon.  probably has bugs!
2015-05-16 01:00:31 -04:00
iceman1001 8d53ea1403 CHG: added 2k3des to ULC READCARD. 2015-05-05 00:33:07 +02:00
marshmellow42 f168b2633b MF Ultralight - Iceman's updates + mine
Beginning of Ultralight additions.
detection of Ultralight Types added
dump command now auto detects type
can authenticate Ultralight C
2015-04-29 18:27:31 -04:00
iceman1001 add0504dea ADD: Started a "collect nonces" concept to be able to analyse the tag generated nonces. 2015-04-24 18:41:49 +02:00
iceman1001 aa60d1560e NEW: HF MFU SETPWD - set password to a Ultralight C tag.
NEW: HF MFU SETUID - set UID to a magic UL / UL-C tag.   *not implemented*
CHG: minor alignment for "Hf list" output.
CHG: removed unneeded function parameters to the ultralight commands
CHG: the const MAX_MIFARE_FRAME_SIZE is changed to MAX_FRAME_SIZE in the ultralight commands since the UL-Ev1 can have bigger frames than 18bytes.
CHG: adding DES support for the Ultralight-c read commands on deviceside.
2015-03-30 16:24:03 +02:00
iceman1001 64d1b4efc9 Merge branch 'master' of https://github.com/Proxmark/proxmark3
Conflicts:
	armsrc/Makefile
	armsrc/appmain.c
	armsrc/apps.h
	armsrc/epa.c
	armsrc/iclass.c
	armsrc/iso14443a.c
	armsrc/iso14443a.h
	armsrc/iso15693.c
	armsrc/lfops.c
	armsrc/mifarecmd.c
	armsrc/mifareutil.c
	armsrc/mifareutil.h
	armsrc/string.h
	armsrc/util.h
	bootrom/bootrom.c
	client/Makefile
	client/cmddata.c
	client/cmddata.h
	client/cmdhf.c
	client/cmdhf14a.c
	client/cmdhf14b.c
	client/cmdhf15.c
	client/cmdhficlass.c
	client/cmdhfmf.c
	client/cmdhfmfu.c
	client/cmdlf.c
	client/cmdlfem4x.c
	client/cmdlfhid.c
	client/cmdlfhitag.c
	client/cmdlfio.c
	client/cmdmain.c
	client/data.h
	client/flash.c
	client/graph.c
	client/graph.h
	client/loclass/elite_crack.c
	client/loclass/fileutils.c
	client/lualibs/commands.lua
	client/lualibs/html_dumplib.lua
	client/lualibs/mf_default_keys.lua
	client/lualibs/utils.lua
	client/mifarehost.c
	client/nonce2key/crapto1.c
	client/proxmark3.c
	client/scripting.c
	client/scripts/tnp3dump.lua
	client/scripts/tnp3sim.lua
	client/scripts/tracetest.lua
	common/Makefile.common
	common/cmd.c
	common/cmd.h
	common/lfdemod.c
	common/lfdemod.h
	common/usb_cdc.c
	common/usb_cdc.h
	include/usb_cmd.h
2015-01-29 21:39:33 +01:00
pwpiwi f71f4deb8f BigBuf and tracing rework: allow much longer traces in in hf commands
- provided a BigBuf_malloc() function to dynamically allocate parts of BigBuf
  e.g. for DMA-Buffers, Frame-Buffers, Emulator-Memory
- the whole rest of BigBuf is now available for traces (instead of a small fixed amount)
- send actual traceLen together with trace data
- changed client side to cope with varying traceLen
- changed small buffers to automatic variables instead of parts of BigBuf
2015-01-28 07:18:51 +01:00
pwpiwi 117d9ec25c Refactoring of BigBuf handling in order to prepare for more efficient memory allocation and longer traces. 2015-01-27 22:25:55 +01:00
iceman1001 c8b6da2295 Merge branch 'master' of https://github.com/holiman/proxmark3
Conflicts:
	armsrc/appmain.c
	armsrc/apps.h

Step 1 for the Ultralight / Ultralight-c
2015-01-20 20:59:24 +01:00
iceman1001 a631936e84 ADD: Midnitesnaks's & Pentura labs Ultralight-c modifications in ARMSRC.
ADD:  des.c  ,  aes.c  in ARMSRC
2015-01-13 23:18:04 +01:00
iceman1001 3de045905f ADD: a CmdEM410xWatchnSpoof in cmdlfem4x.c , looks for a tag, then replays it.
minor code clean up.
2015-01-08 00:16:33 +01:00
iceman1001 787b5bd8a4 CHG: minor code clean up in ArmSrc.
ADD: added some more default keys in Hf mf nested,  maybe it runs faster :)
2015-01-08 00:08:33 +01:00
iceman1001 52ab55ab0d ADD: added a lot of ic ids to cmdhf15.c Thanks to Asper for the list.
ADD: added a manufacturer list in "hf 14a reader",  only viable when UID is double or triple size.  Thanks to Asper for the list.
ADD: detect chinese magic backdoor commands in "hf 14a reader"
CHG: minor code clean up.
2015-01-07 21:06:15 +01:00
iceman1001 225ccb910e ADD: new defines: iso14443_CMD_AUTH_KEYA, iso14443_CMD_AUTH_KEYB, iso14443_CMD_AUTH_RESPONSE, iso14443_CMD_AUTH_STEP1, iso14443_CMD_AUTH_STEP2, CHINESE_BACKDOOR_INIT, CHINESE_BACKDOOR_STEP2,
REM: removed old comments in bootrom.c
CHG: mifare ultralight & desfire commands inside arm has been cleaned up. Next step is to refactor it into armsrc/mifaredesfire.c
2015-01-07 17:42:57 +01:00
iceman1001 e3ab50cafb CHG: rename the HF MFU * commands.
ADD: added a HF MFU INFO  commmand, where you can see some tag info. Used to be in the readcard command.
FIX: minor code clean up for ultralight & desfire commands in armsrc/mifarecmd.c, armsrc/mifaredesfire.c, armsrc/mifareutil.c
CHG: Lowered the default MF_DBGLEVEL, it set to MF_DBG_ERROR.
CHG: lowered a testing value for timeout in cmdhf14a.c
2015-01-06 17:43:31 +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
iceman1001 6ff6ade2f5 ADD: midnitesnakes desfire, ultralight changes from Unstable branch.
ADD: Marshmellows fixes for the LF (demods) commands,  (LF SEACH)
ADD: Holimans changes with hash1_brute

FIXES:  minor fixes with some calls to "free" and redundant debug statement and code cleanup. removal of commented code.
2014-12-31 11:35:43 +01:00
iceman1001 f5ed4d12de ADD: started with adding a LF AWID26 write function. not done yet.
ADD: latest pwpiwi & holiman changes.
2014-12-19 13:46:02 +01:00
iceman1001 a501c82b19 Applied Holiman's fixes for iclass.c and CSNs
Applied PwPiwi's new parity fix.
Applied Marshmellw's fixes for FSKdemod (HID, IO)

FIX: a potential bigbuffer fault given pwpiwi's change inside lfops.c CmdIOdemodFSK & CmdHIDdemodFSK
FIX: change some "int" parameters to uint's.
FIX: changed the lfops.c -  DoAcquisition125k_internal  to respect pwpiwi's definitions of FREE_BUFFER_OFFSET

HEADS up:  The ultralight functions hasn't been verified since pwpiwi's changes.
2014-12-17 20:33:21 +01:00
pwpiwi 6a1f2d82bb bugfixes iso14443a (hf 14a commands)
- buffers were too small to handle 256 byte frames
- parity bits were only handled for up to 32 byte frames
- trace format was inefficient
- removed parity calculation from decoders in iclass.c (parity not used on air anyway)
2014-12-16 07:41:07 +01:00
iceman1001 f38a152863 First check in. 2014-09-11 23:23:46 +02:00
pwpiwi baeaf57950 fix/add support for 4K (and other non 1K) card sizes in hf mf commands
- hf mf rdsc (fix): didn't account for 16 block sectors, allowed max sector 63 instead of 39
- hf mf ecfill (add): added (optional) card size parameter and support for non 1K cards
- hf mf dump (add): added (optional) card size parameter and support for non 1K cards
- hf mf dump (fix): Access Condition 011 not handled correctly (tried to access with key A)
- hf mf restore (add): added (optional) card size parameter and support for non 1K cards
- hf mf nested (fix): didn't account for 16 block sectors, allowed max sector 63 instead of 39
- hf mf nested (fix): always dumped 16 keys to dumpkeys.bin instead of correct number
- hf mf chk (fix): always dumped 16 keys to dumpkeys.bin instead of correct number
- hf mf eget (fix): displayed three instead of one block
- hf mf eload (add): load 4K .eml files (but accepts 1K .eml files for backwards compatibility)
- hf mf esave (add): always save the whole emulator memory (4K) instead of 1K only
- hf mf ecfill (add): added (optional) card size parameter and support for non 1K cards
2014-09-10 19:04:50 +02:00
roel@libnfc.org 981bd4292e integrated MIFARE ultralight features, contributed by 'midnitesnake' 2013-10-11 08:43:23 +00:00
micki.held@gmx.de 9492e0b098 Major rework of hf mf nested:
- PM: used GetCountMifare in MifareNested() for improved timing accuracy and to deliver better quality nonces
- PM: MifareNested now delivers exactly two different nonces to avoid time consuming multiple lfsr_recovery32() on client side
- Client: replaced quicksort by bucketsort in crapto1.c which is faster 
- Client: use multithreading (two parallel calls to lfsr_recovery32())
- Client: fixed a small bug in mfnested() (always showed trgkey=0)
- Client: introduced a mutex for PrintAndLog() to avoid interlaced printing
Minor rework of hf mf chk:
- Avoid time consuming off/on cycles. Send a "halt" instead.
2013-09-15 09:33:17 +00:00
Merlokbr@gmail.com b62a5a8444 small improvements, added new command hf mf sniff (there will be cool sniffer). But now... here is optimized hf 14a snoop. As I see it works the same as th old version. 2012-07-06 16:19:05 +00:00
Merlokbr@gmail.com 0675f200e6 Added work with "magic Chinese" card (card from: ouyangweidaxian@live.cn) with wipe support). Change UID and wipe only. 2012-07-05 07:31:56 +00:00
douniwan5788 aea4d76687 Enhanced hf mf chk , add default key,support dic file and so on.
modify hf mf mifare to automatically use an invalid key'nt try again.
make some changes to support mifare classic 4k.
2012-05-30 03:45:55 +00:00
Merlokbr@gmail.com 0014cb46da 1. emulator works. tested on ARC1302, NXP pegoda, touchtag, my firm's readers.
2. added increment, decrement, restore, transfer commands
3. fixed several small bugs and small code cleaning
4. there is strange behavier in the emulator: for 7BUID is seems that there is must be a feature that cam make work card withouth 2nd anticollision loop. NXP reader authenticates, but cant read card contents. all the rest readers works, BUT.... my 7BUID mifare card dont work AT ALL  .... I dont know what i should do )
2011-06-25 13:03:01 +00:00
Merlokbr@gmail.com 8556b852ed 1. updated usb commands
2. added abilities to: clear, get, set, load from card, load from nested card emulator dump
3. tried to fix proxmark promt have seen everywhere (not so good)
4. reorganized arm code
2011-06-17 18:39:54 +00:00
Merlokbr@gmail.com 8f51ddb0bd 1. fixed send manchester
2. emulator commands select, authenticate, read block, write block works
3. nested authentication - not working (maybe next release)
4. small bugfixes
5. mifare1ksim - in alpha state!!! code not so clear!!!
2011-06-16 14:43:49 +00:00
Merlokbr@gmail.com 9ca155ba44 0. its alpha version!!!
1. commands changed from "hf 14a" to "hf mf" 
2. some code cleaning and small bugfixes
3. alpha version hf mf sim
4. added internal function GetTickCount() for time measuring
2011-06-10 13:35:10 +00:00
Merlokbr@gmail.com f397b5cc87 1. fixed hf 14a mifare. added functionality to ignore one Nt
2. completed hf 14a nested
3. added hf 14a chk to check keys
5. added check keys to hf 14a mifare and hf 14a nested
6. added debug level to mifare commands
7. small bugs and improvements
2011-06-07 12:35:52 +00:00
Merlokbr@gmail.com f89c705002 improved version of "hf 14a mifare" command
with merge with utility nonce2key
2011-05-31 11:31:20 +00:00
Merlokbr@gmail.com 4abe4f5867 nested authentication works ok (tested)
and code cleaning
2011-05-26 15:20:03 +00:00
Merlokbr@gmail.com 20f9a2a1d5 1. Mifare read block command
2. Mifare read sector (via 1)
3. Mifare write block
4. fixed several bugs in iso 14443 select
added
Issue 23
Issue 26
2011-05-26 12:55:15 +00:00