Skip to content

Commit

Permalink
Add enums for DYLD_CHAINED_PTR_ARM64E_SHARED_CACHE
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Dec 13, 2024
1 parent 9e8f30c commit 535375f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/python/src/MachO/enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ void init_enums(nb::module_& m) {
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_USERLAND))
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_FIRMWARE))
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_X86_64_KERNEL_CACHE))
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_USERLAND24));
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_USERLAND24))
.value(PY_ENUM(DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_SHARED_CACHE));

}
}
2 changes: 2 additions & 0 deletions include/LIEF/MachO/ChainedPointerAnalysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class LIEF_API ChainedPointerAnalysis {
case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E:
case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_USERLAND:
case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_USERLAND24:
case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_SHARED_CACHE:
return 8;

case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_KERNEL:
Expand Down Expand Up @@ -270,6 +271,7 @@ class LIEF_API ChainedPointerAnalysis {
case DYLD_CHAINED_PTR_FORMAT::PTR_64_OFFSET:
case DYLD_CHAINED_PTR_FORMAT::PTR_64_KERNEL_CACHE:
case DYLD_CHAINED_PTR_FORMAT::PTR_X86_64_KERNEL_CACHE:
case DYLD_CHAINED_PTR_FORMAT::PTR_ARM64E_SHARED_CACHE:
return sizeof(uint64_t);

case DYLD_CHAINED_PTR_FORMAT::PTR_32_FIRMWARE:
Expand Down
1 change: 1 addition & 0 deletions include/LIEF/MachO/DyldChainedFormat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum class DYLD_CHAINED_PTR_FORMAT {
PTR_ARM64E_FIRMWARE = 10, // stride 4, unauth target is vmaddr
PTR_X86_64_KERNEL_CACHE = 11, // stride 1, x86_64 kernel caches
PTR_ARM64E_USERLAND24 = 12, // stride 8, unauth target is vm offset, 24-bit bind
PTR_ARM64E_SHARED_CACHE = 13, // stride 8, regular/auth targets both vm offsets. Only A keys supported
};

LIEF_API const char* to_string(DYLD_CHAINED_FORMAT fmt);
Expand Down
1 change: 1 addition & 0 deletions src/MachO/DyldChainedFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const char* to_string(DYLD_CHAINED_PTR_FORMAT e) {
ENTRY(PTR_ARM64E_FIRMWARE),
ENTRY(PTR_X86_64_KERNEL_CACHE),
ENTRY(PTR_ARM64E_USERLAND24),
ENTRY(PTR_ARM64E_SHARED_CACHE),
};
#undef ENTRY

Expand Down

0 comments on commit 535375f

Please sign in to comment.