From 852c20d01cd6f90abc37a66927014eafd2ca3423 Mon Sep 17 00:00:00 2001
From: dd86k
Date: Sun, 21 Jul 2024 13:57:32 -0400
Subject: [PATCH] dumper: Make Mach-O header sizes print unsigned
---
src/adbg/objects/macho.d | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/adbg/objects/macho.d b/src/adbg/objects/macho.d
index 30094cc5..4ecde0a2 100644
--- a/src/adbg/objects/macho.d
+++ b/src/adbg/objects/macho.d
@@ -749,6 +749,24 @@ macho_load_command_t* adbg_object_macho_load_command(adbg_object_t *o, size_t in
return command;
}
+uint* adbg_object_macho_load_command_count(adbg_object_t *o) {
+ if (o == null) {
+ adbg_oops(AdbgError.invalidArgument);
+ return null;
+ }
+ if (o.internal == null) {
+ adbg_oops(AdbgError.uninitiated);
+ return null;
+ }
+ if (o.status & MACHO_IS_FAT) {
+ adbg_oops(AdbgError.unavailable);
+ return null;
+ }
+
+ internal_macho_t *internal = cast(internal_macho_t*)o.internal;
+ return &internal.header.ncmds;
+}
+
void* adbg_object_macho_segment_section(adbg_object_t *o, macho_load_command_t *c, size_t index) {
if (o == null || c == null) {
adbg_oops(AdbgError.invalidArgument);