Skip to content

Commit

Permalink
Remove incomplete, untested LLVM_MACH_O_Parser (redballoonsecurity#155)
Browse files Browse the repository at this point in the history
* Remove incomplete, untested LLVM_MACH_O_Parser

* Bump function coverage to 87 for ofrak_patch_maker

* Remove "ofrak" dependency, as it is no longer needed after redballoonsecurity#151.

Co-authored-by: Edward Larson <[email protected]>
  • Loading branch information
whyitfor and EdwardLarson committed Jan 5, 2023
1 parent 8ab2a86 commit aeb1937
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ofrak_patch_maker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ inspect:
.PHONY: test
test: inspect
$(PYTHON) -m pytest -n auto --cov=ofrak_patch_maker --cov-report=term-missing ofrak_patch_maker_test
fun-coverage --cov-fail-under=85
fun-coverage --cov-fail-under=87

.PHONY: dependencies
dependencies:
Expand Down
18 changes: 0 additions & 18 deletions ofrak_patch_maker/ofrak_patch_maker/binary_parser/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,3 @@ def parse_symbols(self, readobj_out: str) -> Dict[str, int]:
if symbol_section and symbol_section.group(0) != "Undefined":
result.update({name.group(0): int(addr_value.group(0), 16)})
return result


class LLVM_MACH_O_Parser(Abstract_LLVM_Readobj_Parser):
file_format = BinFileType.MACH_O

def parse_sections(self, output: str) -> Tuple[Segment, ...]:
section_keys = {
"Name": "segment_name",
"Address": "vm_address",
"Offset": "offset",
"Size": "length",
"Attributes": "access_perms",
}

return self._parse_readobj_sections(output, section_keys, "Attributes")

def parse_symbols(self, output: str) -> Dict[str, int]:
raise NotImplementedError()
9 changes: 5 additions & 4 deletions ofrak_patch_maker/ofrak_patch_maker/toolchain/llvm_12.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from typing import List, Mapping, Optional, Tuple, Dict

from ofrak_type import ArchInfo
from ofrak_patch_maker.binary_parser.llvm import LLVM_ELF_Parser, LLVM_MACH_O_Parser
from ofrak_type.architecture import InstructionSet
from ofrak_type.memory_permissions import MemoryPermissions

from ofrak_patch_maker.binary_parser.llvm import LLVM_ELF_Parser
from ofrak_patch_maker.toolchain.abstract import Toolchain, RBS_AUTOGEN_WARNING
from ofrak_patch_maker.toolchain.model import (
Segment,
Expand All @@ -14,12 +17,10 @@
ToolchainException,
)
from ofrak_patch_maker.toolchain.utils import get_file_format
from ofrak_type.architecture import InstructionSet
from ofrak_type.memory_permissions import MemoryPermissions


class LLVM_12_0_1_Toolchain(Toolchain):
binary_file_parsers = [LLVM_ELF_Parser(), LLVM_MACH_O_Parser()]
binary_file_parsers = [LLVM_ELF_Parser()]

def __init__(
self,
Expand Down

0 comments on commit aeb1937

Please sign in to comment.