Skip to content

Commit

Permalink
Re-scope Mach-O enums
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed May 9, 2024
1 parent 9aec6c0 commit e460742
Show file tree
Hide file tree
Showing 187 changed files with 4,869 additions and 6,950 deletions.
1 change: 0 additions & 1 deletion api/c/MachO/CMakeLists.txt
@@ -1,5 +1,4 @@
target_sources(LIB_LIEF PRIVATE
EnumToString.cpp
Parser.cpp
LoadCommand.cpp
Segment.cpp
Expand Down
76 changes: 0 additions & 76 deletions api/c/MachO/EnumToString.cpp

This file was deleted.

4 changes: 1 addition & 3 deletions api/c/MachO/Section.cpp
Expand Up @@ -36,7 +36,7 @@ void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
c_binary->sections[i]->alignment = section.alignment();
c_binary->sections[i]->relocation_offset = section.relocation_offset();
c_binary->sections[i]->numberof_relocations = section.numberof_relocations();
c_binary->sections[i]->flags = section.flags();
c_binary->sections[i]->flags = section.raw_flags();
c_binary->sections[i]->type = static_cast<enum LIEF_MACHO_MACHO_SECTION_TYPES>(section.type());
c_binary->sections[i]->reserved1 = section.reserved1();
c_binary->sections[i]->reserved2 = section.reserved2();
Expand All @@ -53,7 +53,6 @@ void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
}



void destroy_sections(Macho_Binary_t* c_binary) {
Macho_Section_t **sections = c_binary->sections;
for (size_t idx = 0; sections[idx] != nullptr; ++idx) {
Expand All @@ -67,4 +66,3 @@ void destroy_sections(Macho_Binary_t* c_binary) {
}
}


1 change: 0 additions & 1 deletion api/c/include/LIEF/MachO.h
Expand Up @@ -22,5 +22,4 @@
#include "LIEF/MachO/Section.h"
#include "LIEF/MachO/LoadCommand.h"
#include "LIEF/MachO/Header.h"
#include "LIEF/MachO/EnumToString.h"
#endif
41 changes: 0 additions & 41 deletions api/c/include/LIEF/MachO/EnumToString.h

This file was deleted.

10 changes: 5 additions & 5 deletions api/python/examples/macho_reader.py
Expand Up @@ -173,19 +173,19 @@ def print_sections(binary):
name = reloc.symbol.name if reloc.has_symbol else ""
secname = " - " + reloc.section.name if reloc.has_section else ""
type = str(reloc.type)
if reloc.architecture == MachO.CPU_TYPES.x86:
if reloc.architecture == MachO.Header.CPU_TYPE.X86:
type = str(MachO.X86_RELOCATION(reloc.type))

if reloc.architecture == MachO.CPU_TYPES.x86_64:
if reloc.architecture == MachO.Header.CPU_TYPE.x86_64:
type = str(MachO.X86_64_RELOCATION(reloc.type))

if reloc.architecture == MachO.CPU_TYPES.ARM:
if reloc.architecture == MachO.Header.CPU_TYPE.ARM:
type = str(MachO.ARM_RELOCATION(reloc.type))

if reloc.architecture == MachO.CPU_TYPES.ARM64:
if reloc.architecture == MachO.Header.CPU_TYPE.ARM64:
type = str(MachO.ARM64_RELOCATION(reloc.type))

if reloc.architecture == MachO.CPU_TYPES.POWERPC:
if reloc.architecture == MachO.Header.CPU_TYPE.POWERPC:
type = str(MachO.PPC_RELOCATION(reloc.type))


Expand Down

0 comments on commit e460742

Please sign in to comment.