mirror of
https://github.com/RfidResearchGroup/ChameleonUltra.git
synced 2026-05-12 11:22:59 -07:00
feat: moved docs to wiki and added useful gitignore
This commit is contained in:
+709
-4
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,3 +1,3 @@
|
||||
Copyright of each contribution is tracked by the Git history.
|
||||
See the output of `git shortlog -nse` for a full list or `git log --pretty=short --follow <path/to/sourcefile> |git shortlog -ne` to track a specific file.
|
||||
See also [the Contributors page on Github](https://github.com/RfidResearchGroup/ChameleonUltra/graphs/contributors).
|
||||
See also [the Contributors page on Github](https://github.com/ChameleonUltra/ChameleonUltra/graphs/contributors).
|
||||
|
||||
@@ -16,7 +16,7 @@ Anywhere else: [Sneaktechnology](https://sneaktechnology.com) / [Aliexpress by R
|
||||
|
||||
# What is it and how to use ?
|
||||
|
||||
Read the [available documentation](docs/README.md).
|
||||
Read the [available documentation](https://github.com/ChameleonUltra/ChameleonUltra/wiki).
|
||||
|
||||
# Compatible applications
|
||||
|
||||
@@ -29,7 +29,8 @@ Read the [available documentation](docs/README.md).
|
||||
|
||||
* [Downloading and compiling the official CLI](https://www.youtube.com/watch?v=VGpAeitNXH0)
|
||||
* [Downloading ChameleonUltraGUI](https://www.youtube.com/watch?v=rHH7iqbX3nY)
|
||||
* [ChameleonGUI features overview](https://www.youtube.com/watch?v=YqE8wyVSse4)
|
||||
* [ChameleonUltraGUI features overview](https://www.youtube.com/watch?v=YqE8wyVSse4)
|
||||
* [Using ChameleonUltraGUI and the Chameleon Ultra](https://www.youtube.com/watch?v=9jtKNJ5-kVY)
|
||||
* [MTools BLE - How to clone a card with ChameleonUltra](https://youtu.be/IvH-xtdW1Wk?si=4exqgAAeJ-kxU3aN)
|
||||
|
||||
# Official channels
|
||||
|
||||
+1
-35
@@ -1,37 +1,3 @@
|
||||
# Chameleon Ultra Guide
|
||||
|
||||
This guide goal is to guide you through setting up and using your Chameleon Ultra and Lite.
|
||||
|
||||
This Guide is split up into multiple "subguides":
|
||||
|
||||
### About the device
|
||||
|
||||
- [Whitepaper](./technical_whitepaper.md): Discover what the Chameleon Ultra is capable of.
|
||||
|
||||
- [Hardware](./hardware.md): Learn to know the hardware of your Chameleon.
|
||||
|
||||
- [Firmware](./firmware.md): Your Chameleon runs a firmware, learn what it can do and how to use it.
|
||||
|
||||
### Interacting with the device
|
||||
|
||||
- [Quickstart](./quickstart.md): For the impatient people to just get you up and running with anything.
|
||||
|
||||
- [CLI](./cli.md): The official way to control your Chameleon is via the **C**ommand **L**ine **I**nterface (CLI). Learn how to install and master the CLI.
|
||||
|
||||
- [GUIs](./gui.md): Some people also develop **G**raphical **U**ser **I**nterfaces (GUIs), these may be a good start for people that do not want to deal with a CLI.
|
||||
|
||||
- [Troubleshooting](./troubleshooting.md): For when things go wrong, here are some common tips to maybe fix whatever issue you might have.
|
||||
|
||||
### For developers
|
||||
|
||||
- [Development](./development.md): For all developers. This covers how to build firmware from source and set up a development environment.
|
||||
|
||||
- [SDKs](./sdk.md): SDKs for Chameleon, useful if you want to develop your own application to control Chameleon.
|
||||
|
||||
- [Protocol](./protocol.md): The gory details of the communication protocol, useful if you want to develop your own client.
|
||||
|
||||
### Miscellaneous
|
||||
|
||||
- [Modding](./modding.md): Third party moddings worth mentioning.
|
||||
|
||||
- [FAQ](./faq.md): **F**requently **A**sked **Q**uestions, if you have a question, it might already be answered here.
|
||||
The docs have moved! [Wiki](https://github.com/ChameleonUltra/ChameleonUltra/wiki)
|
||||
@@ -1,150 +0,0 @@
|
||||
## Get ChameleonUltraGUI
|
||||
|
||||
- [on Google Play](https://play.google.com/store/apps/details?id=io.chameleon.ultra) / [APK](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/apk.zip)
|
||||
- [on iOS](https://apps.apple.com/dk/app/chameleon-ultra-gui/id6462919364)
|
||||
- [on Windows](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows-installer.zip) ([or without installer](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows.zip))
|
||||
- [on Linux](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux.zip)
|
||||
- [on macOS](https://apps.apple.com/app/chameleon-ultra-gui/id6462919364)
|
||||
|
||||
## Page Breakdown
|
||||
|
||||
### Homepage
|
||||

|
||||
|
||||
Starting from the top left, you find
|
||||
|
||||
- the *Device Name*: `Chameleon Ultra` or `Chameleon Lite` depending on the device connected ;
|
||||
- the *Disconnect* button: pressing this icon cleanly disconnects the Chameleon. It is recommended to use this button whenever possible ;
|
||||
- the *Connected Port*: it tells you where and how the chameleon is connected, followed by how it is connected (*Connection Method*), which displays a USB or Bluetooth icon ;
|
||||
- the *Battery Charge* icon: you can press it long to get more details. Note that it is refreshed only when reopening the Homepage ;
|
||||
- the *Used Slots*: it displays how many out of the 8 slots are used ;
|
||||
- the *Slot Changer*: the currently selected slot is highlighted with a red circle, while enabled slots are filled in. Everything else is a hollow circle. The arrows left and right allow you to change the currently selected slot ;
|
||||
- the *Firmware version*: the version is pulled from the device displayed, as well as git commit information ;
|
||||
- the *Check for updates* button: it compares the firmware with the one available on GitHub and then updates if a newer version is available ;
|
||||
- the *Switch mode* button: use it to switch between reader and emulator modes. The icon will update accordingly ;
|
||||
- the *Device Setting* button: it allows you to change settings concerning the device, like changing the animation mode.
|
||||
|
||||
### Device settings
|
||||

|
||||

|
||||
|
||||
Top to bottom:
|
||||
- *Enter DFU mode*: to enter the device DFU mode. Allows the user to take over ;
|
||||
- *Flash latest FW via DFU*: download the newest firmware from GitHub, disregarding if the device is already up to date, and flash it ;
|
||||
- *Flash .zip FW via DFU*: it allows the user to select a zip they would like to flash to the device ;
|
||||
- *Animations*: choose if the device should play the boot-up animation when woken up by an external RFID field ;
|
||||
- *Button config*: it allows you to define both short-press and long-press actions
|
||||
- *BLE pairing* toggle: you can decide whether pairing with a BLE PIN is required or not. Enabling PIN increases security at the loss of convenience. You can define a *BLE PIN* once pairing is enabled and you can force forgetting about existing pairings with the *Clear bounded devices* option.
|
||||
- *Reset settings*: it resets all device settings but does not wipe user data.
|
||||
- *Factory reset*: **IT WIPES ALL USER DATA** and resets the device to factory settings.
|
||||
|
||||
### Slot Manager
|
||||

|
||||
|
||||
The *Slot Manager* consists of 8 cards representing the 8 slots on the device.
|
||||
|
||||
The *RFID icon* in the top left corner can either be green or red, meaning the slot is enabled and disabled respectively.
|
||||
|
||||
The *Credit Card icon* displays the name and card type of the HF card in the slot.
|
||||
The *Wi-Fi icon*, on the other hand, displays the name and card type of the LF card in the slot.
|
||||
|
||||
The *Gear icon* opens the slot settings. These settings can be changed per slot.
|
||||
|
||||
The entire card is also one big button, pressing anywhere on the card opens the select dialog for loading a card.
|
||||
|
||||
### Slot Settings
|
||||

|
||||

|
||||
|
||||
The two rows at the top, labeled HF and LF respectively, display the names of the currently loaded cards. Next to them, the *X* clears them out of the slot. If both are empty, the slot will automatically be disabled.
|
||||
|
||||
Under *Slot Status* you can set if the slot is enabled or disabled.
|
||||
|
||||
The *Mifare Classic emulator settings* section allows you to toggle various behaviors:
|
||||
- *Gen1A Magic Mode*: behaves like a gen1a magic card and allows writing to it using magic commands like the Proxmark3 `cload` ;
|
||||
- *Gen2 Magic Mode*: behaves like a gen2 magic card, makes Block 0 writable ;
|
||||
- *Use UID/SAK/ATQA from 0 block*: the Chameleon Ultra stores the UID and other anti-collision data independently of the card content. Enabling this setting tells the Chameleon to derive them from card content block 0. Only for MFC with 4-byte UID ;
|
||||
- *Collect nonces (Mfkey32)*: it toggles nonce collection for mfkey32. When enabled you will be prompted to present the Chameleon to a reader. After you have collected nonces the *Present Chameleon to reader* message will change into a *Recover Keys from x nonces* button. Pressing this will start the recovery process ;
|
||||
- *Write mode*: Please refer to the [firmware docs](./firmware.md).
|
||||
|
||||
### Search dialog
|
||||

|
||||
|
||||
When using the GUI you may encounter a *Search* dialog. The dialog is structured as follows:
|
||||
|
||||
Top left you find the *Back* button, this will abort the selection and bring you back.
|
||||
|
||||
Near the end of the row, if it is a card search dialog, a filter option will show. This allows you to filter between *HF*, *LF* and *All* cards.
|
||||
|
||||
At the end you find a *X*, this X will clear the query.
|
||||
|
||||
You enter the query into the *textbox* on the top with the placeholder text "Search"
|
||||
|
||||
The search results get listed below. The Card or Wi-Fi symbol indicates if it is LF/HF. The color of the Icon is the user-defined color.
|
||||
|
||||
Listed also are the name and type.
|
||||
|
||||
Selecting the entry automatically closes the search.
|
||||
|
||||
### Saved Cards
|
||||

|
||||
|
||||
The *Saved Cards* page allows you to manage your cards and dictionaries.
|
||||
|
||||
You import a card or dictionary by clicking the *+* button in their respective half. This opens a select dialog. You may then either select a CUGUI Json file or a Bin file. A Json file gets imported immediately while a Bin file asks if the supplied data is correct before saving.
|
||||
|
||||
Once again, we got a card per card or dictionary. At the left you find the Icon for HF/LF with the user-defined color. To the left of that the card name, type and quick actions for edit, export and delete.
|
||||
|
||||
The Card is again one Big button, pressing it brings up the Slot info. It displays info about the selected item and also has the quick actions present at the bottom.
|
||||
|
||||

|
||||
|
||||
### Card Edit Menu
|
||||

|
||||

|
||||
|
||||
Depending on the selected card type the menu only displays options applicable to it.
|
||||
At the top of the menu is the name and icon. Pressing on the icon allows you to change the color.
|
||||
|
||||
Right below is the drop-down for the type. You may switch between any type at will.
|
||||
|
||||
A bit lower again you find the UID, SAK, ATQA, ATS and all other options for the selected type. This form auto-validates, so you should not be able to save a invalid config.
|
||||
|
||||
And finally at the bottom are the save and cancel options, to save the changes and exits, or to cancel the operation with no changes.
|
||||
|
||||
### Settings
|
||||

|
||||
|
||||
The App settings have their own page and consist of a few simple settings:
|
||||
- *Sidebar Expansion*: Whether or not the sidebar shall be expanded or if the windows size should decide that
|
||||
- *Theme*: Light/Dark or get it from the System
|
||||
- *Color Scheme*: Allows you to choose a color you like for the app
|
||||
- *Language*: Choose any of the languages available. Translating is done via our Crowding project.
|
||||
- *About*: Displays simple info about the app, such as build number, contributors and people who have donated on Opencollective
|
||||
- *Activate debug mode*: Don't, just Don't
|
||||
|
||||
## How to use MFKEY32
|
||||
|
||||
- set slot to MIFARE Classic (by uploading an empty dump)
|
||||
- enable mfkey32 for that slot (toggle in slot settings)
|
||||
- select slot and present ultra repeatedly to the reader in order to collect nonces
|
||||
- after collecting some nonces, go back into slot settings and click recover keys
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Font scaling issues on HiDPI screens
|
||||
|
||||
If you have font scaling issues (tiny fonts) with the Linux desktop app and a HiDPI screen, you can solve it by running the app as
|
||||
```
|
||||
GDK_SCALE=2 GDK_DPI_SCALE=0.5 /usr/local/lib/chameleonultragui/chameleonultragui
|
||||
```
|
||||
|
||||
### Key recovery from this card is not yet supported
|
||||
This error may occur when the card you are trying to recovery keys from is requiring a not yet supported recovery technology. You cannot tell the required recovery method from the outside.
|
||||
|
||||
You may be able to solve this issue by dumping the card with a Proxmark3 or Mifare Classic Tool (Mobile App) and then importing a bin file.
|
||||
|
||||
### Error: Invalid data length
|
||||
This error may occur on windows devices and seems to be a deeper bug in the serial library.
|
||||
|
||||
Reconnecting the device may solve it, also make sure that the App and Firmware are up to date.
|
||||
-211
@@ -1,211 +0,0 @@
|
||||
# CLI
|
||||
|
||||
The CLI (**C**ommand **L**ine **I**nterface) is the official way to control your Chameleon.
|
||||
|
||||
It requires at least **Python 3.9** version.
|
||||
|
||||
## Installing
|
||||
|
||||
There are multiple ways to install the CLI, depending on your OS.
|
||||
|
||||
### Windows
|
||||
|
||||
Windows users have the choice of 4 options:
|
||||
|
||||
#### ProxSpace
|
||||
|
||||
Using ProxSpace to build the CLI is the easiest and most comfortable way to get started.
|
||||
|
||||
1. Download ProxSpace from the [official GitHub](https://github.com/Gator96100/ProxSpace/releases/latest)
|
||||
|
||||
2. [Download 7zip](https://www.7-zip.org/) to extract the archive
|
||||
|
||||
3. Install 7zip by double clicking the Installer and clicking `Install`
|
||||
|
||||
4. Right-click on the downloaded archive and select `7zip -> Unpack to "ProxSpace"`
|
||||
|
||||
5. Open a terminal in the proxspace folder. If you are on a new Windows install, you should be able to just right-click and select `Open in Terminal`. If that option is not visible and the ProxSpace folder is still in your downloads folder, press `win+r` and type `powershell` followed by enter. In Powershell now type `cd ~/Downloads/ProxSpace`
|
||||
|
||||
6. Run the command `.\runme64.bat`. After successful completion, you should be dropped to the `pm3 ~ $` shell.
|
||||
|
||||
7. Clone the Repository by typing `git clone https://github.com/RfidResearchGroup/ChameleonUltra.git`
|
||||
|
||||
8. Now go into the newly created folder with `cd ChameleonUltra/software/src`
|
||||
|
||||
9. Prepare for package installation with `pacman-key --init; pacman-key --populate; pacman -S msys2-keyring --noconfirm; pacman-key --refresh`
|
||||
|
||||
10. Proceed by installing Ninja with `pacman -S ninja --noconfirm`
|
||||
|
||||
11. Build the required config by running `cmake .`
|
||||
|
||||
12. And the binaries with `cmake --build .`
|
||||
|
||||
13. Go into the script folder with `cd ~/ChameleonUltra/software/script/`
|
||||
|
||||
14. Install python requirements with `pip install -r requirements.txt`
|
||||
|
||||
15. Finally run the CLI with `python chameleon_cli_main.py`
|
||||
|
||||
To use after installing, just do the following:
|
||||
|
||||
1. Run `runme64.bat`
|
||||
|
||||
2. Go into the script folder with `cd ~/ChameleonUltra/software/script/`
|
||||
|
||||
3. Run the CLI with `python chameleon_cli_main.py`
|
||||
|
||||
#### WSL2
|
||||
|
||||
Coming Soon
|
||||
|
||||
#### WSL1
|
||||
|
||||
Coming Soon
|
||||
|
||||
#### Build Natively
|
||||
|
||||
Building natively is a bit more advanced and not recommended for beginners
|
||||
|
||||
1. Download and install [Visual Studio Community](https://visualstudio.microsoft.com/de/downloads/)
|
||||
|
||||
2. On the workload selection screen, choose the `Desktop development with C++` workload. Click `Download and Install`
|
||||
|
||||
3. Download and install [git](https://git-scm.com/download). When asked, add to your path
|
||||
|
||||
4. Download and install [cmake](https://cmake.org/download/). Again, when asked, add to your path
|
||||
|
||||
5. Download and install [python](https://www.python.org/downloads/). When asked, add to your path (small checkbox in the bottom left). Python 3.9 or above is required.
|
||||
|
||||
6. Choose a suitable location and open a terminal. Clone the repository with `git clone https://github.com/RfidResearchGroup/ChameleonUltra.git`
|
||||
|
||||
7. Change into the binaries folder with `cd ChameleonUltra/software/src`
|
||||
|
||||
8. Build the required config by running `cmake .`
|
||||
|
||||
9. And the binaries with `cmake --build .`
|
||||
|
||||
10. Copy the binaries by running `cp -r ../bin/Debug/* ../script/`
|
||||
|
||||
11. Go into the script folder with `cd ../script/`
|
||||
|
||||
12. Create a python virtual environment with `python -m venv venv`
|
||||
|
||||
13. Activate it by running `.\venv\Scripts\Activate.ps1`
|
||||
|
||||
14. Install python requirements with `pip install -r requirements.txt`
|
||||
|
||||
15. Finally run the CLI with `python chameleon_cli_main.py`
|
||||
|
||||
To run again after installing, just do the following:
|
||||
|
||||
1. Activate venv by running `.\venv\Scripts\Activate.ps1`
|
||||
|
||||
2. Run the CLI with `python chameleon_cli_main.py`
|
||||
|
||||
### MacOS
|
||||
|
||||
Requires [Homebrew](https://brew.sh/) to be installed.
|
||||
- If you don't have Homebrew installed on your macOS, open the Terminal and run:
|
||||
`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||
|
||||
See Linux/Macos instructions below for the rest.
|
||||
|
||||
### Linux / MacOS
|
||||
|
||||
Install the dependencies
|
||||
- Ubuntu / Debian:
|
||||
`sudo apt install git cmake build-essential python3-venv`
|
||||
- Arch:
|
||||
`sudo pacman -S git cmake base-devel python3`
|
||||
- MacOS:
|
||||
`brew install git cmake python3`
|
||||
|
||||
Python 3.9 or above is required.
|
||||
|
||||
Run the following script to clone the Repository, compile the tools and install Python dependencies in a virtual environment.
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
|
||||
git clone https://github.com/RfidResearchGroup/ChameleonUltra.git
|
||||
(
|
||||
cd ChameleonUltra/software/src
|
||||
mkdir -p out
|
||||
(
|
||||
cd out
|
||||
cmake ..
|
||||
cmake --build . --config Release
|
||||
)
|
||||
)
|
||||
(
|
||||
cd ChameleonUltra/software/script
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
pip3 install -r requirements.txt
|
||||
deactivate
|
||||
)
|
||||
```
|
||||
|
||||
To run the client after installing, do the following:
|
||||
|
||||
```sh
|
||||
cd ChameleonUltra/software/script
|
||||
source venv/bin/activate
|
||||
python3 chameleon_cli_main.py
|
||||
deactivate
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
When in the CLI, plug in your Chameleon and connect with `hw connect`. If autodetection fails, get the Serial Port used by your Chameleon and run `hw connect -p COM11` (Replace `COM11` with your serial port, on Linux it may be `/dev/ttyACM0`)
|
||||
|
||||
### MFKEY32v2 walk-through
|
||||
Make sure to be in the `software/` directory and run the Python CLI from there.
|
||||
|
||||
```sh
|
||||
# Connect to the CLI
|
||||
hw connect
|
||||
# Check which slot can be used
|
||||
hw slot list
|
||||
# Change the slot type, here using slot 8 for a MFC 1k emulation
|
||||
hw slot type -s 8 -t MIFARE_1024
|
||||
# Init the slot content
|
||||
hw slot init -s 8 -t MIFARE_1024
|
||||
# or load an existing dump and set UID and anticollision data,
|
||||
# cf 'hf mf eload' and 'hf mf econfig'
|
||||
# Enable the slot
|
||||
hw slot enable -s 8 --hf
|
||||
# Change to the new slot
|
||||
hw slot change -s 8
|
||||
# Activate the authentication logs
|
||||
hf mf econfig --enable-log
|
||||
```
|
||||
Now disconnect, go to a reader and swipe it a few times
|
||||
|
||||
Come back
|
||||
|
||||
```sh
|
||||
# connect to the CLI
|
||||
hw connect
|
||||
# See if nonces were collected. We need 2 nonces per key to recover
|
||||
hf mf elog
|
||||
# Recover the key(s) based on the collected nonces
|
||||
hf mf elog --decrypt
|
||||
# Clean the logged detection nonces
|
||||
hf mf econfig --disable-log
|
||||
```
|
||||
Output example:
|
||||
```
|
||||
- MF1 detection log count = 6, start download.
|
||||
- Download done (144bytes), start parse and decrypt
|
||||
- Detection log for uid [DEADBEEF]
|
||||
> Block 0 detect log decrypting...
|
||||
> Block 1 detect log decrypting...
|
||||
> Result ---------------------------
|
||||
> Block 0, A key result: ['a0a1a2a3a4a5', 'aabbccddeeff']
|
||||
> Block 1, A key result: ['010203040506']
|
||||
|
||||
```
|
||||
|
||||
|
||||
*More examples coming soon*
|
||||
@@ -1,376 +0,0 @@
|
||||
# Development
|
||||
|
||||
In this file you can look up how to [install requirements](#Prerequisites-for-compiling), [edit](#Editing-the-code), [compile](#Compiling-the-code) and [debug](#Debugging-the-code) the firmware!
|
||||
|
||||
## Prerequisites for compiling
|
||||
|
||||
### install a cross-compiler
|
||||
|
||||
So far, the following compilers have been reported to work fine.
|
||||
Download one of them and decompress it.
|
||||
Remember the path where you installed it.
|
||||
|
||||
- [gcc-arm-none-eabi-10.3-2021.10](https://developer.arm.com/downloads/-/gnu-rm)
|
||||
- [arm-gnu-toolchain-12.2.rel1-XXX-arm-none-eabi](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads), e.g. [arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz](https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz) for a x86_64 Linux host
|
||||
|
||||
Always use the official versions from ARM, *DO NOT* install `gcc-arm-none-eabi` from Debian/Ubuntu.
|
||||
For some unknown reasons, same gcc version from Debian creates a bootloader too large to fit in the allocated flash space.
|
||||
Moreover it does not contain the `gdb` debugger.
|
||||
|
||||
### install make
|
||||
|
||||
* **Debian/Ubuntu alike**
|
||||
* Open a terminal.
|
||||
* Run the following command to install Make: `sudo apt-get install build-essential`
|
||||
* **Windows using Chocolatey:**
|
||||
* Open a PowerShell terminal with administrator privileges.
|
||||
* If not yet installed, run the following command to install Chocolatey:
|
||||
``` Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) ```
|
||||
* In the same PowerShell terminal, run the following command to install Make using Chocolatey: `choco install make`
|
||||
* **macOS:**
|
||||
* Open a terminal.
|
||||
* If not yet installed, install Homebrew package manager by running the following command: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
|
||||
* Once Homebrew is installed, run the following command to install Make: `brew install make`
|
||||
|
||||
### install nRF tools
|
||||
|
||||
- Install nRF Util tool [nrfutil](https://www.nordicsemi.com/Products/Development-tools/nrf-util)
|
||||
- Move it to a known path like `C:\nrfutil\` or `/usr/local/bin/`
|
||||
- Add this path to the `PATH` Environment Variable if not yet there.
|
||||
- Install nRF Util packages:
|
||||
- `nrfutil install completion device nrf5sdk-tools trace`
|
||||
- Install [nRF Command Line Tools](https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download) to get `nrfjprog`, `mergehex` etc.
|
||||
|
||||
### install programmer tools
|
||||
|
||||
Depending on the hardware programmer you want to use, additional tools are needed.
|
||||
|
||||
- If you are using a J-Link:
|
||||
|
||||
- Install [Segger J-Link Software](https://www.segger.com/downloads/jlink)
|
||||
- alternatively, you can use openocd as described below
|
||||
- Note: a JLink OB (or a STLink reflashed as a JLink OB) will not work on a nRF.
|
||||
|
||||
- If you are using a ST-Link V2:
|
||||
|
||||
- Install [openocd](https://openocd.org/pages/getting-openocd.html)
|
||||
- If under Windows, install [ST-Link drivers](https://www.st.com/en/development-tools/stsw-link009.html), extract the zip and run `dpinst_amd64.exe`
|
||||
|
||||
### configure the project
|
||||
|
||||
- Edit `Makefile.defs`:
|
||||
- Change `GNU_INSTALL_ROOT` (path of previously installed Compiler `bin` folder)
|
||||
- Change `GNU_VERSION` (Version of the installed Compiler) (FIXME: is it really used?)
|
||||
- Change the other paths to match your system if needed
|
||||
- Don't forget to remove the `#` in front of the changed lines
|
||||
- Alternatively, if you are committing often code, it may be easier to leave `Makefile.defs` intact and to invoke `make` with the desired variables from a script, e.g. `make GNU_INSTALL_ROOT=../../../arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/`
|
||||
|
||||
## Editing the code
|
||||
|
||||
You can use [Visual Studio Code](https://code.visualstudio.com/download) to edit this project! Simply download and
|
||||
install it!
|
||||
|
||||
- Install the [C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) in VS-Code.
|
||||
- Install
|
||||
the [C++ Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools-extension-pack) in
|
||||
VS-Code.
|
||||
- Create a new IntelliSense Configuration:
|
||||
- press F1 in VS-Code and enter `C/C++: Edit Configurations (UI)`
|
||||
- Add a new Configuration and name it
|
||||
- Specify your Compiler path (path of previously installed Compiler `bin` folder)
|
||||
- Change IntelliSense mode to `gcc-arm (legacy)`
|
||||
- Add include path `${workspaceFolder}/**`
|
||||
|
||||
## Compiling the code
|
||||
|
||||
- Install prerequisites (for instructions have a look at [Prerequisites for compiling](#Prerequisites-for-compiling))
|
||||
- Run `build.sh` or try to execute its steps manually if your platform is not yet properly supported. Feedback is always welcome.
|
||||
|
||||
The script produces several images in `objects`.
|
||||
|
||||
* `fullimage.hex` to be used with a programmer over the SWD pins
|
||||
* `dfu-app.zip` and `dfu-full.zip` to be used with DFU mode
|
||||
|
||||
## Uploading the code in DFU mode
|
||||
|
||||
If the bootloader and the SoftDevice are already properly installed on the Chameleon, you can reflash it directly over DFU.
|
||||
|
||||
To set the device in DFU mode:
|
||||
|
||||
* you can use the Python client and issue the command `hw dfu`
|
||||
* you can use the script `resource/tools/enter_dfu.py` that does exactly the same but may be easier to call from your scripts
|
||||
* you can unplug the device, wait for it to sleep, then press the button B and plug it. If the application is bogus, this is the only way.
|
||||
|
||||
The LEDs 4 & 5 should blink green when in DFU mode.
|
||||
|
||||
To flash only the application (safer):
|
||||
|
||||
`nrfutil device program --firmware objects/dfu-app.zip --traits nordicDfu`
|
||||
|
||||
To flash everything (be sure to also have a JLink or ST-Link V2 programmer if something goes wrong):
|
||||
|
||||
`nrfutil device program --firmware objects/dfu-full.zip --traits nordicDfu`
|
||||
|
||||
Under Linux you can use the scripts `flash-dfu-app.sh` and `flash-dfu-full.sh`, they will put the device in DFU mode and flash it.
|
||||
|
||||
## Uploading the code with a programmer
|
||||
|
||||
Connect pins GND, SWC (swclk) and SWD (swdio) to your programmer.
|
||||
|
||||
With a JLink and `nrfjprog`
|
||||
|
||||
```
|
||||
# application only:
|
||||
nrfjprog -f nrf52 --program objects/application.hex --sectorerase --verify --reset
|
||||
# full:
|
||||
nrfjprog -f nrf52 --program objects/fullimage.hex --sectorerase --verify --reset
|
||||
```
|
||||
|
||||
With a JLink and `openocd`
|
||||
|
||||
```
|
||||
# application only:
|
||||
openocd -f interface/jlink.cfg -f target/nrf52.cfg -c "program objects/application.hex verify reset ; shutdown"
|
||||
# full:
|
||||
openocd -f interface/jlink.cfg -f target/nrf52.cfg -c "program objects/fullimage.hex verify reset ; shutdown"
|
||||
```
|
||||
|
||||
With a ST-Link V2 and `openocd`
|
||||
|
||||
```
|
||||
# application only:
|
||||
openocd -f interface/stlink.cfg -f target/nrf52.cfg -c "program objects/application.hex verify reset ; shutdown"
|
||||
# full:
|
||||
openocd -f interface/stlink.cfg -f target/nrf52.cfg -c "program objects/fullimage.hex verify reset ; shutdown"
|
||||
```
|
||||
|
||||
## Uploading the code over BLE
|
||||
|
||||
If you are adventurous it is possible to flash the device over BLE (DFU mode).
|
||||
|
||||
To put the device in DFU mode
|
||||
|
||||
* you can use the Python client and issue the command `hw dfu` **TODO:** this will be possible only when the client will be able to work over BLE...
|
||||
* you can use the script `resource/tools/enter_dfu_over_ble.py`
|
||||
|
||||
Once in DFU mode, the device will announce itself over BLE as `CU-xxxx` where xxxx are the last 2 bytes of the Device Serial Number.
|
||||
|
||||
Then use the official [nRF Device Firmware Update](https://www.nordicsemi.com/Products/Development-tools/nRF-Device-Firmware-Update) mobile application to flash one of the DFU images.
|
||||
|
||||
## Debugging the code from VSCode
|
||||
|
||||
- Install [Cortex-Debug](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) VS-Code Extension
|
||||
- Open `app_main.c`
|
||||
- Open the extension with `CTRL-SHIFT-D`
|
||||
- Klick on `create a launch.json file`
|
||||
- Select `Cortex-Debug`
|
||||
- Add this in the configuration bracket:
|
||||
|
||||
```
|
||||
{
|
||||
"cwd": "${workspaceFolder}",
|
||||
"executable": "${workspaceRoot}/firmware/objects/bootloader.out",
|
||||
"name": "Debug with JLink",
|
||||
"request": "launch",
|
||||
"type": "cortex-debug",
|
||||
"runToEntryPoint": "main",
|
||||
"showDevDebugOutput": "none",
|
||||
"servertype": "jlink",
|
||||
"device": "nrf52",
|
||||
"interface": "swd",
|
||||
"svdFile": "${workspaceRoot}/firmware/nrf52_sdk/modules/nrfx/mdk/nrf52.svd",
|
||||
},
|
||||
{
|
||||
"cwd": "${workspaceFolder}",
|
||||
"executable": "${workspaceRoot}/firmware/objects/bootloader.out",
|
||||
"name": "Debug with STLink",
|
||||
"request": "launch",
|
||||
"type": "cortex-debug",
|
||||
"runToEntryPoint": "main",
|
||||
"showDevDebugOutput": "none",
|
||||
"servertype": "openocd",
|
||||
"device": "nrf52",
|
||||
"svdFile": "${workspaceRoot}/firmware/nrf52_sdk/modules/nrfx/mdk/nrf52.svd",
|
||||
"gdbPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2021.10/bin/arm-none-eabi-gdb.exe",
|
||||
"configFiles": [
|
||||
"interface/stlink.cfg",
|
||||
"target/nrf52.cfg"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- If you are jlink probe, create `settings.json` in {projectRoot}/.vscode directory.
|
||||
|
||||
```
|
||||
{
|
||||
"cortex-debug.armToolchainPath": "C:\\UserProgram\\arm_gcc\\none\\bin",
|
||||
"cortex-debug.JLinkGDBServerPath": "C:\\Program Files\\SEGGER\\JLink\\JLinkGDBServerCL.exe",
|
||||
}
|
||||
```
|
||||
|
||||
- To change `executable` target in `launch.json` to `application` or `bootloader`
|
||||
- In the debug menu you can select `Debug with JLink` or `Debug with STLink`
|
||||
|
||||
## Debugging the code with gdb and openocd
|
||||
|
||||
See first if you can execute `arm-none-eabi-gdb` from the installed tools.
|
||||
|
||||
* gcc-arm-none-eabi-10.3-2021.10 gdb requires `libncurses5`
|
||||
* arm-gnu-toolchain-12.2.rel1 gdb requires Python 3.8
|
||||
|
||||
In case Python 3.8 is not available anymore on your distro, to install a local copy you can do
|
||||
|
||||
```
|
||||
wget https://www.python.org/ftp/python/3.8.17/Python-3.8.17.tgz
|
||||
tar zxvf Python-3.8.17.tgz
|
||||
cd Python-3.8.17
|
||||
./configure --prefix=$HOME/opt/python-3.8.17 --enable-shared
|
||||
make
|
||||
rm -rf ~/opt/python-3.8.17
|
||||
make install
|
||||
```
|
||||
|
||||
Connect openocd to the device with a JLink or a ST-Link V2
|
||||
|
||||
```
|
||||
openocd -f interface/jlink.cfg -f target/nrf52.cfg
|
||||
```
|
||||
|
||||
```
|
||||
openocd -f interface/stlink.cfg -f target/nrf52.cfg
|
||||
```
|
||||
|
||||
Then run gdb as follows
|
||||
|
||||
```
|
||||
PYTHONHOME=~/opt/python-3.8.17/ arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gdb
|
||||
```
|
||||
|
||||
and tell gdb to connect to openocd
|
||||
|
||||
```
|
||||
target extended-remote localhost:3333
|
||||
```
|
||||
|
||||
## BlackMagicProbe with RTT support, out of a ST-Link V2
|
||||
|
||||
You can reflash a ST-Link V2 to use it as a BlackMagicProbe, to get support for RTT and see NRF_LOG messages.
|
||||
Some clones have only 64kb, this is too short.
|
||||
Even 128kb is too small when enabling RTT, but we can comment parts of the BMP source code.
|
||||
|
||||
```
|
||||
git clone --recursive git@github.com:blackmagic-debug/stlink-tool.git
|
||||
( cd stlink-tool && make )
|
||||
```
|
||||
|
||||
Then put the `stlink-tool` binary in your path.
|
||||
|
||||
Get [BMP full sources](https://github.com/blackmagic-debug/blackmagic/releases)
|
||||
|
||||
Comment out all probes except Nordic nrf51 in `src/target/cortexm.c` big switch for probes. It should remain
|
||||
|
||||
```c
|
||||
switch (t->designer_code) {
|
||||
case JEP106_MANUFACTURER_NORDIC:
|
||||
PROBE(nrf51_probe);
|
||||
break;
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
make -j PROBE_HOST=stlink ST_BOOTLOADER=1 ENABLE_RTT=1
|
||||
```
|
||||
|
||||
Then flash the ST_Link V2
|
||||
|
||||
```
|
||||
stlink-tool src/blackmagic.bin
|
||||
```
|
||||
|
||||
See [src/platforms/stlink/README.md](https://github.com/blackmagic-debug/blackmagic/blob/main/src/platforms/stlink/README.md) for more details.
|
||||
Unplug/plug.
|
||||
Every time you plug the ST-Link, you have to run `stlink-tool` to enable BMP.
|
||||
Under linux, it is convenient to install [udev rules](https://github.com/blackmagic-debug/blackmagic/blob/main/driver/README.md#99-blackmagic-plugdevrules) to get aliases `/dev/ttyBmpGdb` and `/dev/ttyBmpTarg`.
|
||||
|
||||
Note that using a native ST-Link V2 with BlackMagicProbe "hosted" will not allow to see NRF_LOG messages.
|
||||
|
||||
## Debugging the code with gdb and BMP with RTT to monitor NRF_LOG
|
||||
|
||||
Assuming you have a BlackMagicProbe with RTT support made out of a ST-Link V2.
|
||||
|
||||
RTT usage: https://black-magic.org/usage/rtt.html
|
||||
|
||||
```
|
||||
stlink-tool
|
||||
sleep 1
|
||||
screen /dev/ttyBmpTarg
|
||||
```
|
||||
|
||||
In another terminal
|
||||
|
||||
```
|
||||
$ arm-none-eabi-gdb
|
||||
(gdb) target extended-remote /dev/ttyBmpGdb
|
||||
(gdb) monitor swdp_scan
|
||||
1 Nordic nRF52 M4
|
||||
2 Nordic nRF52 Access Port.
|
||||
(gdb) attach 1
|
||||
(gdb) monitor rtt
|
||||
```
|
||||
|
||||
We are now able to use gdb and see the NRF_LOG messages on the other terminal.
|
||||
|
||||
## Using JLink with RTT to monitor NRF_LOG
|
||||
|
||||
cf https://embeddedexplorer.com/nrf52-nrf-log-tutorial/
|
||||
|
||||
```
|
||||
JLinkExe -if SWD -device nrf52 -speed 4000 -autoconnect 1
|
||||
```
|
||||
|
||||
in a second terminal:
|
||||
|
||||
```
|
||||
JLinkRTTClient
|
||||
```
|
||||
|
||||
For Windows add these lines to the `tasks.json`:
|
||||
```json
|
||||
{
|
||||
"label": "logs",
|
||||
"type": "shell",
|
||||
"command": "C:\\WINDOWS\\System32\\cmd.exe",
|
||||
"args": ["/K", "C:\\Program Files\\SEGGER\\JLink\\JLinkRTTClient.exe"],
|
||||
"options": {
|
||||
"cwd": "C:\\Program Files\\SEGGER\\JLink"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "logger server",
|
||||
"type": "shell",
|
||||
"command": "C:\\WINDOWS\\System32\\cmd.exe",
|
||||
"args": ["/K", "C:\\Program Files\\SEGGER\\JLink\\JLink.Exe", "-if", "SWD", "-device", "nrf52", "-speed", "4000", "-autoconnect", "1"],
|
||||
"options": {
|
||||
"cwd": "C:\\Program Files\\SEGGER\\JLink"
|
||||
},
|
||||
"problemMatcher": []
|
||||
},
|
||||
```
|
||||
|
||||
|
||||
## Using SWO pin as UART to monitor NRF_LOG
|
||||
|
||||
One can set `NRF_LOG_UART_ON_SWO_ENABLED := 1` in `Makefile.defs` to activate this functionality.
|
||||
When activated, NRF_LOG will be available if one connects a UART bridge to the SWO pin which will work as a UART TX pin.
|
||||
UART works at 115200 bauds. E.g. one can use a FTDI dongle and `screen /dev/ttyUSB0 115200`.
|
||||
Contrary to RTT that needs to be activated by a JTAG probe, UART logs are immediately available.
|
||||
|
||||
Limitations:
|
||||
|
||||
* SWO pin is shared with... SWO so when e.g. reflashing the device, garbage may appear on the monitoring terminal.
|
||||
* SWO pin is also shared with the blue channel of the RGB slot LEDs, so faint blue may appear briefly when logs are sent and LED might not work properly when supposed to be blue.
|
||||
|
||||
# Resources
|
||||
|
||||
* [nRF52840 Objective Product Specification v0.5.1](https://infocenter.nordicsemi.com/pdf/nRF52840_OPS_v0.5.1.pdf)
|
||||
@@ -1,120 +0,0 @@
|
||||
# Firmware
|
||||
|
||||
The Chameleon flash contains several parts: the bootloader and its settings, the application, the user data and the SoftDevice.
|
||||
|
||||
NOTE: If you are a developer searching for the building instructions, look into [development](./development.md)
|
||||
|
||||
## The Bootloader
|
||||
|
||||
The bootloader is the lowest-level program running on your Chameleon. It is read-only and provides the DFU (**D**evice **F**irmware **U**pgrade) mode. The bootloader being read-only, it makes it really hard to brick your Chameleon. The flash also contains a special section to store bootloader settings required by the nRF to deal with upgrades. This is only a concern for developers.
|
||||
|
||||
|
||||
You enter DFU mode by of the following methods:
|
||||
|
||||
1. Physical button
|
||||
|
||||
- Disconnect the Chameleon and wait for it to enter sleep mode
|
||||
- Hold down the 🅑 button. If you are using Windows you have to wait about ~5s before next step.
|
||||
- Plug USB into a PC while still holding the button. If you are using Windows you have to wait about ~10s before next step.
|
||||
- Then release the 🅑 button
|
||||
|
||||
2. From CLI
|
||||
|
||||
- Execute the command `hw dfu`
|
||||
|
||||
3. From GUI
|
||||
|
||||
- Click on `Enter DFU mode`
|
||||
|
||||
4. From Shell
|
||||
|
||||
- Execute the script `resource/tools/enter_dfu.py`
|
||||
|
||||
The device stays in DFU mode for ~30s.
|
||||
While in DFU mode waiting for the update, the LEDs 4 and 5 blink alternatively green 🟢🟢.
|
||||
You can then perform firmware upgrades either via a GUI or the command line:
|
||||
|
||||
1. Download nRF Util from the [nRF website](https://www.nordicsemi.com/Products/Development-tools/nrf-util)
|
||||
|
||||
2. Open a Command Line / Terminal on your PC
|
||||
|
||||
3. Install the "device" toolkit by running `nrfutil install device`
|
||||
|
||||
4. Download the Chameleon firmware from [GitHub](https://github.com/RfidResearchGroup/ChameleonUltra/releases). At the moment it is better to take the *Development release* but beware bugs can occur. Choose `ultra-dfu-app.zip` for the Ultra or the Devkit, and `lite-dfu-app.zip` for the Lite.
|
||||
|
||||
5. Put your Chameleon into DFU mode and install the firmware with the following command: `nrfutil device program --firmware ultra-dfu-app.zip --traits nordicDfu` (keep in mind to change the filename if you are using a Lite).
|
||||
|
||||
Step 5: Alternatively you can connect the Chameleon over USB and use the script `firmware/flash-dfu-app.sh` which will take care of flipping it into DFU mode and flashing it with the adequate firmware.
|
||||
|
||||
While flashing firmware is in progress, the LEDs 4 and 5 should blink fast blue 🔵🔵 and the firmware update should be finished in a matter of seconds. Using DFU and performing a firmware update also helps recovering from most device-related issues.
|
||||
|
||||
If LEDs 4 and 5 are flashing slow red 🔴🔴, it indicates an issue with DFU. Try to unplug and plug again or unplug and wait for it to timeout and try again the whole procedure.
|
||||
|
||||
## The Application
|
||||
|
||||
The application is the piece of software being loaded by the bootloader. It communicates with the client, emulates, reads and writes cards, drives the LEDs, handles buttons and much more. The application is also writable, it is the piece of software being updated via DFU.
|
||||
|
||||
The communication with the application is either done via the CLI or a GUI. Communication can be done over USB or BLE (**B**luetooth **L**ow **E**nergy), although, at time of writing, only GUIs support BLE.
|
||||
|
||||
On boot, the application starts in emulation mode, so it can emulate up to 8 HF tags and up to 8 LF tags (one slot can handle both a HF and a LF).
|
||||
|
||||
The Chameleon can be awaken:
|
||||
|
||||
- by pressing a button
|
||||
- when it comes close to a HF or LF field, *only if* a card corresponding to that field (HF/LF) is loaded into the active slot.
|
||||
|
||||
The white LED labeled RF lights up when it detects a field, again only if the active slot supports it.
|
||||
|
||||
In some situations, it can be cumbersome to wait for the boot-up animation. This is configurable, cf e.g. the CLI command `hw settings animation -h`.
|
||||
|
||||
On a new Chameleon (or after a factory reset), 3 slots are defined, slot 1 holding both a HF and a LF:
|
||||
|
||||
- slot 1 LF: a EM4100 with UID `DEADBEEF88`
|
||||
- slot 1 HF: a MIFARE Classic 1k with UID `DEADBEEF`
|
||||
- slot 2 HF: a MIFARE Classic Ultralight with UID `04689571FA5C64`
|
||||
- slot 3 LF: a EM4100 with UID `DEADBEEF88`
|
||||
|
||||
When a slot is selected, the LED shows what type of card is loaded with the following color code:
|
||||
|
||||
- 🟢 HF card loaded
|
||||
- 🔵 LF card loaded
|
||||
- 🔴 Both HF and LF loaded
|
||||
|
||||
When a dual HF/LF slot is activated by an external field, it will turn green or blue according to the frequency.
|
||||
|
||||
The application controls the buttons. The behavior of the buttons is customizable via the CLI or a GUI. The default behavior is the following:
|
||||
|
||||
- 🅐 short press: Select previous slot
|
||||
|
||||
- 🅑 short press: Select next slot
|
||||
|
||||
- 🅐 long press: Copy LF or HF tag UID (only Ultra, not Lite)
|
||||
|
||||
- 🅑 long press: Copy LF or HF tag UID (only Ultra, not Lite)
|
||||
|
||||
*About UID copy*: the action depends on the current slot support. So to be able to copy an EM4100 LF tag, the slot must be configured firstly to emulate an EM4100 tag. And to be able to copy a HF 14a tag, the slot must be configured for the right type of HF tag. Only the UID will be copied, not the data.
|
||||
|
||||
The Chameleon also shows the following LED effects:
|
||||
|
||||
- Charging: 4 pulsing green lights
|
||||
|
||||
- CLI / GUI connected over USB: Chasing LEDs in the color of the selected slot (left to right for slots 1-4 and right to left for slots 5-8).
|
||||
|
||||
The device enters sleep mode after about 5s unless it is plugged in USB or if a client is connected over BLE. You can use the buttons to wake it up again. You can also press quickly a button during the sleep animation to keep the device awake.
|
||||
|
||||
## Write Modes
|
||||
- **Normal**: Behaves like any normal card
|
||||
- **Denied**: Read-only card, send NACK to write attempts
|
||||
- **Deceive**: Accepts write commands but don't change any data (reader thinks write was successful but when reading back, nothing changed)
|
||||
- **Shadow**: Accepts writes but reverts changes when device goes to sleep (reader can read and write like a normal card but changes are kept in RAM and are lost when the chameleon goes to sleep)
|
||||
|
||||
## The SoftDevice
|
||||
|
||||
A [SoftDevice](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52_softdevices.html) is a precompiled and linked binary software implementing a wireless protocol developed by Nordic Semiconductor.
|
||||
|
||||
We are using the [SoftDevice S140](https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52_softdevices.html) which implements a BLE Central and Peripheral protocol stack solution.
|
||||
|
||||
## The User Data
|
||||
|
||||
The Chameleon has a reserved space of memory and flash where it stores application settings, active slot and slots configurations and data. This will not be overwritten by DFU updates and the data will only be reset by either issuing `hw factory_reset --force` in the CLI or clicking `Factory reset` in a GUI.
|
||||
*Warning:* Settings and/or data might be reset to defaults if you downgrade the firmware version up to a version not supporting the newer format.
|
||||
@@ -1,8 +0,0 @@
|
||||
# GUIs
|
||||
|
||||
There are multiple GUIs to control your Chameleon, two are featured in this documentation.
|
||||
Note that in spite of what their name may suggest, all GUIs support both the Ultra and the Lite.
|
||||
|
||||
- [Chameleon Ultra GUI](./chameleonultragui.md) ([github](https://github.com/GameTec-live/ChameleonUltraGUI))
|
||||
|
||||
- [MTools Lite for iOS](https://shop.mtoolstec.com/mifare-classic-tool-for-ios)
|
||||
@@ -1,51 +0,0 @@
|
||||
# Hardware
|
||||
|
||||
The Chameleon comes in 3 Hardware variants, the Ultra, the Lite and the Devkit.
|
||||
|
||||
## The Ultra
|
||||
|
||||
The Chameleon Ultra comes in a black box with gold printing. This box has the following dimensions: 9.5 cm x 5.5 cm x 3.5 cm
|
||||
|
||||

|
||||
|
||||
The Box contains a foam pad, a USB cable that has a removable end to convert it to USB-C, a Proxgrind 3.5 hex screwdriver, 2 replacement screws and a keychain and the device itself.
|
||||
|
||||

|
||||
|
||||
The device itself features 4 screws holding it together, 2 buttons labeled `A` and `B`. The device consists of 2 PCBs (**P**rinted **C**ircuit **B**oards) and a plastic spacer, one contains the Electronic and the HF (**H**igh **F**requency), 13.56 MHz, antenna as well as the 8 LEDs indicating which slot is currently active and the other board features the Chameleon Ultra text, the screws and the LF (**L**ow **F**requency), 125KHz, antenna. The plastic spacer houses the battery as well as the ferrite pad which enables HF and LF emulation at the same time. It also has has the USB-C charging and data port and a hole for inserting the keychain loop. The Chameleon Ultra dimensions are: 2.4cm x 4cm x 8mm
|
||||
|
||||

|
||||
|
||||
## The Lite
|
||||
|
||||
The Chameleon Lite comes in a white box with blue printing. This box has the following dimensions: 9.5 cm x 6 cm x 3.5 cm
|
||||
|
||||

|
||||
|
||||
The Box contains a foam pad, a USB cable that has a removable end to convert it to USB-C and the device itself.
|
||||
|
||||

|
||||
|
||||
The device itself features 2 buttons labeled with arrows. The device consists of one PCB in a blue plastic housing. This one PCB contains the electronics and the HF antenna as well as the 8 LEDs indicating which slot is currently active, and the USB-C port. The LF antenna is glued onto the back of the PCB and is visible through the housing. The battery is soldered in place and the housing is held together by thin fragile pins which are easy to snap. It is not designed to be disassembled. The keychain loop is also relatively fragile, so be careful. The Chameleon Lites dimensions are: 3.6 cm x 6.1 cm x 0.8 cm
|
||||
|
||||

|
||||
|
||||
## The Devkit
|
||||
|
||||
Just like the Chameleon Ultra, the Devkit comes in a black box with gold printing. This box has the following dimensions: 12 cm x 8 cm x 3.5 cm
|
||||
|
||||

|
||||
|
||||
Again, just like the lite, the box contains a foam pad, a USB cable that has a removable end to convert it to USB-C and the device itself.
|
||||
|
||||

|
||||
|
||||
The device itself features 2 buttons labeled `A` and `B`. The device is made of only one PCB without a case. At the bottom of this PCB both the HF and LF coils are found. Because it is a Devkit, this Chameleon has its SWD (**S**ingle **W**ire **D**ebug) port and some testpoints exposed. (In the photos below, a pinheader is already soldered into the SWD port, this is not the case from factory) The Chameleon Devkit dimensions are: 5.3 cm x 8.5 cm x 1.1 cm (including rubber feet, battery and buttons. PCB thickness: 0,16 cm)
|
||||
|
||||

|
||||
|
||||
## What is the difference between the Lite and the Ultra/DevKit?
|
||||
|
||||
The Chameleon Ultra as well as the Devkit contain a second chip called [MFRC522 ](https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf). This chip allows the Chameleon to read and write to HF 14a tags. The Chameleon Lite does not contain this chip and therefore cannot read and write HF tags, it can only simulate some. The Chameleon Lite also swaps the big LIPO (**LI**thium **PO**lymer) battery with a smaller buttoncell. The Devkit is a Chameleon Ultra on a bigger PCB and with a bigger battery and some component differences such as a mechanical relay but which should not make any practical difference.
|
||||
|
||||
#
|
||||
@@ -1,4 +0,0 @@
|
||||
# Third party moddings
|
||||
|
||||
* [ChameleonUltra Keyring](https://www.printables.com/model/552739-chameleonultra-keyring), an extended frame for ChameleonUltra with a sturdy keyring loop.
|
||||
* [ChameleonUltra Wristband](https://www.thingiverse.com/thing:6153027), allows the user to wear the ChameleonUltra as a wristband.
|
||||
@@ -1,50 +0,0 @@
|
||||
# MTools BLE Introduction
|
||||
MTools BLE supports managing the ChamleonUltra, ChameleonLite and DevKits via BLE connections.
|
||||
## Downlaod Link
|
||||
- [MTools BLE on iOS](https://apps.apple.com/app/mtools-ble-rfid-reader/id1531345398)
|
||||
- [MTools BLE on Google Play](https://play.google.com/store/apps/details?id=com.mtoolstec.mtoolsLite)
|
||||
|
||||
## How to connect with Bluetooth in MTools BLE
|
||||
1. Click **A** or **B** button to power on.
|
||||
2. Click **Bluetooth List** icon in App to search devices.
|
||||
3. Click **Connect** button on the right to connect.
|
||||
|
||||
#### Notice for Bluetooth Connection
|
||||
1. Grant the Bluetooth permission of App on iOS.
|
||||
2. Allow Location permission to scan Bluetooth devices on Android.
|
||||
|
||||
## Features for ChameleonUltra
|
||||
### Slot Manager
|
||||
1. Fetch all slot status.
|
||||
2. Enable or disable Slots.
|
||||
3. Change LF and HF Slot name.
|
||||
4. Set LF and HF Tag Type.
|
||||
5. Delete and reset all slots.
|
||||
|
||||
### Reader
|
||||
1. Fast read LF and HF Tag.
|
||||
2. Simulate Mifare Classic Tag with UID, SAK, ATQA and empty dump.
|
||||
3. Simulate Mifare Ultralight Tag with UID, SAK, ATQA and empty dump.
|
||||
4. Simulate EM410X LF tag or manually set the ID then simulate.
|
||||
|
||||
### Mifare Classic Dump
|
||||
1. eRead full dump from current active slot to App.
|
||||
2. Upload full dump to current active slot and simulate.
|
||||
3. Read Mifare Mini, 1K, 2K, 4K dump from tag with known keys.
|
||||
4. Write Gen1A, Gen2, Gen3, Gen4 dump to tag with known keys.
|
||||
5. Format common and magic Mifare Classic tags.
|
||||
6. Modify block data and save to new dump file.
|
||||
|
||||
### Mifare Ultralight Dump
|
||||
1. eRead full dump from current active slot to App.
|
||||
2. Upload full dump to current active slot and simulate.
|
||||
3. Read Mifare Ultralight dump from tag.
|
||||
4. Write Mifare Ultralight dump to tag.
|
||||
|
||||
### Settings
|
||||
1. Set the Animation of LEDs.
|
||||
2. Set press and long press button of A and B.
|
||||
3. Set the **Mifare Classic Emulation** of current slot.
|
||||
4. Set the **Mifare Ultralight Emulation** of current slot.
|
||||
5. DFU Tool for updating firmware.
|
||||
6. Reset Chameleon Device.
|
||||
@@ -1,481 +0,0 @@
|
||||
# Protocol description
|
||||
|
||||
## Versioning
|
||||
|
||||
Global firmware+CLI versions are following the [semantic versioning](https://semver.org/) logic mostly regarding the protocol version, so third party clients (GUIs, mobile apps, SDKs) can rely on firmware version to know their level of compatibility.
|
||||
|
||||
Given a version number MAJOR.MINOR.PATCH, we will increment the:
|
||||
* MAJOR version when we are breaking the existing protocol format
|
||||
* MINOR version when we are extending the protocol format in a backward compatible manner (new commands,...)
|
||||
* PATCH version when we are releasing bugfixes not affecting the protocol description
|
||||
|
||||
Besides compatibility with a given firmware version, third party clients may choose to offer to the users the possibility to follow a stable release channel (installing only tagged releases) or the development channel (installing latest commits).
|
||||
|
||||
For the stable channel, a client compatible with versions X.y.z can accept any version > X.y'.z' but should refuse to work with a version X'>X.
|
||||
|
||||
For the development channel, a client compatible with versions X.y.z can accept any latest commit unless a tag X'.0.0 with X'>X is present in the repo, indicating that the corresponding commit and all the commits above are incompatible with the client version. There is still a non negligible risk that breaking changes are pushed while forgetting about putting a new tag, or artefacts being built before the tag being pushed. Here be dragons... It's always a good practice for the client to validate whatever data is transmitted by the firmware, and fail gracefully in case of hiccups.
|
||||
|
||||
Cf [GET_APP_VERSION](#1000-get_app_version) and [GET_GIT_VERSION](#1017-get_git_version).
|
||||
|
||||
When `GET_GIT_VERSION` returns only a tag and no commit hash info (on a release tag), one can query the corresponding hash with the GitHub API, e.g.
|
||||
```
|
||||
"4747d3884d21e0df8549e3029a920ea390e0b00a"
|
||||
```
|
||||
## Frame format
|
||||
|
||||
The communication between the firmware and the client is made of frames structured as follows:
|
||||
|
||||

|
||||
|
||||
- **SOF**: `1 byte`, "**S**tart-**O**f-**F**rame byte" represents the start of a packet, and must be equal to `0x11`.
|
||||
- **LRC1**: `1 byte`, LRC over `SOF` byte, therefore must be equal to `0xEF`.
|
||||
- **CMD**: `2 bytes`, each command have been assigned a unique number (e.g. `DATA_CMD_SET_SLOT_TAG_NICK` = `1007`).
|
||||
- **STATUS**: `2 bytes`.
|
||||
- From client to firmware, the status is always `0x0000`.
|
||||
- From firmware to client, the status is the result of the command.
|
||||
- **LEN**: `2 bytes`, length of the `DATA` field, maximum is `512`.
|
||||
- **LRC2**: `1 byte`, LRC over `CMD|STATUS|LEN` bytes.
|
||||
- **DATA**: `LEN bytes`, data to be sent or received, maximum is `512 bytes`. This payload depends on the exact command or response to command being used. See [Packet payloads](#packet-payloads) below.
|
||||
- **LRC3**: `1 byte`, LRC over `DATA` bytes.
|
||||
|
||||
Notes:
|
||||
* The same frame format is used for commands and for responses.
|
||||
* All values are **unsigned** values, and if more than one byte, in **network byte order**, aka [Big Endian](https://en.wikipedia.org/wiki/Endianness) byte order.
|
||||
* The total length of the packet is `LEN + 10` bytes, therefore it is between `10` and `522` bytes.
|
||||
* The LRC ([**L**ongitudinal **R**edundancy **C**heck](https://en.wikipedia.org/wiki/Longitudinal_redundancy_check)) is the 8-bit two's-complement value of the sum of all bytes modulo $2^8$.
|
||||
* LRC2 and LRC3 can be computed equally as covering either the frame from its first byte or from the byte following the previous LRC, because previous LRC nullifies previous bytes LRC computation.
|
||||
E.g. LRC3(DATA) == LRC3(whole frame)
|
||||
|
||||
## Data payloads
|
||||
|
||||
Each command and response have their own payload formats.
|
||||
|
||||
Standard response status is `STATUS_SUCCESS` for general commands, `STATUS_HF_TAG_OK` for HF commands and `STATUS_LF_TAG_OK` for LF commands.
|
||||
See [Guidelines](#new-data-payloads-guidelines-for-developers) for more info.
|
||||
|
||||
Beware, slots in protocol count from 0 to 7 (and from 1 to 8 in the CLI...).
|
||||
|
||||
In the following list, "CLI" refers to one typical CLI command using the described protocol command. But it's not a 1:1 match, there can be other protocol commands used by the CLI command and there can be other CLI commands using the same protocol command...
|
||||
|
||||
### 1000: GET_APP_VERSION
|
||||
* Command: no data
|
||||
* Response: 2 bytes: `version_major|version_minor`
|
||||
* CLI: cf `hw version`
|
||||
### 1001: CHANGE_DEVICE_MODE
|
||||
* Command: 1 byte. `0x00`=emulator mode, `0x01`=reader mode
|
||||
* Response: no data
|
||||
* CLI: cf `hw mode`
|
||||
### 1002: GET_DEVICE_MODE
|
||||
* Command: no data
|
||||
* Response: data: 1 byte. `0x00`=emulator mode, `0x01`=reader mode
|
||||
* CLI: cf `hw mode`
|
||||
### 1003: SET_ACTIVE_SLOT
|
||||
* Command: 1 byte. `slot_number` between 0 and 7
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot change`
|
||||
### 1004: SET_SLOT_TAG_TYPE
|
||||
* Command: 3 bytes. `slot_number|tag_type[2]` with `slot_number` between 0 and 7 and `tag_type` according to `tag_specific_type_t` enum, U16 in Network byte order.
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot type`
|
||||
### 1005: SET_SLOT_DATA_DEFAULT
|
||||
* Command: 3 bytes. `slot_number|tag_type[2]` with `slot_number` between 0 and 7 and `tag_type` U16 according to `tag_specific_type_t` enum, U16 in Network byte order.
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot init`
|
||||
### 1006: SET_SLOT_ENABLE
|
||||
* Command: 3 bytes. `slot_number|sense_type|enable` with `slot_number` between 0 and 7, `sense_type` according to `tag_sense_type_t` enum and `enable` = `0x01` to enable, `0x00` to disable
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot enable`/`hw slot disable`
|
||||
### 1007: SET_SLOT_TAG_NICK
|
||||
* Command: 2+N bytes. `slot_number|sense_type|name[N]` with `slot_number` between 0 and 7, `sense_type` according to `tag_sense_type_t` enum and `name` a UTF-8 encoded string of max 32 bytes, no null terminator.
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot nick`
|
||||
### 1008: GET_SLOT_TAG_NICK
|
||||
* Command: 2 bytes. `slot_number|sense_type` with `slot_number` between 0 and 7 and `sense_type` according to `tag_sense_type_t` enum.
|
||||
* Response: a UTF-8 encoded string of max 32 bytes, no null terminator. If no nick name has been recorded in Flash, response status is `STATUS_FLASH_READ_FAIL`.
|
||||
* CLI: cf `hw slot nick`
|
||||
### 1009: SLOT_DATA_CONFIG_SAVE
|
||||
* Command: no data
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot store`
|
||||
### 1010: ENTER_BOOTLOADER
|
||||
* Command: no data
|
||||
* Response: this special command does not return and will interrupt the communication link while rebooting in bootloader mode, needed for DFU.
|
||||
* CLI: cf `hw dfu`
|
||||
### 1011: GET_DEVICE_CHIP_ID
|
||||
* Command: no data
|
||||
* Response: 8 bytes. nRF `DEVICEID[8]` U64 in Network byte order.
|
||||
* CLI: cf `hw chipid`
|
||||
### 1012: GET_DEVICE_ADDRESS
|
||||
* Command: no data
|
||||
* Response: 6 bytes. nRF `DEVICEADDR[6]` U48 in Network byte order. First 2 MSBits forced to `0b11` to match BLE static address.
|
||||
* CLI: cf `hw address`
|
||||
### 1013: SAVE_SETTINGS
|
||||
* Command: no data
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings store`
|
||||
### 1014: RESET_SETTINGS
|
||||
* Command: no data
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings reset`
|
||||
### 1015: SET_ANIMATION_MODE
|
||||
* Command: 1 byte, according to `settings_animation_mode_t` enum.
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings animation`
|
||||
### 1016: GET_ANIMATION_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte, according to `settings_animation_mode_t` enum.
|
||||
* CLI: cf `hw settings animation`
|
||||
### 1017: GET_GIT_VERSION
|
||||
* Command: no data
|
||||
* Response: n bytes, a UTF-8 encoded string, no null terminator.
|
||||
* CLI: cf `hw version`
|
||||
|
||||
Notes: the returned string is the output of `git describe --abbrev=7 --dirty --always --tags --match "v*.*"` so, depending on the status of the repo it can be
|
||||
* a short tag, e.g. `v2.0.0` if the firmware is built from the tagged commit
|
||||
* a longer tag indicating how far it is from the latest tag and 7 nibbles of its commit hash, prepended with `g`, e.g. 5 commits away from v2.0.0: `v2.0.0-5-g617d6d0`
|
||||
* a long tag finishing with `-dirty` if the local repo contains changes not yet committed, e.g. `v2.0.0-5-g617d6d0-dirty`
|
||||
### 1018: GET_ACTIVE_SLOT
|
||||
* Command: no data
|
||||
* Response: 1 byte
|
||||
* CLI: cf `hw slot list`
|
||||
### 1019: GET_SLOT_INFO
|
||||
* Command: no data
|
||||
* Response: 32 bytes, 8 tuples `hf_tag_type[2]|lf_tag_type[2]` according to `tag_specific_type_t` enum, for slots from 0 to 7, U16 in Network byte order.
|
||||
* CLI: cf `hw slot list`
|
||||
### 1020: WIPE_FDS
|
||||
* Command: no data
|
||||
* Response: no data. Status is `STATUS_SUCCESS` or `STATUS_FLASH_WRITE_FAIL`. The device will reboot shortly after this command.
|
||||
* CLI: cf `hw factory_reset`
|
||||
### 1021: DELETE_SLOT_TAG_NICK
|
||||
* Command: 2 bytes. `slot_number|sense_type` with `slot_number` between 0 and 7 and `sense_type` according to `tag_sense_type_t` enum.
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot nick`
|
||||
### 1023: GET_ENABLED_SLOTS
|
||||
* Command: no data
|
||||
* Response: 16 bytes, 8*2 bool = `0x00` or `0x01`, 2 bytes for each slot from 0 to 7, as `enabled_hf|enabled_lf`
|
||||
* CLI: cf `hw slot list`
|
||||
### 1024: DELETE_SLOT_SENSE_TYPE
|
||||
* Command: 2 bytes. `slot_number|sense_type` with `slot_number` between 0 and 7 and `sense_type` according to `tag_sense_type_t` enum.
|
||||
* Response: no data
|
||||
* CLI: cf `hw slot delete`
|
||||
### 1025: GET_BATTERY_INFO
|
||||
* Command: no data
|
||||
* Response: 3 bytes, `voltage[2]|percentage`. Voltage: U16 in Network byte order.
|
||||
* CLI: cf `hw battery`
|
||||
|
||||
Notes: wait about 5 seconds after wake-up, before querying the battery status, else the device won't be able to give a proper measure and will return zeroes.
|
||||
### 1026: GET_BUTTON_PRESS_CONFIG
|
||||
* Command: 1 byte. Char `A` or `B` (`a`/`b` tolerated too)
|
||||
* Response: 1 byte, `button_function` according to `settings_button_function_t` enum.
|
||||
* CLI: cf `hw settings btnpress`
|
||||
### 1027: SET_BUTTON_PRESS_CONFIG
|
||||
* Command: 2 bytes. `button|button_function` with `button` char `A` or `B` (`a`/`b` tolerated too) and `button_function` according to `settings_button_function_t` enum.
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings btnpress`
|
||||
### 1028: GET_LONG_BUTTON_PRESS_CONFIG
|
||||
* Command: 1 byte. Char `A` or `B` (`a`/`b` tolerated too)
|
||||
* Response: 1 byte, `button_function` according to `settings_button_function_t` enum.
|
||||
* CLI: cf `hw settings btnpress`
|
||||
### 1029: SET_LONG_BUTTON_PRESS_CONFIG
|
||||
* Command: 2 bytes. `button|button_function` with `button` char `A` or `B` (`a`/`b` tolerated too) and `button_function` according to `settings_button_function_t` enum.
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings btnpress`
|
||||
### 1030: SET_BLE_PAIRING_KEY
|
||||
* Command: 6 bytes. 6 ASCII-encoded digits.
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings blekey`
|
||||
### 1031: GET_BLE_PAIRING_KEY
|
||||
* Command: no data
|
||||
* Response: 6 bytes. 6 ASCII-encoded digits.
|
||||
* CLI: cf `hw settings blekey`
|
||||
### 1032: DELETE_ALL_BLE_BONDS
|
||||
* Command: no data
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings bleclearbonds`
|
||||
### 1033: GET_DEVICE_MODEL
|
||||
* Command: no data
|
||||
* Response: 1 byte. `hw_version` aka `NRF_DFU_HW_VERSION` according to `chameleon_device_type_t` enum (0=Ultra, 1=Lite)
|
||||
* CLI: cf `hw version`
|
||||
### 1034: GET_DEVICE_SETTINGS
|
||||
* Command: no data
|
||||
* Response: 14 bytes
|
||||
* `settings_current_version` = `5`
|
||||
* `animation_mode`, cf [GET_ANIMATION_MODE](#1016-get_animation_mode)
|
||||
* `btn_press_A`, cf [GET_BUTTON_PRESS_CONFIG](#1026-get_button_press_config)
|
||||
* `btn_press_B`, cf [GET_BUTTON_PRESS_CONFIG](#1026-get_button_press_config)
|
||||
* `btn_long_press_A`, cf [GET_LONG_BUTTON_PRESS_CONFIG](#1028-get_long_button_press_config)
|
||||
* `btn_long_press_B`, cf [GET_LONG_BUTTON_PRESS_CONFIG](#1028-get_long_button_press_config)
|
||||
* `ble_pairing_enable`, cf [GET_BLE_PAIRING_ENABLE](#1036-get_ble_pairing_enable)
|
||||
* `ble_pairing_key[6]`, cf [GET_BLE_PAIRING_KEY](#1031-get_ble_pairing_key)
|
||||
* CLI: unused
|
||||
### 1035: GET_DEVICE_CAPABILITIES
|
||||
* Command: no data
|
||||
* Response: 2*n bytes, a list of supported commands IDs.
|
||||
* CLI: used internally on connect
|
||||
### 1036: GET_BLE_PAIRING_ENABLE
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: cf `hw settings blepair`
|
||||
### 1037: SET_BLE_PAIRING_ENABLE
|
||||
* Command: 1 byte, bool = `0x00` or `0x01`
|
||||
* Response: no data
|
||||
* CLI: cf `hw settings blepair`
|
||||
### 2000: HF14A_SCAN
|
||||
* Command: no data
|
||||
* Response: N bytes: `tag1_data|tag2_data|...` with each tag: `uidlen|uid[uidlen]|atqa[2]|sak|atslen|ats[atslen]`. UID, ATQA, SAK and ATS as bytes.
|
||||
* CLI: cf `hf 14a scan`
|
||||
|
||||
Notes:
|
||||
* remind that if no tag is present, status will be `STATUS_HF_TAG_NO` and Response empty.
|
||||
* at the moment, the firmware supports only one tag, but get your client ready for more!
|
||||
* `atslen` must not be confused with `ats[0]`==`TL`. So `atslen|ats` = `00` means no ATS while `0100` would be an empty ATS.
|
||||
### 2001: MF1_DETECT_SUPPORT
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: cf `hf 14a info`
|
||||
### 2002: MF1_DETECT_PRNG
|
||||
* Command: no data
|
||||
* Response: 1 byte, according to `mf1_nested_type_t` enum
|
||||
* CLI: cf `hf 14a info`
|
||||
### 2003: MF1_STATIC_NESTED_ACQUIRE
|
||||
* Command: 10 bytes: `type_known|block_known|key_known[6]|type_target|block_target`. Key as 6 bytes.
|
||||
* Response: 4+N*8 bytes: `uid[4]` followed by N tuples of `nt[4]|nt_enc[4]`. All values as U32.
|
||||
* CLI: cf `hf mf nested` on static nonce tag
|
||||
### 2004: MF1_DARKSIDE_ACQUIRE
|
||||
* Command: 4 bytes: `type_target|block_target|first_recover|sync_max`. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: 1 byte if Darkside failed, according to `mf1_darkside_status_t` enum,
|
||||
else 33 bytes `darkside_status|uid[4]|nt1[4]|par[8]|ks1[8]|nr[4]|ar[4]`
|
||||
* `darkside_status`
|
||||
* `uid[4]` U32 (format expected by `darkside` tool)
|
||||
* `nt1[4]` U32
|
||||
* `par[8]` U64
|
||||
* `ks1[8]` U64
|
||||
* `nr[4]` U32
|
||||
* `ar[4]` U32
|
||||
* CLI: cf `hf mf darkside`
|
||||
### 2005: MF1_DETECT_NT_DIST
|
||||
* Command: 8 bytes: `type_known|block_known|key_known[6]`. Key as 6 bytes. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: 8 bytes: `uid[4]|dist[4]`
|
||||
* `uid[4]` U32 (format expected by `nested` tool)
|
||||
* `dist[4]` U32
|
||||
* CLI: cf `hf mf nested`
|
||||
### 2006: MF1_NESTED_ACQUIRE
|
||||
* Command: 10 bytes: `type_known|block_known|key_known[6]|type_target|block_target`. Key as 6 bytes. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: N*9 bytes: N tuples of `nt[4]|nt_enc[4]|par`
|
||||
* `nt[4]` U32
|
||||
* `nt_enc[4]` U32
|
||||
* `par`
|
||||
* CLI: cf `hf mf nested`
|
||||
### 2007: MF1_AUTH_ONE_KEY_BLOCK
|
||||
* Command: 8 bytes: `type|block|key[6]`. Key as 6 bytes. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: no data
|
||||
* Status will be `STATUS_HF_TAG_OK` if auth succeeded, else `STATUS_MF_ERR_AUTH`
|
||||
* CLI: cf `hf mf nested`
|
||||
### 2008: MF1_READ_ONE_BLOCK
|
||||
* Command: 8 bytes: `type|block|key[6]`. Key as 6 bytes. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: 16 bytes: `block_data[16]`
|
||||
* CLI: cf `hf mf rdbl`
|
||||
### 2009: MF1_WRITE_ONE_BLOCK
|
||||
* Command: 24 bytes: `type|block|key[6]|block_data[16]`. Key as 6 bytes. Type=0x60 for key A, 0x61 for key B.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf wrbl`
|
||||
### 2010: HF14A_RAW
|
||||
* Command: : 5+N bytes: `options|resp_timeout_ms[2]|bitlen[2]` followed by data to be transmitted, with `options` a 1-byte BigEndian bitfield, so starting from MSB:
|
||||
* `activate_rf_field`:1
|
||||
* `wait_response`:1
|
||||
* `append_crc`:1
|
||||
* `auto_select`:1
|
||||
* `keep_rf_field`:1
|
||||
* `check_response_crc`:1
|
||||
* `reserved`:2
|
||||
* Response: data sent by the card
|
||||
* CLI: cf `hf 14a raw`
|
||||
### 2011: MF1_MANIPULATE_VALUE_BLOCK
|
||||
* Command: 21 bytes: `src_type|src_block|src_key[6]|operator|operand[4]|dst_type|dst_block|dst_key[6]`. Key as 6 bytes. Type=`0x60` for key A, `0x61` for key B. Operator=`0xC0` for decrement, `0xC1` for increment, `0xC2` for restore. Operand as I32 in Network byte order.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf value`
|
||||
### 2012: MF1_CHECK_KEYS_OF_SECTORS
|
||||
* Command: 10+N*6 bytes: `mask[10]|keys[N][6]` (1<=N<=83)
|
||||
* `mask`: 40 sectors, 2 bits/sector, MSB: `0A|0B|1A|1B|...|39A|39B`. `0b1` represent to skip checking the key.
|
||||
* Response: 490 bytes: `found[10]|sectorKey[40][2][6]`.
|
||||
* `found`: 40 sectors, 2 bits/sector, MSB: `0A|0B|1A|1B|...|39A|39B`. `0b1` represent the key is found.
|
||||
* `sectorKey`: 40 sectors, 2 keys/sector, 6 bytes/key: `key0A[6]|key0B[6]|key1A[6]|key1B[6]|...|key39A[6]|key39B[6]`
|
||||
* CLI: cf `hf mf fchk`
|
||||
### 3000: EM410X_SCAN
|
||||
* Command: no data
|
||||
* Response: 5 bytes. `id[5]`. ID as 5 bytes.
|
||||
* CLI: cf `lf em 410x read`
|
||||
### 3001: EM410X_WRITE_TO_T55XX
|
||||
* Command: 9+N*4 bytes: `id[5]|new_key[4]|old_key1[4]|old_key2[4]|...` (N>=1). . ID as 5 bytes. Keys as 4 bytes.
|
||||
* Response: no data
|
||||
* CLI: cf `lf em 410x write`
|
||||
### 4000: MF1_WRITE_EMU_BLOCK_DATA
|
||||
* Command: 1+N*16 bytes: `block_start|block_data1[16]|block_data2[16]|...` (1<=N<=31)
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf eload`
|
||||
### 4001: HF14A_SET_ANTI_COLL_DATA
|
||||
* Command: N bytes: `uidlen|uid[uidlen]|atqa[2]|sak|atslen|ats[atslen]`. UID, ATQA, SAK and ATS as bytes.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`/`hf mfu econfig`
|
||||
### 4004: MF1_SET_DETECTION_ENABLE
|
||||
* Command: 1 byte, bool = `0x00` or `0x01`
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4005: MF1_GET_DETECTION_COUNT
|
||||
* Command: no data
|
||||
* Response: 4 bytes, `count[4]`, U32 in Network byte order.
|
||||
* CLI: cf `hf mf elog`
|
||||
### 4006: MF1_GET_DETECTION_LOG
|
||||
* Command: 4 bytes, `index`, U32 in Network byte order.
|
||||
* Response: N*18 bytes. 0<=N<=28
|
||||
* `block`
|
||||
* `...|is_nested|is_key_b` 1-byte bitfield, starting from LSB
|
||||
* `uid[4]` ?
|
||||
* `nt[4]` ?
|
||||
* `nr[4]` ?
|
||||
* `ar[4]` ?
|
||||
* CLI: cf `hf mf elog`
|
||||
### 4007: MF1_GET_DETECTION_ENABLE
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: cf `hw slot list`
|
||||
### 4008: MF1_READ_EMU_BLOCK_DATA
|
||||
* Command: 2 bytes: `block_start|block_count` with 1<=`block_count` <=32
|
||||
* Response: `block_count`*16 bytes
|
||||
* CLI: cf `hf mf eread`
|
||||
### 4009: MF1_GET_EMULATOR_CONFIG
|
||||
* Command: no data
|
||||
* Response: 5 bytes
|
||||
* `detection`, cf [MF1_GET_DETECTION_ENABLE](#4007-mf1_get_detection_enable)
|
||||
* `gen1a_mode`, cf [MF1_GET_GEN1A_MODE](#4010-mf1_get_gen1a_mode)
|
||||
* `gen2_mode`, cf [MF1_GET_GEN2_MODE](#4012-mf1_get_gen2_mode)
|
||||
* `block_anti_coll_mode`, cf [MF1_GET_BLOCK_ANTI_COLL_MODE](#4014-mf1_get_block_anti_coll_mode)
|
||||
* `write_mode`, cf [MF1_GET_WRITE_MODE](#4016-mf1_get_write_mode)
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4010: MF1_GET_GEN1A_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: unused
|
||||
### 4011: MF1_SET_GEN1A_MODE
|
||||
* Command: 1 byte, bool = `0x00` or `0x01`
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4012: MF1_GET_GEN2_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: unused
|
||||
### 4013: MF1_SET_GEN2_MODE
|
||||
* Command: 1 byte, bool = `0x00` or `0x01`
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4014: MF1_GET_BLOCK_ANTI_COLL_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte, bool = `0x00` or `0x01`
|
||||
* CLI: unused
|
||||
### 4015: MF1_SET_BLOCK_ANTI_COLL_MODE
|
||||
* Command: 1 byte, bool = `0x00` or `0x01`
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4016: MF1_GET_WRITE_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte, according to `nfc_tag_mf1_write_mode_t` aka `MifareClassicWriteMode` enum
|
||||
* CLI: unused
|
||||
### 4017: MF1_SET_WRITE_MODE
|
||||
* Command: 1 byte, according to `nfc_tag_mf1_write_mode_t` aka `MifareClassicWriteMode` enum
|
||||
* Response: no data
|
||||
* CLI: cf `hf mf econfig`
|
||||
### 4018: HF14A_GET_ANTI_COLL_DATA
|
||||
* Command: no data
|
||||
* Response: no data or N bytes: `uidlen|uid[uidlen]|atqa[2]|sak|atslen|ats[atslen]`. UID, ATQA, SAK and ATS as bytes.
|
||||
* CLI: cf `hw slot list`/`hf mf econfig`/`hf mfu econfig`
|
||||
### 4019: MF0_NTAG_GET_UID_MAGIC_MODE
|
||||
* Command: no data
|
||||
* Response: 1 byte where a non-zero value indicates that UID magic mode is enabled for the current slot.
|
||||
* CLI: cf `hf mfu econfig`
|
||||
### 4020: MF0_NTAG_SET_UID_MAGIC_MODE
|
||||
* Command: 1 byte where a non-zero value indicates that UID magic mode should be enabled for the current slot, otherwise disabled.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mfu econfig --enable-uid-magic`/`hf mfu econfig --disable-uid-magic`
|
||||
### 4021: MF0_NTAG_READ_EMU_PAGE_DATA
|
||||
* Command: 2 bytes: one for first page index, one for count of pages to be read.
|
||||
* Response: `4 * n` bytes where `n` is the number if pages to be read
|
||||
* CLI: cf `hf mfu eview`
|
||||
### 4022: MF0_NTAG_WRITE_EMU_PAGE_DATA
|
||||
* Command: 2 + `n * 4` bytes: one for first page index, one for count of pages to be read, `n * 4` for `n` pages data.
|
||||
* Response: no data
|
||||
* CLI: unused
|
||||
### 4023: MF0_NTAG_GET_VERSION_DATA
|
||||
* Command: no data
|
||||
* Response: 8 version data bytes.
|
||||
* CLI: cf `hf mfu econfig`
|
||||
### 4024: MF0_NTAG_SET_VERSION_DATA
|
||||
* Command: 8 version data bytes.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mfu econfig --set-version <hex>`
|
||||
### 4025: MF0_NTAG_GET_SIGNATURE_DATA
|
||||
* Command: no data
|
||||
* Response: 32 signature data bytes.
|
||||
* CLI: cf `hf mfu econfig`
|
||||
### 4026: MF0_NTAG_SET_SIGNATURE_DATA
|
||||
* Command: 32 signature data bytes.
|
||||
* Response: no data
|
||||
* CLI: cf `hf mfu econfig --set-signature <hex>`
|
||||
### 4027: MF0_NTAG_GET_COUNTER_DATA
|
||||
* Command: 1 byte for the counter index
|
||||
* Response: 3 bytes for the counter value (big-endian) + 1 byte for tearing where `0xBD` means tearing flag is not set.
|
||||
* CLI: cf `hf mfu ercnt`
|
||||
### 4028: MF0_NTAG_SET_COUNTER_DATA
|
||||
* Command: 1 byte where the lower 7 bits are the counter index and the top bit indicates whether tearing event flag should be reset + 3 bytes of the counter value (big-endian).
|
||||
* Response: no data
|
||||
* CLI: cf `hf mfu ewcnt`
|
||||
### 4029: MF0_NTAG_RESET_AUTH_CNT
|
||||
* Command: no data
|
||||
* Response: 1 byte for the old value of the unsuccessful auth counter.
|
||||
* CLI: cf `hf mfu econfig --reset-auth-cnt`
|
||||
### 4030: MF0_NTAG_GET_PAGE_COUNT
|
||||
* Command: no data
|
||||
* Response: 1 byte is the number of pages available in the current card slot
|
||||
* CLI: unused
|
||||
### 5000: EM410X_SET_EMU_ID
|
||||
* Command: 5 bytes. `id[5]`. ID as 5 bytes.
|
||||
* Response: no data
|
||||
* CLI: cf `lf em 410x econfig`
|
||||
### 5001: EM410X_GET_EMU_ID
|
||||
* Command: no data
|
||||
* Response: 5 bytes. `id[5]`. ID as 5 bytes.
|
||||
* CLI: cf `lf em 410x econfig`
|
||||
|
||||
## New data payloads: guidelines for developers
|
||||
|
||||
If you need to define new payloads for new commands, try to follow these guidelines.
|
||||
|
||||
### Guideline: Verbose and explicit
|
||||
Be verbose, explicit and reuse conventions, in order to enhance code maintainability and understandability for the other contributors
|
||||
### Guideline: Structs
|
||||
- Define C `struct` for cmd/resp data greater than a single byte, use and abuse of `struct.pack`/`struct.unpack` in Python. So one can understand the payload format at a simple glimpse. Exceptions to `C` struct are when the formats are of variable length (but Python `struct` is still flexible enough to cope with such formats!)
|
||||
- Avoid hardcoding offsets, use `sizeof()`, `offsetof(struct, field)` in C and `struct.calcsize()` in Python
|
||||
- For complex bitfield structs, exceptionally you can use ctypes in Python. Beware ctypes.BigEndianStructure bitfield will be parsed in the firmware in the reverse order, from LSB to MSB.
|
||||
### Guideline: Status
|
||||
If single byte of data to return, still use a 1-byte `data`, not `status`. Standard response status is `STATUS_SUCCESS` for general commands, `STATUS_HF_TAG_OK` for HF commands and `STATUS_LF_TAG_OK` for LF commands. If the response status is different than those, the response data is empty. Response status are generic and cover things like tag disappearance or tag non-conformities with the ISO standard. If a command needs more specific response status, it is added in the first byte of the data, to avoid cluttering the 1-byte general status enum with command-specific statuses. See e.g. [MF1_DARKSIDE_ACQUIRE](#2004-mf1_darkside_acquire).
|
||||
### Guideline: unambiguous types
|
||||
- Use unambiguous types such as `uint16_t`, not `int` or `enum`. Cast explicitly `int` and `enum` to `uint_t` of proper size
|
||||
- Use Network byte order for 16b and 32b integers
|
||||
- Macros `U16NTOHS`, `U32NTOHL` must be used on reception of a command payload.
|
||||
- Macros `U16HTONS`, `U32HTONL` must be used on creation of a response payload.
|
||||
- In Python, use the modifier `!` with all `struct.pack`/`struct.unpack`
|
||||
### Guideline: payload parsing in handlers
|
||||
- Concentrate payload parsing in the handlers, avoid further parsing in their callers. Callers should not care about the protocol. This is true for the firmware and the client.
|
||||
- In cmd_processor handlers: don't reuse input `length`/`data` parameters for creating the response content
|
||||
### Guideline: Naming conventions
|
||||
- Use the exact same command and fields names in firmware and in client, use function names matching the command names for their handlers unless there is a very good reason not to do so. This helps grepping around. Names must start with a letter, not a number, because some languages require it (e.g. `14a_scan` not possible in Python)
|
||||
- Respect commands order in `m_data_cmd_map`, `data_cmd.h` and `chameleon_cmd.py` definitions
|
||||
- Even if a command is not yet implemented in firmware or in client but a command number is allocated, add it to `data_cmd.h` and `chameleon_cmd.py` with some `FIXME: to be implemented` comment
|
||||
### Guideline: Validate status and data
|
||||
- Validate response status in client before parsing data.
|
||||
- Validate data before using it.
|
||||
|
||||
## Room for improvement
|
||||
|
||||
* some `num_to_bytes` `bytes_to_num` could use `hton*`, `ntoh*` instead, to make endianess explicit
|
||||
* some commands are using bitfields (e.g. mf1_get_detection_log (sending directly the flash stored format) and hf14a_raw) while some commands are spreading bits into 0x00/0x01 bytes (e.g. mf1_get_emulator_config)
|
||||
* describe flash storage formats
|
||||
@@ -1,19 +0,0 @@
|
||||
# Quickstart
|
||||
|
||||
Quickly get up and running with your Chameleon and no technical skill
|
||||
|
||||
1. Download any of those applications. Note that in spite of what their name may suggest, all GUIs support both the Ultra and the Lite.
|
||||
|
||||
- [ChameleonUltraGUI on Google Play](https://play.google.com/store/apps/details?id=io.chameleon.ultra) / [APK](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/apk.zip)
|
||||
- [ChameleonUltraGUI on iOS](https://apps.apple.com/dk/app/chameleon-ultra-gui/id6462919364)
|
||||
- [ChameleonUltraGUI on Windows](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows-installer.zip) ([or without installer](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/windows.zip))
|
||||
- [ChameleonUltraGUI on Linux](https://nightly.link/GameTec-live/ChameleonUltraGUI/workflows/build-app/main/linux.zip)
|
||||
- [ChameleonUltraGUI on macOS](https://apps.apple.com/app/chameleon-ultra-gui/id6462919364)
|
||||
- [MTools BLE on App Store](https://apps.apple.com/app/mtools-ble-rfid-reader/id1531345398)
|
||||
- [MTools BLE on Google Play](https://play.google.com/store/apps/details?id=com.mtoolstec.mtoolsLite)
|
||||
|
||||
2. Connect your Chameleon via USB or BLE
|
||||
|
||||
3. Open application
|
||||
|
||||
4. Enjoy
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
# SDKs
|
||||
|
||||
SDKs for Chameleon, useful if you want to develop your own application to control Chameleon.
|
||||
|
||||
## [taichunmin/chameleon-ultra.js](https://github.com/taichunmin/chameleon-ultra.js)
|
||||
|
||||
[](https://github.com/taichunmin/chameleon-ultra.js/stargazers)
|
||||
[](https://github.com/taichunmin/chameleon-ultra.js/issues)
|
||||
[](https://www.npmjs.org/package/chameleon-ultra.js)
|
||||
[](https://github.com/taichunmin/chameleon-ultra.js/blob/master/LICENSE)
|
||||
|
||||
A JavaScript SDK for ChameleonUltra support Web Bluetooth API, Web Serial API and Node.js. There are also some demos for using the SDK.
|
||||
@@ -1,199 +0,0 @@
|
||||
[nrf52_nfc_module_doc]: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fnfc.html
|
||||
|
||||
[nxp_rc522_datasheet]: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
|
||||
|
||||
# ChameleonUltra
|
||||
|
||||
Why not keep using ATXMEGA128?
|
||||
First of all, it is difficult to buy chips because the lead time for the main chip is too long, and because the price
|
||||
has skyrocketed. Secondly, because the interaction speed of the ATXMEGA, emulation is slow, the decryption performance
|
||||
of the READER mode cannot meet the needs, and the LF support cannot be added, so we have been trying to upgrade it, such
|
||||
as using the latest ARM to replace the AVR framework, and the performance will definitely be greatly improved.
|
||||
|
||||
# Why nRF52840?
|
||||
|
||||
NRF52840 has a built-in NFC Tag-A module, but no one seems to care about it. After playing with HydraNFC's TRF7970A and
|
||||
FlipperZero's ST25R3916, the developers found that they can only emulate MIFARE Classic with a very high FDT.
|
||||
We accidentally tested the NFC of nRF52840, and found that it is not only surprisingly easy to emulate a complete MIFARE
|
||||
Classic card, but also has very good emulation performance, friendly data flow interaction, and very fast response,
|
||||
unlike the former which is limited by the SPI bus clock rate. We also found that it has ultra-low power consumption,
|
||||
ultra-small size, 256kb/1M large RAM and Flash, also has BLE5.0 and USB2.0 FS, super CortexM4F, most importantly, it is
|
||||
very cheap! This is undoubtedly a treasure discovery for us!
|
||||
|
||||
Below we will explain in detail how we exploited the performance of the NRF52840, and what seemingly impossible
|
||||
functions have been realized with it!
|
||||
|
||||
# Supported functions
|
||||
|
||||
## High Frequency Attack
|
||||
|
||||
| Attack Type | Tag Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|--------------|:--------------:|------------------------------:|---------------------------|:--------------------------------------:|-------------------------:|
|
||||
| Sniffing | No | No | No | No | |
|
||||
| MFKEY32 V2 | MIFARE Classic | Support | Support | Support | MIFARE Classic Detection |
|
||||
| Darkside | MIFARE Classic | Support | Support | Support | Encrypted 4 bit NAck |
|
||||
| Nested | MIFARE Classic | Support | Support | Support | PRNG(Distance guess) |
|
||||
| StaticNested | MIFARE Classic | Support | Support | Support | PRNG(2NT Fast Decrypt) |
|
||||
| HardNested | MIFARE Classic | Support | Support | Not yet implemented | No |
|
||||
| Relay attack | ISO14443A | Support | Support | Not yet implemented | No |
|
||||
|
||||
## High Frequency emulation
|
||||
|
||||
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|--------------------------------|:--------------------:|------------------------------:|---------------------------|:--------------------------------------:|-----------------------------------------:|
|
||||
| Other than ISO14443A | No | No | No | No | [NRF52 NFC Module][nrf52_nfc_module_doc] |
|
||||
| NTAG 21x (210-218) | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight Ev1 | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight C | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Classic1K/2K/4K (4B/7B) | ISO14443A/106 kbit/s | Support | Support | Support | |
|
||||
| MIFARE DESFire | ISO14443A High Rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
|
||||
| MIFARE DESFire EV1 | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | Backward compatible |
|
||||
| MIFARE DESFire EV2 | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
|
||||
| MIFARE Plus | ISO14443A High rate | Only supported Low rate | Only supported Low rate | Not yet implemented | |
|
||||
|
||||
## High Frequency Reader
|
||||
|
||||
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|---------------------------------|:--------------------:|---------------------------------------------:|----------------------------------------------|:--------------------------------------:|-------------------------------------------:|
|
||||
| Non <13.56MHz or ISO14443A> | No | No | No | No | [NXP RC522 Datasheet][nxp_rc522_datasheet] |
|
||||
| NTAG 21x (210-218) | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight Ev1 | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Ultralight C | ISO14443A/106 kbit/s | Support | Support | Not yet implemented | |
|
||||
| MIFARE Classic 1K/2K/4K (4B/7B) | ISO14443A/106 kbit/s | Support | Support | Support | |
|
||||
| MIFARE DESFire | ISO14443A High Rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
|
||||
| MIFARE DESFire EV1 | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | Backward compatible |
|
||||
| MIFARE DESFire EV2 | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
|
||||
| MIFARE Plus | ISO14443A High rate | Supports low rates, or possibly higher rates | Supports low rates, or possibly higher rates | Not yet implemented | |
|
||||
|
||||
## Low Frequency Attack
|
||||
|
||||
| Vulnerability Type | Tag Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|--------------------|:---------:|------------------------------:|---------------------------|:--------------------------------------:|-----:|
|
||||
| Sniffing | 125KHz | Support | Support | Not yet implemented | |
|
||||
| Brute Force | EM410x ID | Support | Support | Not yet implemented | |
|
||||
|
||||
## Low Frequency emulation
|
||||
|
||||
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|---------------------------------|:-------------:|------------------------------:|---------------------------|:--------------------------------------:|----------------------------------------------:|
|
||||
| Other than <125KHz/ASK/PSK/FSK> | No | No | No | No | Only 125 khz RF, Modulation ASK, FSK and PSK. |
|
||||
| EM410x | ASK | Support | Support | Support | EM4100 is support(AD 64bit) |
|
||||
| T5577 | ASK | Support | Support | Not yet implemented | |
|
||||
| EM4305 | ASK | Support | Support | Not yet implemented | |
|
||||
| HID Prox | FSK | Support | Support | Not yet implemented | |
|
||||
| Indala | PSK | Support | Support | Not yet implemented | |
|
||||
| FDX-B | ASK | Support | Support | Not yet implemented | |
|
||||
| Paradox | FSK | Support | Support | Not yet implemented | |
|
||||
| Keri | PSK | Support | Support | Not yet implemented | |
|
||||
| AWD | FSK | Support | Support | Not yet implemented | |
|
||||
| ioProx | FSK | Support | Support | Not yet implemented | |
|
||||
| securakey | ASK | Support | Support | Not yet implemented | |
|
||||
| gallagher | ASK | Support | Support | Not yet implemented | |
|
||||
| PAC/Stanley | ASK | Support | Support | Not yet implemented | |
|
||||
| Presco | ASK | Support | Support | Not yet implemented | |
|
||||
| Visa2000 | ASK | Support | Support | Not yet implemented | |
|
||||
| Viking | ASK | Support | Support | Not yet implemented | |
|
||||
| Noralsy | ASK | Support | Support | Not yet implemented | |
|
||||
| NexWatch | PSK | Support | Support | Not yet implemented | |
|
||||
| Jablotron | ASK | Support | Support | Not yet implemented | |
|
||||
|
||||
## Low Frequency Reader
|
||||
|
||||
| Card Type | Encoding Type | Whether the hardware supports | Does the software support | Whether the application layer supports | Note |
|
||||
|---------------------------------|:-------------:|------------------------------:|---------------------------|:--------------------------------------:|----------------------------------------------:|
|
||||
| Other than <125KHz/ASK/PSK/FSK> | No | No | No | No | Only 125 khz RF, Modulation ASK, FSK and PSK. |
|
||||
| EM410x | ASK | Support | Support | Support | |
|
||||
| T5577 | ASK | Support | Support | Support(Write) | |
|
||||
| EM4305 | ASK | Support | Support | Not yet implemented | |
|
||||
| HID Prox | FSK | Support | Support | Not yet implemented | |
|
||||
| Indala | PSK | Support | Support | Not yet implemented | |
|
||||
| FDX-B | ASK | Support | Support | Not yet implemented | |
|
||||
| Paradox | FSK | Support | Support | Not yet implemented | |
|
||||
| Keri | PSK | Support | Support | Not yet implemented | |
|
||||
| AWD | FSK | Support | Support | Not yet implemented | |
|
||||
| ioProx | FSK | Support | Support | Not yet implemented | |
|
||||
| securakey | ASK | Support | Support | Not yet implemented | |
|
||||
| gallagher | ASK | Support | Support | Not yet implemented | |
|
||||
| PAC/Stanley | ASK | Support | Support | Not yet implemented | |
|
||||
| Presco | ASK | Support | Support | Not yet implemented | |
|
||||
| Visa2000 | ASK | Support | Support | Not yet implemented | |
|
||||
| Viking | ASK | Support | Support | Not yet implemented | |
|
||||
| Noralsy | ASK | Support | Support | Not yet implemented | |
|
||||
| NexWatch | PSK | Support | Support | Not yet implemented | |
|
||||
| Jablotron | ASK | Support | Support | Not yet implemented | |
|
||||
|
||||
## Low Frequency Modulation
|
||||
|
||||
| Modulation Type | wav |
|
||||
|-----------------|------------------------------------:|
|
||||
| PSK |  |
|
||||
| FSK |  |
|
||||
| ASK |  |
|
||||
|
||||
# Ultra-low power consumption
|
||||
|
||||
It integrates a high-performance and low-power NFC module inside. When the NFC unit is turned on, the total current of
|
||||
the chip is only 5mA @3.3V.
|
||||
The underlying interaction is done independently by the NFC unit and does not occupy the CPU.
|
||||
In addition, the nRF52840 itself is a high-performance low-power BLE chip, and the encryption and calculation process is
|
||||
only 7mA @3.3V. It can greatly reduce the battery volume and prolong the working time. That is to say, the 35mAh 10mm*
|
||||
40mm button lithium battery can guarantee to be charged once every half a year under the working condition of swiping
|
||||
the card 8 times a day for 3 seconds each time. Full potential for everyday use.
|
||||
|
||||
# Not just UID, but a real and complete MIFARE Classic emulation
|
||||
|
||||
We can easily and completely emulate all data and password verification of all sectors, and can customize SAK, ATQA,
|
||||
ATS, etc. Similar to an open CPU card development platform, 14A interaction of various architectures can be easily
|
||||
realized.
|
||||
|
||||
# Super compatibility with low-power locks using batteries
|
||||
|
||||
The structure of the old Chameleon AVR is slow to start during emulation. Faced with a battery-powered low-power lock
|
||||
and an integrated lock on the door, it will be frequently interrupted, and the verification interaction cannot be
|
||||
completed completely, resulting in no response when swiping the card.
|
||||
|
||||
In order to reduce power consumption, the battery lock will send out a field signal as short as possible when searching
|
||||
for a card, which is no problem for the original card, but it is fatal for the MCU emulated card. Cards or mobile smart
|
||||
bracelets emulated by the MCU cannot wake up and respond in such a short time, so many battery locks cannot open the
|
||||
door, which greatly reduces the user experience.
|
||||
|
||||
This project specially optimizes the start-up and interaction logic and antenna for low-power reading heads. After
|
||||
testing a variety of common low-power reading heads, they can open the door perfectly by swiping the card.
|
||||
|
||||
# Ultra-fast response speed and low interaction delay(MIFARE Classic)
|
||||
|
||||
| Tag/Emulation | FDT | "**_FDT_**" Rating |
|
||||
|----------------------|:-----------------------------------------------------------------------------:|:--------------------------------------------------------------------------------:|
|
||||
| Standard MIFARE Card |  | ⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐ |
|
||||
| Chameleon Ultra |  | ⭐⭐⭐⭐⭐⭐⭐⭐ |
|
||||
| Proxmark3 Rdv4.01 |  | ⭐⭐⭐⭐ |
|
||||
| RedMi K30 |  | ⭐⭐⭐⭐⭐⭐ |
|
||||
| Chameleon Tiny |  | ⭐⭐⭐⭐⭐ |
|
||||
| Flipper Zero |  | ⭐⭐ |
|
||||
|
||||
# 256kB super large RAM cooperates with RC522 to enable attacks
|
||||
|
||||
| Attack Type | CLI |
|
||||
|--------------|:----------------------------------------------------------:|
|
||||
| MFKEY32 V2 |  |
|
||||
| Darkside |  |
|
||||
| Nested |  |
|
||||
| StaticNested |  |
|
||||
| HardNested | Coming Soon |
|
||||
| Relay attack | Coming Soon |
|
||||
|
||||
# Hardware frame diagram
|
||||
|
||||

|
||||
|
||||
# Birth of the project
|
||||
|
||||
When the project got open-sourced, DXL shared a few notes in [issue #1](https://github.com/RfidResearchGroup/ChameleonUltra/issues/1#issuecomment-1455016381).
|
||||
|
||||
**Hardware:** ChameleonUltra and ChameleonLite hardware were carefully designed by Proxgrind team. They inherit the style of ChameleonTiny, which is very consistent with Olaf's style. Yes, whether it is Proxmark3 RDV4 or Chameleon Tiny, Olaf likes to reduce the size as much as possible under the extreme performance, making it easy to carry, unique in appearance and full of technology. At the same time, it is a pity that the volume of Chameleon Ultra brings inconvenience to most people for PCBA manufacturing and firmware development and testing. Therefore, we feel that we need to provide a development board based on ChameleonUltra with a larger volume. The components of this development board is packaged with common volume to make it easy to weld, and we also reserved GPIO interface and SWD interface. And this development board is also open source. If enthusiasts are interested, they can build a Chameleon Ultra from scratch. Of course, if there is no welding tool, we also provide formed development boards for sale (moderate price).
|
||||
|
||||
**Firmware:** Chameleon Ultra is a very powerful platform. We can develop various 14A protocol card simulations based on this platform. In terms of high-frequency card simulation, DXL has completed the development of high-performance MifareClassic Mini ->S50 ->S70 card. However, the development of cards for other technologies has not been completed, such as UL, UL-C, NTAG, etc. In terms of low-frequency card simulation, DXL has completed the development of EM410x, but the development of other technology cards has not been completed, such as FSK and PSK-related technology cards. For card reader, DXL has completed the reading, writing and decryption of M1 card, reading EM410x and writing to T5577. Others, such as the reading and writing of UL card and NTAG card, are not completed yet.
|
||||
|
||||
**Client:** At present, ChameleonUltra uses python to develop the CLI, cooperate with independent exe to perform the decryption task, and complete the decoupling of the business logic of the CLI and the decryption algorithm logic. Due to time reasons, DXL only completes commands such as device connection, M1 card data upload, M1 card detection log download and decryption, M1 card read and write block, and so on. The complete nested, rdsc, and autopwn instructions like PM3 have not yet been implemented, which may require our joint efforts. Finally, I believe that Chameleon Ultra is definitely not limited to CLI as a way of device interaction. Perhaps we can further develop PC-side GUI, and develop IOS and Android APP. USB+BLE support makes everything possible.
|
||||
@@ -1,123 +0,0 @@
|
||||
# Hardware
|
||||
|
||||
## Difficulties to get emulation working properly
|
||||
|
||||
Try with waking up the Chameleon by pressing a button before presenting it to the reader. Try with keeping some 2-3 cm distance to the reader.
|
||||
|
||||
## Difficulties to get the LF working properly
|
||||
|
||||
The LF antenna is on a second PCB attached to the main PCB via little screws which also serve as electric connection.
|
||||
It has reported that on some devices the electric connection is not good, some glue or resin residues may interfere.
|
||||
You can try to dismantle very gently the screws and PCB, clean them and put them back in place.
|
||||
Be very careful the screws have been reported to be quite fragile so be gentle with them!
|
||||
|
||||
# BLE
|
||||
|
||||
## Difficulties connecting using BLE
|
||||
|
||||
On Android make sure your location is turned, as that allows for scanning of bluetooth devices.
|
||||
|
||||
## Difficulties to use BLE
|
||||
|
||||
After BLE pairing, both the phone and ChameleonUltra will save a secret key for encrypted communication. If either party deletes the pairing record, it will result in communication failure. If Bluetooth cannot be connected, clearing the pairing information on the other side can solve the problem:
|
||||
|
||||
* Find the Bluetooth settings in the phone's system settings and cancel pairing with the ChameleonUltra.
|
||||
* In the CLI of ChameleonUltra, execute the `hw settings bleclearbonds` command to clear all pairing records.
|
||||
|
||||
Default BLE connect key(passkey) is `123456`
|
||||
|
||||
# DFU
|
||||
|
||||
## Error when attempting DFU upgrade with `nrfutil`
|
||||
|
||||
|
||||
```
|
||||
[00:00:00] ------ 0% [id:9] Failed, [sdfu] [json.exception.type_error.302] type must be string, but is null
|
||||
```
|
||||
or
|
||||
```
|
||||
[00:00:00] ------ 0% [2/2 ...] Failed, [sdfu]
|
||||
```
|
||||
|
||||
### Check permissions and ModemManager
|
||||
|
||||
Check the serial port permissions and if under Linux, make sure ModemManager is not interfering with your Chameleon.
|
||||
The proposed [udev/rules.d file](../resource/driver/79-chameleon-usb-device-blacklist-dialout.rules) may help you (and add your user to the dialout group).
|
||||
|
||||
### Check `hw_version` of your DFU package
|
||||
|
||||
Another cause of this error is a mismatch between `hw_version` of the DFU package you want to use and your hardware. You can check it with the following command.
|
||||
|
||||
```
|
||||
nrfutil nrf5sdk-tools pkg display my-dfu-file.zip |grep hw_version
|
||||
```
|
||||
`hw_version` must be equal to `0` for the Ultra and `1` for the Lite.
|
||||
|
||||
# CLI tools compilation
|
||||
|
||||
## ProxSpace: cmake error
|
||||
|
||||
The following error has been reported on some ProxSpace installations (why on some and not all is still unclear)
|
||||
|
||||
```
|
||||
pm3 ~/ChameleonUltra/software/src$ cmake .
|
||||
-- Building for: Ninja
|
||||
-- The C compiler identification is GNU 10.3.0
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - failed
|
||||
-- Check for working C compiler: C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/bin/cc.exe
|
||||
-- Check for working C compiler: C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/bin/cc.exe - broken
|
||||
CMake Error at C:/Users/moeya/Desktop/Chamelion/ProxSpace/msys2/mingw64/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
|
||||
The C compiler
|
||||
|
||||
"C:/Users/xxx/ProxSpace/msys2/mingw64/bin/cc.exe"
|
||||
|
||||
is not able to compile a simple test program.
|
||||
```
|
||||
|
||||
This is due to a version of ninja not aware of the Windows paths. Fix:
|
||||
|
||||
```
|
||||
pacman -R ninja --noconfirm
|
||||
pacman -S mingw-w64-x86_64-ninja --noconfirm
|
||||
```
|
||||
|
||||
## cmake: Undefined reference to "pthread_create"
|
||||
|
||||
It has been reported that on some Linux systems cmake doesnt find pthread.
|
||||
|
||||
Make sure to have libpthread installed, the package may be named differently on your distro.
|
||||
|
||||
On ubuntu and same based systems it is the following command:
|
||||
```
|
||||
sudo apt install libpthread-stubs0-dev
|
||||
```
|
||||
|
||||
If this doesnt fix it, you may need to set pthread in the LDFLAGS enviroment variable, this can be done by running the command with the enviroment variable at the beginning:
|
||||
|
||||
```
|
||||
LDFLAGS=-pthread cmake ..
|
||||
```
|
||||
|
||||
If the error still persists you may also need to provide a specific compiler version, you do that by adding the -DCMAKE_C_COMPILER argument:
|
||||
|
||||
```
|
||||
LDFLAGS=-pthread cmake -DCMAKE_C_COMPILER=gcc-11 ..
|
||||
```
|
||||
|
||||
The compiler needs to be installed too ofcourse, the package name may be differently on your distro.
|
||||
|
||||
On ubuntu and same based systems its the following command:
|
||||
|
||||
```
|
||||
sudo apt install gcc-11 g++-11
|
||||
```
|
||||
|
||||
The following ```cmake --build . --config Release``` should work again without modification.
|
||||
|
||||
# CLI usage
|
||||
|
||||
## InvalidException: Device unsupported cmd
|
||||
|
||||
You need to update the firmware of your Chameleon.
|
||||
|
||||
Reference in New Issue
Block a user