1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

Merge branch 'ofw_dev' into dev p1

This commit is contained in:
MX
2024-03-10 23:35:44 +03:00
parent 4e7f25a539
commit 58cd56a439
73 changed files with 958 additions and 229 deletions

View File

@@ -1,21 +1,23 @@
# Command syntax
# BadUSB File Format {#badusb_file_format}
## Command syntax
BadUsb app uses extended Duckyscript syntax. It is compatible with classic USB Rubber Ducky 1.0 scripts but provides some additional commands and features, such as custom USB ID, ALT+Numpad input method, SYSRQ command, and more functional keys.
# Script file format
## Script file format
BadUsb app can execute only text scripts from `.txt` files, no compilation is required. Both `\n` and `\r\n` line endings are supported. Empty lines are allowed. You can use spaces or tabs for line indentation.
# Command set
## Command set
## Comment line
### Comment line
Just a single comment line. The interpreter will ignore all text after the REM command.
| Command | Parameters | Notes |
| ------- | ------------ | ----- |
| REM | Comment text | |
## Delay
### Delay
Pause script execution by a defined time.
| Command | Parameters | Notes |
@@ -24,7 +26,7 @@ Pause script execution by a defined time.
| DEFAULT_DELAY | Delay value in ms | Add delay before every next command |
| DEFAULTDELAY | Delay value in ms | Same as DEFAULT_DELAY |
## Special keys
### Special keys
| Command | Notes |
| ------------------ | ---------------- |
@@ -53,7 +55,7 @@ Pause script execution by a defined time.
| APP | Same as MENU |
| Fx | F1-F12 keys |
## Modifier keys
### Modifier keys
Can be combined with a special key command or a single character.
| Command | Notes |
@@ -85,7 +87,7 @@ Will wait indefinitely for a button to be pressed
| WAIT_FOR_BUTTON_PRESS | None | Will wait for the user to press a button to continue script execution |
## String
### String
| Command | Parameters | Notes |
| ------- | ----------- | ----------------- |
@@ -100,13 +102,13 @@ Delay between keypresses.
| STRING_DELAY | Delay value in ms | Applied once to next appearing STRING command |
| STRINGDELAY | Delay value in ms | Same as STRING_DELAY |
## Repeat
### Repeat
| Command | Parameters | Notes |
| ------- | ---------------------------- | ----------------------- |
| REPEAT | Number of additional repeats | Repeat previous command |
## ALT+Numpad input
### ALT+Numpad input
On Windows and some Linux systems, you can print characters by holding `ALT` key and entering its code on Numpad.
| Command | Parameters | Notes |
@@ -115,14 +117,14 @@ On Windows and some Linux systems, you can print characters by holding `ALT` key
| ALTSTRING | Text string | Print text string using ALT+Numpad method |
| ALTCODE | Text string | Same as ALTSTRING, presents in some Duckyscript implementations |
## SysRq
### SysRq
Send [SysRq command](https://en.wikipedia.org/wiki/Magic_SysRq_key)
| Command | Parameters | Notes |
| ------- | ---------------- | ----- |
| SYSRQ | Single character | |
## USB device ID
### USB device ID
You can set the custom ID of the Flipper USB HID device. ID command should be in the **first line** of script, it is executed before script run.

View File

@@ -1,7 +1,7 @@
# Infrared Flipper File Formats
# Infrared Flipper File Formats {#infrared_file_format}
## Supported protocols list for "type: parsed"
## Supported protocols list for `type: parsed`
```
NEC
NECext
@@ -17,6 +17,7 @@
Kaseikyo
RCA
```
## Infrared Remote File Format
### Example
@@ -51,7 +52,7 @@ Each button is separated from others by a comment character (`#`) for better rea
Known protocols are represented in the `parsed` form, whereas non-recognized signals may be saved and re-transmitted as `raw` data.
#### Version history:
#### Version history
1. Initial version.
@@ -72,19 +73,19 @@ Known protocols are represented in the `parsed` form, whereas non-recognized sig
### Examples
- [TV Universal Library](/applications/main/infrared/resources/infrared/assets/tv.ir)
- [A/C Universal Library](/applications/main/infrared/resources/infrared/assets/ac.ir)
- [Audio Universal Library](/applications/main/infrared/resources/infrared/assets/audio.ir)
- [TV Universal Library](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/applications/main/infrared/resources/infrared/assets/tv.ir)
- [A/C Universal Library](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/applications/main/infrared/resources/infrared/assets/ac.ir)
- [Audio Universal Library](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/applications/main/infrared/resources/infrared/assets/audio.ir)
### Description
Filename extension: `.ir`
This file format is used to store universal remote libraries. It is identical to the previous format, differing only in the `Filetype` field.\
This file format is used to store universal remote libraries. It is identical to the previous format, differing only in the `Filetype` field.
It also has predefined button names for each universal library type, so that the universal remote application can understand them.
See [Universal Remotes](/documentation/UniversalRemotes.md) for more information.
See [Universal Remotes](../UniversalRemotes.md) for more information.
### Version history:
### Version history
1. Initial version.
@@ -92,7 +93,7 @@ See [Universal Remotes](/documentation/UniversalRemotes.md) for more information
### Examples
See [Infrared Unit Tests](/applications/debug/unit_tests/resources/unit_tests/infrared/) for various examples.
See [Infrared Unit Tests](https://github.com/flipperdevices/flipperzero-firmware/tree/dev/applications/debug/unit_tests/resources/unit_tests/infrared) for various examples.
### Description
@@ -103,10 +104,10 @@ It is mostly similar to the two previous formats, with the main difference being
Each infrared protocol must have corresponding unit tests complete with an `.irtest` file.
Known protocols are represented in the `parsed_array` form, whereas raw data has the `raw` type.\
Known protocols are represented in the `parsed_array` form, whereas raw data has the `raw` type.
Note: a single parsed signal must be represented as an array of size 1.
### Version history:
### Version history
1. Initial version.
@@ -141,4 +142,4 @@ and the number is a sequential integer: 1, 2, 3, etc., which produces names like
| decoder_expected | parsed_array | An array of parsed signals containing the expected decoder output. Also used as the encoder input. |
| encoder_decoder_input | parsed_array | An array of parsed signals containing both the encoder-decoder input and expected output. |
See [Unit Tests](/documentation/UnitTests.md#infrared) for more info.
See [Unit Tests](../UnitTests.md) for more info.

View File

@@ -1,4 +1,4 @@
# LF RFID key file format
# LF RFID key file format {#lfrfid_file_format}
## Example

View File

@@ -1,4 +1,4 @@
# NFC Flipper File Formats
# NFC Flipper File Formats {#nfc_file_format}
## UID + Header (General format)

View File

@@ -1,20 +1,20 @@
# File Formats for Flipper's SubGhz Subsystem
# SubGhz Subsystem File Formats {#subghz_file_format}
## `.sub` File Format
## .sub File Format
Flipper uses `.sub` files to store SubGhz transmissions. These are text files in Flipper File Format. `.sub` files can contain either a SubGhz Key with a certain protocol or SubGhz RAW data.
Flipper uses `.sub` files to store SubGhz signals. These files use the Flipper File Format. `.sub` files can contain either a SubGhz Key with a certain protocol or SubGhz RAW data.
A `.sub` files consist of 3 parts:
A `.sub` file consist of 3 parts:
- **header**, contains file type, version, and frequency
- **header**, contains the file type, version, and frequency
- **preset information**, preset type and, in case of a custom preset, transceiver configuration data
- **protocol and its data**, contains protocol name and its specific data, such as key, bit length, etc., or RAW data
Flipper's SubGhz subsystem uses presets to configure the radio transceiver. Presets are used to configure modulation, bandwidth, filters, etc. There are several presets available in stock firmware, and there is a way to create custom presets. See [SubGhz Presets](#adding-a-custom-preset) for more details.
Flipper's SubGhz subsystem uses presets to configure the radio transceiver. Presets are used to configure modulation, bandwidth, filters, etc. There are several presets available in stock firmware, and there is a way to create custom presets. See [SubGhz Presets](#adding-a-custom-preset) section for more details.
## Header format
Header is a mandatory part of `.sub` file. It contains file type, version, and frequency.
Header is a mandatory part of a `.sub` file. It contains the file type, version, and frequency.
| Field | Type | Description |
| ----------- | ------ | ----------------------------------------------------------------- |
@@ -41,7 +41,7 @@ Built-in presets:
- `FuriHalSubGhzPreset2FSKDev238Async` — 2 Frequency Shift Keying, deviation 2kHz, 270kHz bandwidth, async(IO throw GP0)
- `FuriHalSubGhzPreset2FSKDev476Async` — 2 Frequency Shift Keying, deviation 47kHz, 270kHz bandwidth, async(IO throw GP0)
### Transceiver Configuration Data
### Transceiver Configuration Data {#transceiver-configuration-data}
Transceiver configuration data is a string of bytes, encoded in hex format, separated by spaces. For CC1101 data structure is: `XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ`, where:
@@ -54,7 +54,7 @@ You can find more details in the [CC1101 datasheet](https://www.ti.com/lit/ds/sy
## File Data
`.sub` file data section contains either key data — protocol name and its specific data, bit length, etc., or RAW data an array of signal timings, recorded without any protocol-specific processing.
`.sub` file data section can either contain key data, consisting of a protocol name and its specific data, bit length, etc., or RAW data, which consists of an array of signal timings, recorded without any protocol-specific processing.
### Key Files
@@ -88,20 +88,20 @@ RAW `.sub` files contain raw signal data that is not processed through protocol-
For RAW files, 2 fields are required:
- **Protocol**, must be `RAW`
- **RAW_Data**, contains an array of timings, specified in microseconds Values must be non-zero, start with a positive number, and interleaved (change sign with each value). Up to 512 values per line. Can be specified multiple times to store multiple lines of data.
- **RAW_Data**, contains an array of timings, specified in microseconds. Values must be non-zero, start with a positive number, and interleaved (change sign with each value). Up to 512 values per line. Can be specified multiple times to store multiple lines of data.
Example of RAW data:
Protocol: RAW
RAW_Data: 29262 361 -68 2635 -66 24113 -66 11 ...
Long payload not fitting into internal memory buffer and consisting of short duration timings (< 10us) may not be read fast enough from the SD card. That might cause the signal transmission to stop before reaching the end of the payload. Ensure that your SD Card has good performance before transmitting long or complex RAW payloads.
A long payload that doesn't fit into the internal memory buffer and consists of short duration timings (< 10us) may not be read fast enough from the SD card. That might cause the signal transmission to stop before reaching the end of the payload. Ensure that your SD Card has good performance before transmitting long or complex RAW payloads.
### BIN_RAW Files
BinRAW `.sub` files and `RAW` files both contain data that has not been decoded by any protocol. However, unlike `RAW`, `BinRAW` files only record a useful repeating sequence of durations with a restored byte transfer rate and without broadcast noise. These files can emulate nearly all static protocols, whether Flipper knows them or not.
- Usually, you have to receive the signal a little longer so that Flipper accumulates sufficient data for correct analysis.
- Usually, you have to receive the signal a little longer so that Flipper accumulates sufficient data to analyze it correctly.
For `BinRAW` files, the following parameters are required and must be aligned to the left:
@@ -188,7 +188,7 @@ Data_RAW: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DE 02 D3 54 D5 4C D2 C
SubGhz application provides support for adding extra radio presets and additional keys for decoding transmissions in certain protocols.
## SubGhz `keeloq_mfcodes_user` file
## SubGhz keeloq_mfcodes_user file
This file contains additional manufacturer keys for Keeloq protocol. It is used to decode Keeloq transmissions.
This file is loaded at subghz application start and is located at path `/ext/subghz/assets/keeloq_mfcodes_user`.
@@ -228,7 +228,7 @@ For each key, a name and encryption method must be specified, according to comme
AABBCCDDEEFFAABB:1:Test1
AABBCCDDEEFFAABB:1:Test2
## SubGhz `setting_user` file
## SubGhz setting_user file
This file contains additional radio presets and frequencies for SubGhz application. It is used to add new presets and frequencies for existing presets. This file is being loaded on subghz application start and is located at path `/ext/subghz/assets/setting_user`.
@@ -256,7 +256,7 @@ Header must contain the following fields:
Repeating the same frequency will cause Flipper to listen to this frequency more often.
#### Adding a Custom Preset
#### Adding a Custom Preset {#adding-a-custom-preset}
You can have as many presets as you want. Presets are embedded into `.sub` files, so another Flipper can load them directly from that file.
Each preset is defined by the following fields:

View File

@@ -1,4 +1,4 @@
# iButton key file format
# iButton key file format {#ibutton_file_format}
## Example