diff --git a/macho_edit/load_command.cpp b/macho_edit/load_command.cpp index 0db9616..28eede2 100644 --- a/macho_edit/load_command.cpp +++ b/macho_edit/load_command.cpp @@ -155,6 +155,24 @@ std::string LoadCommand::description() const { break; } +#ifdef LC_BUILD_VERSION + case LC_VERSION_MIN_TVOS: + case LC_VERSION_MIN_WATCHOS: { + auto *c = (version_min_command *)raw_lc; + o << ": " << c->version << "-" << c->sdk; + break; + } + case LC_NOTE: { + auto *c = (note_command *)raw_lc; + o << ": " << std::string(c->data_owner, ELEMENTS(c->data_owner)); + break; + } + case LC_BUILD_VERSION: { + auto *c = (build_version_command *)raw_lc; + o << ": " << c->platform << "-" << c->minos << "-" << c->sdk << "-" << c->ntools; + break; + } +#endif } return o.str(); diff --git a/macho_edit/magicnames.cpp b/macho_edit/magicnames.cpp index 5740716..dbb76d5 100644 --- a/macho_edit/magicnames.cpp +++ b/macho_edit/magicnames.cpp @@ -73,6 +73,12 @@ std::string cmd_name(uint32_t cmd) { RET_NAME(LC_ENCRYPTION_INFO_64); RET_NAME(LC_LINKER_OPTION); RET_NAME(LC_LINKER_OPTIMIZATION_HINT); +#ifdef LC_BUILD_VERSION + RET_NAME(LC_VERSION_MIN_TVOS); + RET_NAME(LC_VERSION_MIN_WATCHOS); + RET_NAME(LC_NOTE); + RET_NAME(LC_BUILD_VERSION); +#endif } std::ostringstream o; diff --git a/macho_edit/menu.cpp b/macho_edit/menu.cpp index ee919ea..328513b 100644 --- a/macho_edit/menu.cpp +++ b/macho_edit/menu.cpp @@ -283,7 +283,7 @@ load_command *get_path_cmd(const char *prompt, size_t header_size, uint32_t *cmd uint32_t path_size = (uint32_t)ROUND_UP(path.length() + 1, PATH_PADDING); *cmdsize = (uint32_t)header_size + path_size; - load_command *lc = (load_command *)malloc(*cmdsize); + load_command *lc = (load_command *)calloc(*cmdsize, sizeof(char)); memcpy(((uint8_t *)lc) + header_size, path.c_str(), path.length()); return lc; }