Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions disassemblers/ofrak_pyghidra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Fixed
- Fix Ghidra and pyghidra CodeRegion unpacker to take into account the base address that ghidra sets for PIE executables.([#627](https://github.com/redballoonsecurity/ofrak/pull/627))
- Fix auto discovery of `PyGhidraDecompilationAnalyzer` ([#650](https://github.com/redballoonsecurity/ofrak/pull/650))
### Changed
- Reduce the decompilation time of PyGhidra by reusing cached unpacking results. ([#623](https://github.com/redballoonsecurity/ofrak/pull/623))
- Improve `ofrak_pyghidra` decompilation: more strings and symbol names for cross-references in decompilation. ([#633](https://github.com/redballoonsecurity/ofrak/pull/633))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ class PyGhidraBasicBlockUnpacker(CachedBasicBlockUnpacker):


class PyGhidraDecompilationAnalyzer(CachedDecompilationAnalyzer):
id = b"PyGhidraDecompilationAnalyzer"

targets = (ComplexBlock,)
outputs = (DecompilationAnalysis,)

Expand Down
11 changes: 7 additions & 4 deletions disassemblers/ofrak_pyghidra/tests/test_pyghidra_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
ComplexBlockUnpackerUnpackAndVerifyPattern,
ComplexBlockUnpackerTestCase,
)
from ofrak.core.decompilation import DecompilationAnalysis, DecompilationAnalyzer
from ofrak.core.decompilation import DecompilationAnalysis
from pytest_ofrak.patterns.basic_block_unpacker import BasicBlockUnpackerUnpackAndVerifyPattern
from ofrak_pyghidra.components.pyghidra_components import _arch_info_to_processor_id
from ofrak_pyghidra.components.pyghidra_components import (
_arch_info_to_processor_id,
PyGhidraDecompilationAnalyzer,
)
from ofrak_type import ArchInfo, Endianness, InstructionSet
import ofrak_pyghidra
from ofrak.core.code_region import CodeRegion
Expand Down Expand Up @@ -143,7 +146,7 @@ async def test_decompilation(ofrak_context: OFRAKContext):
)
decomps = []
for complex_block in complex_blocks:
await complex_block.resource.run(DecompilationAnalyzer)
await complex_block.resource.run(PyGhidraDecompilationAnalyzer)
pyghidra_resource: DecompilationAnalysis = await complex_block.resource.view_as(
DecompilationAnalysis
)
Expand Down Expand Up @@ -237,7 +240,7 @@ async def test_strings_in_decomp(freertos_resource, ofrak_injector):
)
),
)
await complex_block.resource.run(DecompilationAnalyzer)
await complex_block.resource.run(PyGhidraDecompilationAnalyzer)
decomp_resource: DecompilationAnalysis = await complex_block.resource.view_as(
DecompilationAnalysis
)
Expand Down
Loading