Skip to content

Commit

Permalink
Add more platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Dec 13, 2024
1 parent 80fec16 commit 29b79cb
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/python/lief/MachO/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,18 @@ class BuildVersion(LoadCommand):

SEPOS = 14

MACOS_EXCLAVE_CORE = 15

MACOS_EXCLAVE_KIT = 16

IOS_EXCLAVE_CORE = 17

IOS_EXCLAVE_KIT = 18

TVOS_EXCLAVE_CORE = 19

TVOS_EXCLAVE_KIT = 20

ANY = 4294967295

platform: lief.MachO.BuildVersion.PLATFORMS
Expand Down
6 changes: 6 additions & 0 deletions api/python/src/MachO/objects/pyBuildVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ void create<BuildVersion>(nb::module_& m) {
.value(PY_ENUM(BuildVersion::PLATFORMS::VISIONOS_SIMULATOR))
.value(PY_ENUM(BuildVersion::PLATFORMS::FIRMWARE))
.value(PY_ENUM(BuildVersion::PLATFORMS::SEPOS))
.value(PY_ENUM(BuildVersion::PLATFORMS::MACOS_EXCLAVE_CORE))
.value(PY_ENUM(BuildVersion::PLATFORMS::MACOS_EXCLAVE_KIT))
.value(PY_ENUM(BuildVersion::PLATFORMS::IOS_EXCLAVE_CORE))
.value(PY_ENUM(BuildVersion::PLATFORMS::IOS_EXCLAVE_KIT))
.value(PY_ENUM(BuildVersion::PLATFORMS::TVOS_EXCLAVE_CORE))
.value(PY_ENUM(BuildVersion::PLATFORMS::TVOS_EXCLAVE_KIT))
.value(PY_ENUM(BuildVersion::PLATFORMS::ANY))
;

Expand Down
12 changes: 12 additions & 0 deletions api/rust/cargo/lief/src/macho/commands/build_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ pub enum Platform {
VISIONOS_SIMULATOR,
FIRMWARE,
SEPOS,
MACOS_EXCLAVE_CORE,
MACOS_EXCLAVE_KIT,
IOS_EXCLAVE_CORE,
IOS_EXCLAVE_KIT,
TVOS_EXCLAVE_CORE,
TVOS_EXCLAVE_KIT,
ANY,
UNKNOWN(u32),
}
Expand All @@ -49,6 +55,12 @@ impl From<u32> for Platform {
0x0000000C => Platform::VISIONOS_SIMULATOR,
0x0000000D => Platform::FIRMWARE,
0x0000000E => Platform::SEPOS,
0x0000000F => Platform::MACOS_EXCLAVE_CORE,
0x00000010 => Platform::MACOS_EXCLAVE_KIT,
0x00000011 => Platform::IOS_EXCLAVE_CORE,
0x00000012 => Platform::IOS_EXCLAVE_KIT,
0x00000013 => Platform::TVOS_EXCLAVE_CORE,
0x00000014 => Platform::TVOS_EXCLAVE_KIT,
0xFFFFFFFF => Platform::ANY,
_ => Platform::UNKNOWN(value),
}
Expand Down
6 changes: 6 additions & 0 deletions include/LIEF/MachO/BuildVersion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ class LIEF_API BuildVersion : public LoadCommand {
VISIONOS_SIMULATOR = 12,
FIRMWARE = 13,
SEPOS = 14,
MACOS_EXCLAVE_CORE = 15,
MACOS_EXCLAVE_KIT = 16,
IOS_EXCLAVE_CORE = 17,
IOS_EXCLAVE_KIT = 18,
TVOS_EXCLAVE_CORE = 19,
TVOS_EXCLAVE_KIT = 20,

ANY = 0xFFFFFFFF
};
Expand Down
6 changes: 6 additions & 0 deletions src/MachO/BuildVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ const char* to_string(BuildVersion::PLATFORMS e) {
ENTRY(VISIONOS_SIMULATOR),
ENTRY(FIRMWARE),
ENTRY(SEPOS),
ENTRY(MACOS_EXCLAVE_CORE),
ENTRY(MACOS_EXCLAVE_KIT),
ENTRY(IOS_EXCLAVE_CORE),
ENTRY(IOS_EXCLAVE_KIT),
ENTRY(TVOS_EXCLAVE_CORE),
ENTRY(TVOS_EXCLAVE_KIT),

ENTRY(ANY),
};
Expand Down

0 comments on commit 29b79cb

Please sign in to comment.