Skip to content

Commit

Permalink
dumper: Make Mach-O header sizes print unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jul 21, 2024
1 parent 85b5e86 commit 852c20d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/adbg/objects/macho.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 852c20d

Please sign in to comment.