Commit graph

63 commits

Author SHA1 Message Date
Michael Farrell
2bb7f7e327 Fixes a double-free issue in CloseProxmark: (#617)
- CloseProxmark now clears global state.

- CloseProxmark now checks for a non-null serial_port before calling uart_close, to avoid unintentional double-free'ing serial_port.

- main now calls CloseProxmark once.
2018-06-04 13:54:41 +02:00
pwpiwi
ad939de501
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
2018-06-03 14:25:20 +02:00
pwpiwi
818efbebb8
USB comms: part 3 towards @micolous PR#463
* 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)
2018-04-28 10:09:16 +02:00
pwpiwi
61aaee35cc
USB comms: part 2 towards @micolous PR#463 (#595)
* 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
2018-04-24 08:27:29 +02:00
pwpiwi
f5ecd97b15
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
2018-03-31 09:52:43 +02:00
Michael Farrell
a5a830168f OSX: Multiple libedit/readline fixes (#585)
* OSX: Multiple libedit/readline fixes.
2018-03-21 16:05:03 +01:00
pwpiwi
f921c113c9 add force_align_arg_pointer attribute to all callback functions
* inspired by issue #404 and respective fix PR #538
* possible fix for mysterious crashes, e.g. issue #497 and http://www.proxmark.org/forum/viewtopic.php?id=5388
2018-01-31 18:31:51 +01:00
pwpiwi
3851172d81 Revert "Comms refactor (prerequisite of libproxmark work) (#371)" (#450)
This reverts commit afdcb8c159.
2017-10-27 09:56:46 +02:00
Michael Farrell
afdcb8c159 Comms refactor (prerequisite of libproxmark work) (#371)
* Refactor the comms code only from PR#346, without comms_globals.h.
* OSX: Add note for example serial port
2017-10-26 21:54:27 +02:00
Philippe Teuwen
8a50d60617 Flush stdout when waiting for /dev/ttyACM0 2017-10-24 14:10:52 +02:00
pwpiwi
23af9327a5 fix hw status (and USB comm in general) (#434)
* don't ignore ReadLine() errors (Windows)
* lock CmdBuffer with Mutex
* refactor WaitForResponseTimeoutW
2017-10-24 07:48:38 +02:00
Oleg Moiseenko
aa757f71d9 proxmark3 refactoring command line parameters (#417)
* add -c (execute command from command line)
* fix: sometimes proxmark executes command twice...
* fix: start proxmark from QT was in a strange way (if we issue command very fast - it hangs)
* added -l (execute lua script)
* rework help
* small memory management bugfix
* small fix in executing command files
* enable piping from STDIN
2017-10-20 06:49:53 +02:00
uzlonewolf
c6c0449105 Don't try to display the GUI when running in textmode (#387)
* Don't try to display the GUI when running in textmode

* Updated textmode fix to always run the GUI under Windows
2017-08-27 12:09:39 +02:00
Michael Farrell
067bfc8b76 Refactoring uart interface (#341)
* uart: Major cleanups
- Adds documentation to the uart API.
- Fixes a buffer overflow issue in `uart_receive`, where the maximum parameter was ignored.
- Splits the maximum length and bytes recieved variables in `uart_receive`.
- Downsizes the receive buffer to the minimum required, saving 16MiB of RAM at runtime.
- Refactors the POSIX and Win32 implementations of uart into separate files.
- Removes the unused `uart_{get,set}_parity` functions, which were not implemented on Win32.
2017-07-05 20:22:02 +02:00
pwpiwi
5acd195d0f fixing the crash on exit 2017-06-04 09:30:49 +02:00
marshmellow42
1a3c006469 maybe fixed loading/unloading bug. 2017-04-14 09:53:36 -04:00
pwpiwi
4a6bc37e70 fix missing terminating 0 in my_executable_directory (thanks @iceman1001).
fix warning about const used twice in get_my_executable_path() and get_my_executable_directory().
2017-04-10 18:44:27 +02:00
pwpiwi
acf0582d53 Provide msclock() as Milliseconds timer for performance measures (#231)
- don't use clock(). It has different functionalities in Windows and Linux
- move sleep functions to util.h
2017-03-12 15:06:27 +01:00
pwpiwi
4197a3f6ff Make LUA scripting work even if proxmark3 is called from arbitrary working directory
- add @gpakosz whereami library (https://github.com/gpakosz/whereami) in order to ...
- determine and set absolute paths for LUA scripts and LUA libraries
2017-02-23 18:37:34 +01:00
pwpiwi
2487dfeb07 fix: .history was never written 2015-11-06 11:34:43 +01:00
pwpiwi
8e074056ac also delete *.bin and fpga_compressor when "make clean".
Add target to make fpga_compressor when client is not yet compiled.
Get version information and cache it when client starts (avoids clearing
BigBuf when calling hw version).
Add some comments and remove debugging printouts.
Add version info and ChangeLog in modified zlib.
2015-05-26 18:12:40 +02:00
iceman1001
002c1ce57a CHG: removed leftover debugging statements proxmark3.c
CHG: hint from Marshmellow that the flag "-lcrypto" needs be also in CFLAGS.
2015-01-07 11:10:46 +01:00
iceman1001
9484ff3d6e ADD: tnp3xxx identification in luascripts.
CHG: minor code clean up.
2015-01-06 21:20:41 +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 Swende
07976a256d Refactoring low frequency operations, now 'lf hid fskdemod' is more stable. Also did changes to handling ioprox tags, this is yet untested, so until it's been tested it should be kept off 'stable' branch 2014-03-31 17:57:14 +02:00
Philippe Teuwen
dec8e8bd9f Provide option -m for markdown help dump, -h for text dump 2014-03-26 23:50:34 +01:00
Philippe Teuwen
6f5dd6010e Fix description in help dump 2014-03-26 22:44:25 +01:00
Martin Holst Swende
57c695563f Fixes to implement generation of markdown auto-generated documentation 2014-03-26 22:39:37 +01:00
Philippe Teuwen
ae7aa73dd5 Add option -h to dump complete set of supported commands
Usage: ./proxmark3 -h
Display both offline & online commands, online commands are flagged.

git-svn-id: https://proxmark3.googlecode.com/svn/trunk@850 ef4ab9da-24cd-11de-8aaa-f3a34680c41f
2014-03-26 22:33:11 +01:00
martin.holst@gmail.com
da9d456e9f Minor fix, sometimes when data is sent without the pm3 is connected, it causes a spin-loop condition to occur which blocks the processor. fixed 2013-11-06 18:32:11 +00:00
roel@libnfc.org
981bd4292e integrated MIFARE ultralight features, contributed by 'midnitesnake' 2013-10-11 08:43:23 +00:00
martin.holst@gmail.com
ed77aabe00 Patch from 'buzzy' to add automatic flushing of output, see http://www.proxmark.org/forum/viewtopic.php?id=1740 for more details. 2013-10-08 18:30:01 +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
martin.holst@gmail.com
c338502409 Applied patch from http://www.proxmark.org/forum/viewtopic.php?id=1637, where a compiler optimization resulted in hangs 2013-06-05 08:53:20 +00:00
martin.holst@gmail.com
5f91a683b7 Added some documentation regarding ports on linux 2013-05-11 12:33:04 +00:00
roel@libnfc.org
4890730a5f fixed crash, when proxmark was claimed by other process 2013-03-26 16:01:52 +00:00
roel@libnfc.org
2d7fc168a2 fixed missing header file 2013-03-21 11:38:48 +00:00
roel@libnfc.org
759c16b31f client should compile without warnings on linux, mac, windows 2013-03-14 15:03:04 +00:00
roel@libnfc.org
9d8f56e35d fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part4 2013-02-28 22:49:34 +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
50d6e4abc1 douniwan5788: 2013-02-28 16:04:21 +00:00
roel@libnfc.org
ab4da50d99 added automatically saving the hitag2 memory content to file 2012-12-09 21:25:29 +00:00
roel@libnfc.org
fe7bfa7856 Windows7 working now! ugly fix for inaccurate Windows timer, quickfix for receiving multiple frames 2012-12-07 12:51:19 +00:00
roel@libnfc.org
f0ba634221 receiving/sending moved to one thread 2012-12-07 12:22:05 +00:00
roel@libnfc.org
1282b0e691 minor output change 2012-12-07 09:51:22 +00:00
roel@libnfc.org
af65f5f71d fixed read uart for windows 2012-12-07 07:21:00 +00:00
roel@libnfc.org
902cb3c00b major USB update 2012-12-04 23:39:18 +00:00
zveriu@gmail.com
1f947c4b09 - Added very basic scripting support to PM3 client-side (proxmark3 application)
- Created several scripts to aid in EML/MFD file conversion
 - Created script which generates PM3-scripts for emulation based on MFD/EML input files
2011-09-01 09:03:20 +00:00
Merlokbr@gmail.com
51969283ec 1. fixed (it seems) readline behavior. Now there is no proxmark3 prompts on the data.
2. emulator goes into beta stage.
works:
- work with 4BUID and 7BUID dumps
- load/save/grab dumps
- emulate select
- emulate authentication (with nested)
- emulate read/write blocks
- emulate NACK-ACK ping-pong
2011-06-23 16:49:39 +00:00
Merlokbr@gmail.com
ab8b654efa added functionality: dump card memory, save|load card memory.
50% fixed problem with readline lib
2011-06-22 01:25:16 +00:00