mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
Merge branch 'RfidResearchGroup:master' into master
This commit is contained in:
@@ -9,7 +9,7 @@ jobs:
|
||||
- name: Changelog Reminder
|
||||
uses: peterjgrainger/action-changelog-reminder@v1.2.0
|
||||
with:
|
||||
changelog_regex: '/CHANGELOG.md'
|
||||
changelog_regex: 'CHANGELOG.md'
|
||||
customPrMessage: 'You are welcome to add an entry to the CHANGELOG.md as well'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
|
||||
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
|
||||
|
||||
## [unreleased][unreleased]
|
||||
- Changed the PM3 client to honor the preferences dump/trace paths. experimental support (@iceman1001)
|
||||
- Added the possibility to load `.MCT` dump files (@iceman1001)
|
||||
- Changed `lf t55xx dump --ns` - now supports `no save` of memory (@iceman1001)
|
||||
- Fixed the USB enumeration process (@wh201906)
|
||||
- Fixed `hf mf rdsc` - now correctly gets size in bytes when sector is larger than 32 (@iceman1001)
|
||||
@@ -50,6 +52,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
|
||||
- Added `hf legic einfo` - views emulator menory (@0xdeb)
|
||||
- Changed `hf legic view` - now also print the decoded info of the dump file (@0xdeb)
|
||||
- Now `script run hf_mf_ultimatecard.lua -u` supports 10bytes UID (@alejandro12120)
|
||||
- Update documentation for installation on macOS with MacPorts (@linuxgemini)
|
||||
|
||||
## [Nitride.4.16191][2023-01-29]
|
||||
- Changed `build_all_firmwares.sh` to fit GENERIC 256kb firmware images (@doegox)
|
||||
|
||||
+210
-248
File diff suppressed because it is too large
Load Diff
+14
-17
@@ -56,15 +56,16 @@ typedef enum {
|
||||
EML,
|
||||
JSON,
|
||||
DICTIONARY,
|
||||
MCT,
|
||||
} DumpFileType_t;
|
||||
|
||||
int fileExists(const char *filename);
|
||||
//bool create_path(const char *dirname);
|
||||
|
||||
// set a path in the path list g_session.defaultPaths
|
||||
bool setDefaultPath(savePaths_t pathIndex, const char *path);
|
||||
|
||||
char *newfilenamemcopy(const char *preferredName, const char *suffix);
|
||||
char *newfilenamemcopyEx(const char *preferredName, const char *suffix, savePaths_t save_path);
|
||||
|
||||
/**
|
||||
* @brief Utility function to save data to a binary file. This method takes a preferred name, but if that
|
||||
@@ -104,7 +105,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t
|
||||
* @return 0 for ok, 1 for failz
|
||||
*/
|
||||
int saveFileJSON(const char *preferredName, JSONFileType ftype, uint8_t *data, size_t datalen, void (*callback)(json_t *));
|
||||
int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data, size_t datalen, bool verbose, void (*callback)(json_t *));
|
||||
int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data, size_t datalen, bool verbose, void (*callback)(json_t *), savePaths_t e_save_path);
|
||||
int saveFileJSONroot(const char *preferredName, void *root, size_t flags, bool verbose);
|
||||
int saveFileJSONrootEx(const char *preferredName, void *root, size_t flags, bool verbose, bool overwrite);
|
||||
/** STUB
|
||||
@@ -141,20 +142,6 @@ int saveFilePM3(const char *preferredName, int *data, size_t datalen);
|
||||
*/
|
||||
int createMfcKeyDump(const char *preferredName, uint8_t sectorsCnt, sector_t *e_sector);
|
||||
|
||||
/**
|
||||
* @brief Utility function to load data from a binary file. This method takes a preferred name.
|
||||
* E.g. dumpdata-15.bin
|
||||
*
|
||||
* @param preferredName
|
||||
* @param suffix the file suffix. Including the ".".
|
||||
* @param data The data array to store the loaded bytes from file
|
||||
* @param maxdatalen the number of bytes that your data array has
|
||||
* @param datalen the number of bytes loaded from file
|
||||
* @return PM3_SUCCESS for ok, PM3_E* for failz
|
||||
*/
|
||||
int loadFile(const char *preferredName, const char *suffix, void *data, size_t maxdatalen, size_t *datalen);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Utility function to load data from a binary file. This method takes a preferred name.
|
||||
* E.g. dumpdata-15.bin, tries to search for it, and allocated memory.
|
||||
@@ -176,9 +163,19 @@ int loadFile_safeEx(const char *preferredName, const char *suffix, void **pdata,
|
||||
* @param datalen the number of bytes loaded from file
|
||||
* @return 0 for ok, 1 for failz
|
||||
*/
|
||||
int loadFileEML(const char *preferredName, void *data, size_t *datalen);
|
||||
int loadFileEML_safe(const char *preferredName, void **pdata, size_t *datalen);
|
||||
|
||||
/**
|
||||
* @brief Utility function to load data from a textfile (MCT). This method takes a preferred name.
|
||||
* E.g. dumpdata-15.mct
|
||||
*
|
||||
* @param preferredName
|
||||
* @param data The data array to store the loaded bytes from file
|
||||
* @param datalen the number of bytes loaded from file
|
||||
* @return 0 for ok, 1 for failz
|
||||
*/
|
||||
int loadFileMCT_safe(const char *preferredName, void **pdata, size_t *datalen);
|
||||
|
||||
/**
|
||||
* @brief Utility function to load data from a JSON textfile. This method takes a preferred name.
|
||||
* E.g. dumpdata-15.json
|
||||
|
||||
+4
-1
@@ -236,11 +236,14 @@ static int check_segs(flash_file_t *ctx, int can_write_bl, uint32_t flash_size)
|
||||
}
|
||||
|
||||
static int print_and_validate_version(struct version_information_t *vi) {
|
||||
if (vi->magic != VERSION_INFORMATION_MAGIC)
|
||||
if (vi->magic != VERSION_INFORMATION_MAGIC) {
|
||||
return PM3_EFILE;
|
||||
}
|
||||
|
||||
char temp[PM3_CMD_DATA_SIZE - 12]; // same limit as for ARM image
|
||||
FormatVersionInformation(temp, sizeof(temp), "", vi);
|
||||
PrintAndLogEx(SUCCESS, _CYAN_("ELF file version") _YELLOW_(" %s"), temp);
|
||||
|
||||
if (strlen(g_version_information.armsrc) == 9) {
|
||||
if (strncmp(vi->armsrc, g_version_information.armsrc, 9) != 0) {
|
||||
PrintAndLogEx(WARNING, _RED_("ARM firmware does not match the source at the time the client was compiled"));
|
||||
|
||||
@@ -122,17 +122,18 @@ int preferences_save(void) {
|
||||
PrintAndLogEx(INFO, "Saving preferences...");
|
||||
|
||||
char *fn = prefGetFilename();
|
||||
int fnLen = strlen(fn) + 5; // .bak\0
|
||||
int fn_len = strlen(fn) + 5; // .bak\0
|
||||
|
||||
// [FILENAME_MAX+sizeof(preferencesFilename)+10]
|
||||
char *backupFilename = (char *)calloc(fnLen, sizeof(uint8_t));
|
||||
char *backupFilename = (char *)calloc(fn_len, sizeof(uint8_t));
|
||||
if (backupFilename == NULL) {
|
||||
PrintAndLogEx(ERR, "failed to allocate memory");
|
||||
free(fn);
|
||||
return PM3_EMALLOC;
|
||||
}
|
||||
snprintf(backupFilename, fnLen, "%s.bak", fn);
|
||||
snprintf(backupFilename, fn_len, "%s.bak", fn);
|
||||
|
||||
// remove old backup file
|
||||
if (fileExists(backupFilename)) {
|
||||
if (remove(backupFilename) != 0) {
|
||||
PrintAndLogEx(FAILED, "Error - could not delete old settings backup file \"%s\"", backupFilename);
|
||||
@@ -142,6 +143,7 @@ int preferences_save(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// rename file to backup file
|
||||
if (fileExists(fn)) {
|
||||
if (rename(fn, backupFilename) != 0) {
|
||||
PrintAndLogEx(FAILED, "Error - could not backup settings file \"%s\" to \"%s\"", fn, backupFilename);
|
||||
@@ -154,8 +156,9 @@ int preferences_save(void) {
|
||||
uint8_t dummyData = 0x00;
|
||||
size_t dummyDL = 0x01;
|
||||
|
||||
if (saveFileJSON(fn, jsfCustom, &dummyData, dummyDL, &preferences_save_callback) != PM3_SUCCESS)
|
||||
if (saveFileJSONex(fn, jsfCustom, &dummyData, dummyDL, true, &preferences_save_callback, spItemCount) != PM3_SUCCESS) {
|
||||
PrintAndLogEx(ERR, "Error saving preferences to \"%s\"", fn);
|
||||
}
|
||||
|
||||
free(fn);
|
||||
free(backupFilename);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<a id="Top"></a>
|
||||
|
||||
# Mac OS X - MacPorts automatic installation
|
||||
<b><h3>These insturctions won't work on Apple Silicon yet!</h3> An arm64 native build of arm-none-eabi-gcc is still not available (as of 2021-11-26).</b>
|
||||
|
||||
# Table of Contents
|
||||
- [Mac OS X - MacPorts automatic installation](#mac-os-x---macports-automatic-installation)
|
||||
@@ -23,70 +22,82 @@
|
||||
|
||||
1. Have MacPorts installed. Visit https://www.macports.org/ for more information.
|
||||
|
||||
* MacPorts may require a bit more setup. You first need to set up your PATH variable:
|
||||
|
||||
```bash
|
||||
export "/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:$PATH"
|
||||
```
|
||||
|
||||
For a somewhat seamless development environment:
|
||||
|
||||
```bash
|
||||
export C_INCLUDE_PATH="/opt/local/include"
|
||||
export CPLUS_INCLUDE_PATH="/opt/local/include"
|
||||
export LIBRARY_PATH="/opt/local/lib"
|
||||
export LDFLAGS="-L/opt/local/lib"
|
||||
export CFLAGS="-I/opt/local/include"
|
||||
export CPPFLAGS="-isystem/opt/local/include -I/opt/local/include"
|
||||
```
|
||||
|
||||
## Installing latest releases
|
||||
## Installing stable releases directly
|
||||
^[Top](#top)
|
||||
|
||||
Packaging for latest releases are available on MacPorts with the port name `proxmark3-iceman`, with a variant for PM3GENERIC firmwares available as `+pm3generic`.
|
||||
Packaging for latest releases are available on MacPorts with the port name [`proxmark3-iceman`](https://ports.macports.org/port/proxmark3-iceman/details/), with a variant for PM3GENERIC firmwares available as `+pm3generic`.
|
||||
|
||||
Installing is as simple as `sudo port install proxmark3-iceman` and if you want to install for PM3GENERIC, you can run `sudo port install proxmark3-iceman +pm3generic` instead.
|
||||
|
||||
|
||||
## Build from source
|
||||
^[Top](#top)
|
||||
|
||||
These instructions will show how to setup the environment on OSX to the point where you'll be able to clone and compile the repo by yourself, as on Linux, Windows, etc.
|
||||
|
||||
1. Have MacPorts installed. See above for details.
|
||||
1. Have MacPorts installed. Visit https://www.macports.org/ for more information.
|
||||
|
||||
* Since you're going to compile directly; this will require a bit more setup, you first need to set up your PATH variable (we assume your MacPorts prefix is located at its default, which is `/opt/local`) in your shell rc file:
|
||||
|
||||
```bash
|
||||
export MACPORTS_PREFIX="/opt/local"
|
||||
# we assume you'll use GNU coreutils; which is also a required dependency for proxmark3
|
||||
# install it with `sudo port install coreutils`
|
||||
export "$MACPORTS_PREFIX/libexec/gnubin:$MACPORTS_PREFIX/bin:$MACPORTS_PREFIX/sbin:$PATH"
|
||||
```
|
||||
|
||||
For a somewhat seamless development environment, you can use these in your shell rc file:
|
||||
|
||||
```bash
|
||||
export C_INCLUDE_PATH="$MACPORTS_PREFIX/include:$C_INCLUDE_PATH"
|
||||
export CPLUS_INCLUDE_PATH="$MACPORTS_PREFIX/include:$CPLUS_INCLUDE_PATH"
|
||||
export LIBRARY_PATH="$MACPORTS_PREFIX/lib:$LIBRARY_PATH"
|
||||
export LDFLAGS="-L$MACPORTS_PREFIX/lib $LDFLAGS"
|
||||
export CFLAGS="-I$MACPORTS_PREFIX/include $CFLAGS"
|
||||
export CPPFLAGS="-isystem$MACPORTS_PREFIX/include -I$MACPORTS_PREFIX/include $CPPFLAGS"
|
||||
export PKG_CONFIG_PATH="$MACPORTS_PREFIX/lib/pkgconfig:$MACPORTS_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
|
||||
```
|
||||
|
||||
2. Install dependencies:
|
||||
|
||||
```
|
||||
sudo port install readline qt5 qt5-qtbase pkgconfig arm-none-eabi-gcc arm-none-eabi-binutils lua52 coreutils openssl@3
|
||||
```bash
|
||||
sudo port install readline jansson lua52 python311 bzip2 openssl11 arm-none-eabi-gcc arm-none-eabi-binutils coreutils qt5 qt5-qtbase pkgconfig
|
||||
```
|
||||
|
||||
3. Clamp Python version for pkg-config
|
||||
|
||||
MacPorts doesn't handle Python version defaults when it comes to pkg-config. So even if you have done:
|
||||
|
||||
```
|
||||
sudo port install python39 cython39
|
||||
```bash
|
||||
sudo port install python311 cython311
|
||||
|
||||
sudo port select --set python python39 # this also makes calls to "python" operate on python3.9
|
||||
sudo port select --set python3 python39
|
||||
sudo port select --set cython cython39
|
||||
sudo port select --set python python311 # this also makes calls to "python" operate on python3.11
|
||||
sudo port select --set python3 python311
|
||||
sudo port select --set cython cython311
|
||||
```
|
||||
|
||||
This won't set a default python3.pc (and python3-embed.pc) under the MacPorts pkgconfig includes folder.
|
||||
|
||||
To fix that, follow these steps:
|
||||
|
||||
```
|
||||
```bash
|
||||
cd /opt/local/lib/pkgconfig
|
||||
sudo ln -svf python3.pc python-3.9.pc
|
||||
sudo ln -svf python3-embed.pc python-3.9-embed.pc
|
||||
sudo ln -svf python3.pc python-3.11.pc
|
||||
sudo ln -svf python3-embed.pc python-3.11-embed.pc
|
||||
```
|
||||
|
||||
_Or_ you can use a framework definition in your shell rc file:
|
||||
|
||||
```bash
|
||||
export MACPORTS_FRAMEWORKS_DIR="$MACPORTS_PREFIX/Library/Frameworks"
|
||||
export PYTHON_FRAMEWORK_DIR="$MACPORTS_FRAMEWORKS_DIR:/Python.framework/Versions/3.11"
|
||||
export PKG_CONFIG_PATH="$PYTHON_FRAMEWORK_DIR:$PKG_CONFIG_PATH"
|
||||
```
|
||||
|
||||
4. (optional) Install makefile dependencies:
|
||||
|
||||
```
|
||||
sudo port install recode
|
||||
sudo port install astyle
|
||||
```bash
|
||||
sudo port install recode astyle
|
||||
```
|
||||
|
||||
|
||||
@@ -103,7 +114,7 @@ cd proxmark3
|
||||
|
||||
Now you're ready to follow the [compilation instructions](/doc/md/Use_of_Proxmark/0_Compilation-Instructions.md).
|
||||
From there, you can follow the original instructions.
|
||||
_Take extra note to instructions if you don't have a Proxmark3 RDV4 device._
|
||||
_Take extra note to instructions if you **don't** have a Proxmark3 RDV4 device._
|
||||
|
||||
To flash on OS X, better to enter the bootloader mode manually, else you may experience errors.
|
||||
|
||||
@@ -125,4 +136,3 @@ If you want to manually select serial port, remember that the Proxmark3 port is
|
||||
```sh
|
||||
proxmark3 /dev/ttyACM0 => proxmark3 /dev/tty.usbmodemiceman1
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user