Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more OpenWRT TRX files by making fewer assumptions about the partitions #216

Merged
merged 18 commits into from
Feb 10, 2023

Conversation

EdwardLarson
Copy link
Collaborator

One sentence summary of this PR (This should go in the CHANGELOG!)
Support more OpenWRT TRX files by making fewer assumptions about the partitions

Link to Related Issue(s)
#153
(#187, #161 previous PR)

Please describe the changes in your request.
The OpenWRT documentation here does not describe the TRX file format in the general case. The code here shows how TRX files are actually created: up to three images (or partitions), possibly padded, are added to the file. These partitions do not necessarily correspond to loader, kernel, etc. described in the wiki or are not necessarily in that order. Therefore the TRX packer/unpacker needs to be much more general than it previously was.

Anyone you think should look at this, specifically?
@whyitfor @SamL98

@EdwardLarson EdwardLarson mentioned this pull request Feb 8, 2023
ofrak_core/ofrak/core/openwrt.py Outdated Show resolved Hide resolved
ofrak_core/ofrak/core/openwrt.py Outdated Show resolved Hide resolved
ofrak_core/ofrak/core/openwrt.py Outdated Show resolved Hide resolved
ofrak_core/test_ofrak/components/test_openwrt_component.py Outdated Show resolved Hide resolved
ofrak_core/test_ofrak/components/test_openwrt_component.py Outdated Show resolved Hide resolved
@EdwardLarson
Copy link
Collaborator Author

LGTM! (though this is technically my PR, none of the code is mine, so I count my review as a proper review)

@whyitfor whyitfor merged commit d7b6563 into redballoonsecurity:master Feb 10, 2023
marczalik pushed a commit to marczalik/ofrak that referenced this pull request Feb 14, 2023
…partitions (redballoonsecurity#216)

* add explicit checks for rootfs_offset

* create resource from empty data instead of None

* fix second instance of None vs empty array

* change empty resources to byte arrays

* appease The Linter

* add openwrt null rootfs testcase

* openwrt updates

* changed tests to match new openwrt functionality

* Update OpenWRT modifier and packer to use new format

* Address black issues in lzma.py

* add the changelog

* Fix typos

* fix typo

---------

Co-authored-by: Rylan <rylan.oconnell@twosixtech.com>
Co-authored-by: SamL98 <lerner98@gmail.com>
Co-authored-by: Edward Larson <edward@redballoonsecurity.com>
Co-authored-by: Wyatt <53830972+whyitfor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants