From 7e1a463c3e2701a7df416d0e7f83304d90c21e45 Mon Sep 17 00:00:00 2001 From: edward Date: Tue, 25 Apr 2023 14:13:45 -0400 Subject: [PATCH 1/5] update versions, changelogs, and clarify strings test slightly --- ofrak_core/CHANGELOG.md | 10 ++++++---- ofrak_core/requirements-test.txt | 2 -- ofrak_core/setup.py | 11 ++++++----- ofrak_core/test_ofrak/components/test_string.py | 4 ++-- ofrak_patch_maker/CHANGELOG.md | 2 ++ ofrak_patch_maker/setup.py | 4 ++-- ofrak_type/CHANGELOG.md | 2 ++ ofrak_type/setup.py | 2 +- 8 files changed, 21 insertions(+), 16 deletions(-) diff --git a/ofrak_core/CHANGELOG.md b/ofrak_core/CHANGELOG.md index 525b86161..d237ec690 100644 --- a/ofrak_core/CHANGELOG.md +++ b/ofrak_core/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to `ofrak` will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master) + +## [3.0.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.2.1...ofrak-v3.0.0) ### Added - Add call to flush a resource to disk in the script whenever a user downloads a resource from the GUI. ([#277](https://github.com/redballoonsecurity/ofrak/pull/277)) - Generate dynamic, runnable script based on GUI actions and display the script in the GUI. ([#265](https://github.com/redballoonsecurity/ofrak/pull/265)) @@ -11,16 +13,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Add `-i`/`--import` option to the CLI to import and discover additional OFRAK Python packages when starting OFRAK. [#269](https://github.com/redballoonsecurity/ofrak/pull/269) ### Changed -- Changed the `CpioUnpacker` to use `7zz` instead of the `cpio` utility due to `cpio` failing when extracting absolute paths. [#276](https://github.com/redballoonsecurity/ofrak/pull/276) +- Changed the `CpioUnpacker` to use `7zz` instead of the `cpio` utility due to `cpio` failing when extracting absolute paths. ([#276](https://github.com/redballoonsecurity/ofrak/pull/276)) - Remove need to create Resources to pass source code and headers to `PatchFromSourceModifier` and `FunctionReplaceModifier` ([#249](https://github.com/redballoonsecurity/ofrak/pull/249)) -- Choose Analyzer components which output the entirety of a view, rather than piece by piece, which would choose the wrong Analyzer sometimes. [#264](https://github.com/redballoonsecurity/ofrak/pull/264) -- Generate LinkableBinary stubs as strong symbols, so linker use them to override weak symbols in patch +- Choose Analyzer components which output the entirety of a view, rather than piece by piece, which would choose the wrong Analyzer sometimes. ([#264](https://github.com/redballoonsecurity/ofrak/pull/264)) +- Generate LinkableBinary stubs as strong symbols, so linker use them to override weak symbols in patch ([#259](https://github.com/redballoonsecurity/ofrak/pull/259)) - ### Fixed - Fix bug where `ComponentExternalTool` would raise an error when checking whether a tool was installed returned a non-zero exit value ([#289](https://github.com/redballoonsecurity/ofrak/pull/289)) - Fix bug where jumping to a multiple of `0x10` in the GUI went to the previous line ([#254](https://github.com/redballoonsecurity/ofrak/pull/254)) - Fix installing on Windows, as well as small GUI style fixes for Windows ([#261](https://github.com/redballoonsecurity/ofrak/pull/261)) -- Fixed `Uf2File` identifier so that it correctly tags UF2 files with `Uf2File` +- Fixed `Uf2File` identifier so that it correctly tags UF2 files with `Uf2File` ([#283](https://github.com/redballoonsecurity/ofrak/pull/283)) ## [2.2.1](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.2.0...ofrak-v2.2.1) - 2023-03-08 ### Added diff --git a/ofrak_core/requirements-test.txt b/ofrak_core/requirements-test.txt index e4af8bdf4..5a863960d 100644 --- a/ofrak_core/requirements-test.txt +++ b/ofrak_core/requirements-test.txt @@ -4,8 +4,6 @@ hypothesis~=6.39.3 hypothesis-trio trio-asyncio mypy==0.942 -ofrak_angr~=1.0 -ofrak_capstone~=1.0 psutil~=5.9 pyelftools==0.29 pytest-aiohttp diff --git a/ofrak_core/setup.py b/ofrak_core/setup.py index e1811694e..ac1cf3fd5 100644 --- a/ofrak_core/setup.py +++ b/ofrak_core/setup.py @@ -40,21 +40,22 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak", - version="2.2.1", + version="3.0.0rc6", description="A binary analysis and modification platform", packages=setuptools.find_packages(exclude=["test_ofrak", "test_ofrak.*"]), package_data={ "ofrak": ["py.typed"], }, install_requires=[ - "ofrak_io~=1.0", - "ofrak_type~=2.0", - "ofrak_patch_maker~=3.0", + "ofrak_io>=1.0,==1.*", + "ofrak_type>=2.2.0rc0,==2.*", + "ofrak_patch_maker>=4.0.0rc0,==4.*", ] + read_requirements("requirements.txt"), extras_require={ "docs": read_requirements("requirements-docs.txt"), - "test": read_requirements("requirements-test.txt"), + "test": ["ofrak_angr~=1.0", "ofrak_capstone~=1.0"] + + read_requirements("requirements-test.txt"), }, author="Red Balloon Security", author_email="ofrak@redballoonsecurity.com", diff --git a/ofrak_core/test_ofrak/components/test_string.py b/ofrak_core/test_ofrak/components/test_string.py index 9ad9a8395..5e2e3b0c9 100644 --- a/ofrak_core/test_ofrak/components/test_string.py +++ b/ofrak_core/test_ofrak/components/test_string.py @@ -49,8 +49,8 @@ int main() { printf("O"); printf("h, hi"); - printf(" Marc!\n"); - printf("You are tearing me apart, Lisa!\n"); + printf(" Marc!"); + printf("You are tearing me apart, Lisa!"); return 0; } """ diff --git a/ofrak_patch_maker/CHANGELOG.md b/ofrak_patch_maker/CHANGELOG.md index 42fbb7603..10d4fed83 100644 --- a/ofrak_patch_maker/CHANGELOG.md +++ b/ofrak_patch_maker/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master) +## [4.0.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-patch-maker-v.3.0.0...ofrak-patch-maker-v.4.0.0) + ### Changed - Discard `.altinstructions` section when linking - Use `SUBALIGN(0)` for `.bss` sections diff --git a/ofrak_patch_maker/setup.py b/ofrak_patch_maker/setup.py index 5d433d16c..7fb03fc53 100644 --- a/ofrak_patch_maker/setup.py +++ b/ofrak_patch_maker/setup.py @@ -31,12 +31,12 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak_patch_maker", - version="3.0.0", + version="4.0.0rc3", description="PatchMaker tool for applying source-code patches to binaries", packages=setuptools.find_packages(exclude=("ofrak_patch_maker_test",)), package_data={"ofrak_patch_maker": ["py.typed"]}, install_requires=[ - "ofrak_type~=2.0", + "ofrak_type>=2.2.0rc0,==2.*", ] + read_requirements("requirements.txt"), extras_require={ diff --git a/ofrak_type/CHANGELOG.md b/ofrak_type/CHANGELOG.md index a74942c77..5775b0398 100644 --- a/ofrak_type/CHANGELOG.md +++ b/ofrak_type/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased](https://github.com/redballoonsecurity/ofrak/tree/master) +## [2.2.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-type-v2.1.0...ofrak-type-v2.2.0) + ### Added - `ProcessorType.CORTEX_A72` - LinkableSymbolType enum for generalized representation of symbol types (essentially functions vs. data) diff --git a/ofrak_type/setup.py b/ofrak_type/setup.py index 5bd40c50e..4470e9268 100644 --- a/ofrak_type/setup.py +++ b/ofrak_type/setup.py @@ -21,7 +21,7 @@ def run(self): setuptools.setup( name="ofrak_type", - version="2.1.0", + version="2.2.0rc1", description="Custom classes and types used in OFRAK", package_data={ "ofrak_type": ["py.typed"], From 2fe9d6e7c3326823bd57d7cf74e7e9d57758585f Mon Sep 17 00:00:00 2001 From: edward Date: Tue, 25 Apr 2023 15:15:26 -0400 Subject: [PATCH 2/5] fix mangled changelogs --- ofrak_core/CHANGELOG.md | 11 +++++------ ofrak_patch_maker/CHANGELOG.md | 13 +++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ofrak_core/CHANGELOG.md b/ofrak_core/CHANGELOG.md index 3f000eed1..0d7a9f169 100644 --- a/ofrak_core/CHANGELOG.md +++ b/ofrak_core/CHANGELOG.md @@ -11,12 +11,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Generate dynamic, runnable script based on GUI actions and display the script in the GUI. ([#265](https://github.com/redballoonsecurity/ofrak/pull/265)) - Add `-f`/`--file` option to `ofrak gui` command to pre-load some files into OFRAK before opening the GUI, so they can be explored right away ([#266](https://github.com/redballoonsecurity/ofrak/pull/266)) - Add `-i`/`--import` option to the CLI to import and discover additional OFRAK Python packages when starting OFRAK. [#269](https://github.com/redballoonsecurity/ofrak/pull/269) +- Add Identifier to tag `ComplexBlocks` as `LinkableSymbols` and Analyzer to copy attributes from a `ComplexBlock` to its `LinkableSymbol`. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) +- Add method to create new `LinkableSymbols` from symbols defined in a patch file. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) + ### Changed - Remove need to create Resources to pass source code and headers to `PatchFromSourceModifier` and `FunctionReplaceModifier` ([#249](https://github.com/redballoonsecurity/ofrak/pull/249)) - Choose Analyzer components which output the entirety of a view, rather than piece by piece, which would choose the wrong Analyzer sometimes. ([#264](https://github.com/redballoonsecurity/ofrak/pull/264)) - Generate LinkableBinary stubs as strong symbols, so linker use them to override weak symbols in patch ([#259](https://github.com/redballoonsecurity/ofrak/pull/259)) -- +- Limit stub file creation for linkable BOMs to only those required by a patch. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) + ### Fixed - Fix bug where `ComponentExternalTool` would raise an error when checking whether a tool was installed returned a non-zero exit value ([#289](https://github.com/redballoonsecurity/ofrak/pull/289)) - Fix bug where jumping to a multiple of `0x10` in the GUI went to the previous line ([#254](https://github.com/redballoonsecurity/ofrak/pull/254)) @@ -48,11 +52,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Support more OpenWRT TRX files by making fewer assumptions about the partitions ([#216](https://github.com/redballoonsecurity/ofrak/pull/216)) - Fix some OS-specific problems (libmagic install, log file path) preventing OFRAK install on Windows ([#239](https://github.com/redballoonsecurity/ofrak/pull/239)) -### Added -- Add Identifier to tag `ComplexBlocks` as `LinkableSymbols` and Analyzer to copy attributes from a `ComplexBlock` to its `LinkableSymbol`. -- Add method to create new `LinkableSymbols` from symbols defined in a patch file. -- Limit stub file creation for linkable BOMs to only those required by a patch. - ## [2.2.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-v2.1.1...ofrak-v2.2.0) - 2023-02-01 ### Fixed - Fix bug in data service that can cause mangled internal state [#197](https://github.com/redballoonsecurity/ofrak/pull/197) diff --git a/ofrak_patch_maker/CHANGELOG.md b/ofrak_patch_maker/CHANGELOG.md index 10d4fed83..bfe100411 100644 --- a/ofrak_patch_maker/CHANGELOG.md +++ b/ofrak_patch_maker/CHANGELOG.md @@ -11,7 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Discard `.altinstructions` section when linking - Use `SUBALIGN(0)` for `.bss` sections - Force literal pool at end of function for AARCH64 using `-mpc-relative-literal-loads` + ### Added +- `-fno-optimize-sibling-calls` flag added to AVR toolchain. - `-fno-pic` flag added to the GNU_10_Toolchain to omit GOTs in patches (FEMs) against binaries that aren't dynamically linked. (see [#245](https://github.com/redballoonsecurity/ofrak/pull/245)) - Add methods to parse relocation symbols from object files. - Extend parsed symbol dictionary to include LinkableSymbolType. @@ -21,10 +23,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Changed - Switch to standard GCC-like frontend for LLVM, which supports C attribute(weak) - Treat weak symbols as "undefined" in BOM, so alternative, strong definitions can be searched +- Pass `-mmcu` value to the AVR preprocessor. +- Raise a more descriptive error on toolchain failure. + +### Fixed +- Toolchain `preprocess()` method now returns the path to the preprocessed file. ## [3.0.0](https://github.com/redballoonsecurity/ofrak/compare/ofrak-patch-maker-v.2.0.0...ofrak-patch-maker-v.3.0.0) - 2023-01-20 ### Added -- `-fno-optimize-sibling-calls` flag added to AVR toolchain. - Optional permission map parameter to `Allocatable.allocate_bom`, which enables developers to express where segments of one set of permissions may be placed in the destination binary. For example, a developer may specify to place `MemoryPermissions.R` `Segments` in destination program `MemoryRegions` of `MemoryPermissions.R` @@ -35,11 +41,6 @@ or `MemoryPermissions.RX`. - Make toolchain names in `toolchain.conf` more specific: - `GNU_ARM_NONE` changed to `GNU_ARM_NONE_EABI_10_2_1`. - `GNU_X86_64_LINUX` changed to `GNU_X86_64_LINUX_EABI_10_3_0`. -- Pass `-mmcu` value to the AVR preprocessor. -- Raise a more descriptive error on toolchain failure. - -### Fixed -- Toolchain `preprocess()` method now returns the path to the preprocessed file. ### Removed - Removed `ToolchainVersion`. From d55e8c9ff8c8f149f875d258d6caed76c6052342 Mon Sep 17 00:00:00 2001 From: edward Date: Tue, 25 Apr 2023 15:28:57 -0400 Subject: [PATCH 3/5] bump pre release num --- ofrak_core/setup.py | 2 +- ofrak_patch_maker/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ofrak_core/setup.py b/ofrak_core/setup.py index ac1cf3fd5..43891c957 100644 --- a/ofrak_core/setup.py +++ b/ofrak_core/setup.py @@ -40,7 +40,7 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak", - version="3.0.0rc6", + version="3.0.0rc7", description="A binary analysis and modification platform", packages=setuptools.find_packages(exclude=["test_ofrak", "test_ofrak.*"]), package_data={ diff --git a/ofrak_patch_maker/setup.py b/ofrak_patch_maker/setup.py index 7fb03fc53..42ebf95d7 100644 --- a/ofrak_patch_maker/setup.py +++ b/ofrak_patch_maker/setup.py @@ -31,7 +31,7 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak_patch_maker", - version="4.0.0rc3", + version="4.0.0rc4", description="PatchMaker tool for applying source-code patches to binaries", packages=setuptools.find_packages(exclude=("ofrak_patch_maker_test",)), package_data={"ofrak_patch_maker": ["py.typed"]}, From ae9fc662fca47189bf4f4a12440d6ef21a55bc77 Mon Sep 17 00:00:00 2001 From: edward Date: Tue, 25 Apr 2023 15:31:22 -0400 Subject: [PATCH 4/5] consistent changelog format --- ofrak_core/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ofrak_core/CHANGELOG.md b/ofrak_core/CHANGELOG.md index 0d7a9f169..10435f3c9 100644 --- a/ofrak_core/CHANGELOG.md +++ b/ofrak_core/CHANGELOG.md @@ -10,16 +10,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Add call to flush a resource to disk in the script whenever a user downloads a resource from the GUI. ([#277](https://github.com/redballoonsecurity/ofrak/pull/277)) - Generate dynamic, runnable script based on GUI actions and display the script in the GUI. ([#265](https://github.com/redballoonsecurity/ofrak/pull/265)) - Add `-f`/`--file` option to `ofrak gui` command to pre-load some files into OFRAK before opening the GUI, so they can be explored right away ([#266](https://github.com/redballoonsecurity/ofrak/pull/266)) -- Add `-i`/`--import` option to the CLI to import and discover additional OFRAK Python packages when starting OFRAK. [#269](https://github.com/redballoonsecurity/ofrak/pull/269) -- Add Identifier to tag `ComplexBlocks` as `LinkableSymbols` and Analyzer to copy attributes from a `ComplexBlock` to its `LinkableSymbol`. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) -- Add method to create new `LinkableSymbols` from symbols defined in a patch file. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) +- Add `-i`/`--import` option to the CLI to import and discover additional OFRAK Python packages when starting OFRAK. ([#269](https://github.com/redballoonsecurity/ofrak/pull/269)) +- Add Identifier to tag `ComplexBlocks` as `LinkableSymbols` and Analyzer to copy attributes from a `ComplexBlock` to its `LinkableSymbol`. ([#226](https://github.com/redballoonsecurity/ofrak/pull/226)) +- Add method to create new `LinkableSymbols` from symbols defined in a patch file. ([#226](https://github.com/redballoonsecurity/ofrak/pull/226)) ### Changed - Remove need to create Resources to pass source code and headers to `PatchFromSourceModifier` and `FunctionReplaceModifier` ([#249](https://github.com/redballoonsecurity/ofrak/pull/249)) - Choose Analyzer components which output the entirety of a view, rather than piece by piece, which would choose the wrong Analyzer sometimes. ([#264](https://github.com/redballoonsecurity/ofrak/pull/264)) - Generate LinkableBinary stubs as strong symbols, so linker use them to override weak symbols in patch ([#259](https://github.com/redballoonsecurity/ofrak/pull/259)) -- Limit stub file creation for linkable BOMs to only those required by a patch. [#226](https://github.com/redballoonsecurity/ofrak/pull/226) +- Limit stub file creation for linkable BOMs to only those required by a patch. ([#226](https://github.com/redballoonsecurity/ofrak/pull/226)) ### Fixed - Fix bug where `ComponentExternalTool` would raise an error when checking whether a tool was installed returned a non-zero exit value ([#289](https://github.com/redballoonsecurity/ofrak/pull/289)) From 90f5decaac5249774d56f9ce2adb255f6a7d096a Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 26 Apr 2023 14:02:42 -0400 Subject: [PATCH 5/5] final version bumps --- frontend/package.json | 2 +- frontend/src/App.svelte | 2 +- ofrak_core/setup.py | 2 +- ofrak_patch_maker/setup.py | 2 +- ofrak_type/setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index cc2df1834..87296224c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "ofrak-app", - "version": "2.2.1", + "version": "3.0.0", "description": "The graphical front-end for OFRAK.", "homepage": "https://ofrak.com", "private": true, diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index c992b02e3..204161b61 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -246,5 +246,5 @@ Answer by running riddle.answer('your answer here') from the console.`); {/if} diff --git a/ofrak_core/setup.py b/ofrak_core/setup.py index 43891c957..ab3ec2d5c 100644 --- a/ofrak_core/setup.py +++ b/ofrak_core/setup.py @@ -40,7 +40,7 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak", - version="3.0.0rc7", + version="3.0.0", description="A binary analysis and modification platform", packages=setuptools.find_packages(exclude=["test_ofrak", "test_ofrak.*"]), package_data={ diff --git a/ofrak_patch_maker/setup.py b/ofrak_patch_maker/setup.py index 42ebf95d7..75d92e146 100644 --- a/ofrak_patch_maker/setup.py +++ b/ofrak_patch_maker/setup.py @@ -31,7 +31,7 @@ def read_requirements(requirements_path): setuptools.setup( name="ofrak_patch_maker", - version="4.0.0rc4", + version="4.0.0", description="PatchMaker tool for applying source-code patches to binaries", packages=setuptools.find_packages(exclude=("ofrak_patch_maker_test",)), package_data={"ofrak_patch_maker": ["py.typed"]}, diff --git a/ofrak_type/setup.py b/ofrak_type/setup.py index 4470e9268..38bad8ece 100644 --- a/ofrak_type/setup.py +++ b/ofrak_type/setup.py @@ -21,7 +21,7 @@ def run(self): setuptools.setup( name="ofrak_type", - version="2.2.0rc1", + version="2.2.0", description="Custom classes and types used in OFRAK", package_data={ "ofrak_type": ["py.typed"],