Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d0dc649
added esp unpacker
Feb 6, 2024
f3eafd5
Merge remote-tracking branch 'origin/master' into jepson2k-esp-unpacker
Jepson2k Aug 16, 2024
09db62f
added the ability to unpack esp flash dumps
Jepson2k Aug 27, 2024
ee00e5f
refactored into its own folder since the files were getting large
Jepson2k Aug 28, 2024
50bf797
restructured
Jepson2k Dec 17, 2024
d9604ef
Merge branch 'master' into jepson2k-esp-unpacker
Jepson2k Dec 17, 2024
808e1c4
remove old files
Jepson2k Dec 19, 2024
74622a3
Merge branch 'master' into jepson2k-esp-unpacker
Jepson2k May 28, 2025
140cf3f
got some basic modifications workings
Jepson2k Jun 5, 2025
3636e82
Merge branch 'master' into jepson2k-esp-unpacker
Jepson2k Jun 5, 2025
2dc4725
cleaned up some mypy issues
Jepson2k Jun 5, 2025
038640f
cleaned up mypy issues and removed unused imports
Jepson2k Jun 5, 2025
c8b0895
working packer that recalcs checksum and hash for esp app
Jepson2k Jun 5, 2025
3e6cab9
pinned version
Jepson2k Jun 7, 2025
0159c9c
formatting and linting changes
Jepson2k Jun 7, 2025
b11ac03
not used in testing
Jepson2k Jun 7, 2025
9e721fc
switch to using test patterns for some of the tests
Jepson2k Jun 7, 2025
3de044b
switched from statefull to stateless reading
Jepson2k Jun 7, 2025
6432f62
linting updates
Jepson2k Jun 7, 2025
36655a3
more linting changes
Jepson2k Jun 7, 2025
154b0dd
Merge remote-tracking branch 'upstream/master' into jepson2k-esp-unpa…
Jepson2k Jun 15, 2026
956ced1
Drop esptool dependency from ESP app components; segments-only model
Jepson2k Jun 15, 2026
715f844
ESP: add ESP8266 v2 support, input validation, and review fixes
Jepson2k Jun 16, 2026
e908711
ESP: match ESPAppUnpacker component id to its class name
Jepson2k Jun 16, 2026
1ca7b3b
ESP (#412): flash stateless rewrite, correctness fixes, chip-aware fl…
Jepson2k Jun 17, 2026
370fe76
ESP (#412): drop stray esptool from ofrak_core/requirements.txt
Jepson2k Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__pycache__/
venv/
.venv*/
.idea/
.vscode/
test/
.DS_Store
*.iml
Expand All @@ -21,4 +23,5 @@ build/
dist/
.coverage*
**/license.json
*.license
assets/*_ghidra
1 change: 1 addition & 0 deletions ofrak_core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master)

### Added
- Add ESP32/ESP8266 firmware support: app image identifier, unpacker, analyzer, header modifier, and packer, plus a flash-dump unpacker and partition analyzer. ([#412](https://github.com/redballoonsecurity/ofrak/pull/412))
- Add DockerImage components (identifier and unpacker) ([#715](https://github.com/redballoonsecurity/ofrak/pull/715))
- Add `FlashGeometryHeuristicAnalyzer` that infers `FlashAttributes` (page/OOB geometry) for raw NAND dumps tagged as `FlashResource`, using YAFFS2, Linux MTD large-page OOB, small-page OOB density, and exact Hamming ECC verification as signals ([#737](https://github.com/redballoonsecurity/ofrak/pull/737))
- Add `FlashFieldType.SPARE` and `FlashSpareAreaResource` so `FlashOobResourceUnpacker` can preserve OOB bytes without ECC/Checksum computation, and extend `FlashLogicalDataResourcePacker` to consume the sibling `FlashSpareAreaResource` so the original OOB layout is reconstructed verbatim during repacking ([#738](https://github.com/redballoonsecurity/ofrak/pull/738))
Expand Down
3 changes: 3 additions & 0 deletions ofrak_core/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# esptool is only used by the ESP app tests to independently validate repacked images
# (`python -m esptool image_info`); the ESP components themselves have no esptool dependency.
esptool==4.8.1
filelock==3.19.1
pyelftools==0.29
125 changes: 125 additions & 0 deletions ofrak_core/src/ofrak/core/esp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
"""
ESP (Espressif) device support for OFRAK.

This module provides unpackers, modifiers, and packers for ESP flash dumps and app images,
supporting ESP8266, ESP32, ESP32-S2, ESP32-S3, and other Espressif devices.
"""

# App components
from .app import (
ESPAppIdentifier,
ESPAppUnpacker,
ESPAppAnalyzer,
ESPAppHeaderModifier,
ESPAppPacker,
)

# App models
from .app_model import (
ESPApp,
ESPAppSection,
ESPAppAttributes,
ESPAppHeaderModifierConfig,
ESP_APP_MAGIC,
ESP8266V2_APP_MAGIC,
ESP_APP_HEADER_SIZE,
ESP_APP_EXTENDED_HEADER_SIZE,
ESP_APP_SEGMENT_HEADER_SIZE,
ESP_APP_DESCRIPTION_MAGIC_WORD,
ESP_APP_CHECKSUM_MAGIC,
ESPChip,
ESPAppFlashMode,
FlashSizeESP8266,
FlashSizeESP32,
FlashSizeESP32S2S3,
FlashFrequencyESP8266,
FlashFrequencyESP32,
FlashFrequencyESP32C6,
FlashSize,
FlashFrequency,
)

# Flash components
from .flash import (
ESPFlashIdentifier,
ESPFlashUnpacker,
ESPFlashAnalyzer,
ESPPartitionTableEntryModifier,
ESPPartitionTableEntryModifierConfig,
)

# Flash models
from .flash_model import (
ESPFlash,
ESPFlashAttributes,
ESPPartitionTable,
ESPPartition,
ESPPartitionTableEntry,
ESPFlashSection,
ESPFlashSectionStructure,
ESPPartitionStructure,
ESPPartitionType,
ESPPartitionSubtype,
ESPPartitionFlag,
ESP_PARTITION_ENTRY_MAGIC,
ESP_PARTITION_TABLE_OFFSET,
ESP_PARTITION_TABLE_SIZE,
ESP_PARTITION_ENTRY_SIZE,
ESP_BOOTLOADER_OFFSET,
ESP_BOOTLOADER_MAGIC,
)

__all__ = [
# App components
"ESPApp",
"ESPAppIdentifier",
"ESPAppUnpacker",
"ESPAppAnalyzer",
"ESPAppHeaderModifier",
"ESPAppPacker",
# App models
"ESPAppSection",
"ESPAppAttributes",
"ESPAppHeaderModifierConfig",
"ESP_APP_MAGIC",
"ESP8266V2_APP_MAGIC",
"ESP_APP_HEADER_SIZE",
"ESP_APP_EXTENDED_HEADER_SIZE",
"ESP_APP_SEGMENT_HEADER_SIZE",
"ESP_APP_DESCRIPTION_MAGIC_WORD",
"ESP_APP_CHECKSUM_MAGIC",
"ESPChip",
"ESPAppFlashMode",
"FlashSizeESP8266",
"FlashSizeESP32",
"FlashSizeESP32S2S3",
"FlashFrequencyESP8266",
"FlashFrequencyESP32",
"FlashFrequencyESP32C6",
"FlashSize",
"FlashFrequency",
# Flash components
"ESPFlash",
"ESPFlashIdentifier",
"ESPFlashUnpacker",
"ESPFlashAnalyzer",
"ESPPartitionTableEntryModifier",
# Flash models
"ESPPartitionTable",
"ESPPartition",
"ESPPartitionTableEntry",
"ESPFlashSection",
"ESPFlashSectionStructure",
"ESPPartitionStructure",
"ESPFlashAttributes",
"ESPPartitionTableEntryModifierConfig",
"ESPPartitionType",
"ESPPartitionSubtype",
"ESPPartitionFlag",
"ESP_PARTITION_ENTRY_MAGIC",
"ESP_PARTITION_TABLE_OFFSET",
"ESP_PARTITION_TABLE_SIZE",
"ESP_PARTITION_ENTRY_SIZE",
"ESP_BOOTLOADER_OFFSET",
"ESP_BOOTLOADER_MAGIC",
]
Loading
Loading