From 7e92e6eee0258560d26f633d39df92d556f40d97 Mon Sep 17 00:00:00 2001 From: horsicq Date: Fri, 20 Dec 2024 00:21:48 +0100 Subject: [PATCH] Update file(s): 2024-12-20 --- AbstractWidgets/Structs/xmach_defs.cpp | 48 ++++++------ AbstractWidgets/abstractwidgets.cmake | 3 + AbstractWidgets/abstractwidgets.pri | 3 + AbstractWidgets/xformatwidget.cmake | 5 +- AbstractWidgets/xformatwidget.cpp | 95 ++++++++++++++++-------- AbstractWidgets/xformatwidget.h | 1 - AbstractWidgets/xformatwidget_def.h | 6 +- AbstractWidgets/xgenericheaderwidget.cpp | 10 +-- AbstractWidgets/xgenericheaderwidget.h | 3 - AbstractWidgets/xgenerictablewidget.cpp | 8 -- AbstractWidgets/xgenerictablewidget.h | 3 - AbstractWidgets/xmainwidget.cpp | 16 ++-- AbstractWidgets/xmainwidget.h | 2 +- 13 files changed, 109 insertions(+), 94 deletions(-) diff --git a/AbstractWidgets/Structs/xmach_defs.cpp b/AbstractWidgets/Structs/xmach_defs.cpp index 7c94a046..d357c8ed 100644 --- a/AbstractWidgets/Structs/xmach_defs.cpp +++ b/AbstractWidgets/Structs/xmach_defs.cpp @@ -47,14 +47,14 @@ const XFW_DEF::HEADER_RECORD records64[] = { namespace X_load_commands { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::load_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::load_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::load_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, }; } // namespace X_load_commands namespace X_segment_command { const XFW_DEF::HEADER_RECORD records32[] = { {cmd, "cmd", offsetof(XMACH_DEF::segment_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::segment_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::segment_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {segname, "segname", offsetof(XMACH_DEF::segment_command, segname), 16, "char[16]", XFW_DEF::VAL_TYPE_DATA_ARRAY | XFW_DEF::VAL_TYPE_ANSI | XFW_DEF::VAL_TYPE_STRING, -1}, {vmaddr, "vmaddr", offsetof(XMACH_DEF::segment_command, vmaddr), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_ADDRESS | XFW_DEF::VAL_TYPE_CODE, -1}, @@ -69,7 +69,7 @@ const XFW_DEF::HEADER_RECORD records32[] = { const XFW_DEF::HEADER_RECORD records64[] = { {cmd, "cmd", offsetof(XMACH_DEF::segment_command_64, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::segment_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::segment_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {segname, "segname", offsetof(XMACH_DEF::segment_command_64, segname), 16, "char[16]", XFW_DEF::VAL_TYPE_DATA_ARRAY | XFW_DEF::VAL_TYPE_ANSI | XFW_DEF::VAL_TYPE_STRING, -1}, {vmaddr, "vmaddr", offsetof(XMACH_DEF::segment_command_64, vmaddr), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_ADDRESS | XFW_DEF::VAL_TYPE_CODE, -1}, @@ -119,7 +119,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_dylib_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::load_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::load_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::load_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {name, "name", sizeof(XMACH_DEF::load_command) + offsetof(XMACH_DEF::dylib, name), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET | XFW_DEF::VAL_TYPE_RELTOSTRUCT | XFW_DEF::VAL_TYPE_ANSI, -1}, {timestamp, "timestamp", sizeof(XMACH_DEF::load_command) + offsetof(XMACH_DEF::dylib, timestamp), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {current_version, "current_version", sizeof(XMACH_DEF::load_command) + offsetof(XMACH_DEF::dylib, current_version), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, @@ -139,7 +139,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_dyld_info_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::dyld_info_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::dyld_info_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::dyld_info_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {rebase_off, "rebase_off", offsetof(XMACH_DEF::dyld_info_command, rebase_off), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {rebase_size, "rebase_size", offsetof(XMACH_DEF::dyld_info_command, rebase_size), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, {bind_off, "bind_off", offsetof(XMACH_DEF::dyld_info_command, bind_off), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, @@ -156,7 +156,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_uuid_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::uuid_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::uuid_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::uuid_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {uuid, "uuid", offsetof(XMACH_DEF::uuid_command, uuid), 16, "bytes", XFW_DEF::VAL_TYPE_DATA_ARRAY | XFW_DEF::VAL_TYPE_UUID_, -1}, }; } @@ -164,7 +164,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_dylinker_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::dylinker_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::dylinker_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::dylinker_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {name, "name", offsetof(XMACH_DEF::dylinker_command, name), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET | XFW_DEF::VAL_TYPE_RELTOSTRUCT | XFW_DEF::VAL_TYPE_ANSI, -1}, }; } @@ -172,7 +172,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_rpath_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::rpath_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::rpath_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::rpath_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {path, "path", offsetof(XMACH_DEF::rpath_command, path), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET | XFW_DEF::VAL_TYPE_RELTOSTRUCT | XFW_DEF::VAL_TYPE_ANSI, -1}, }; } @@ -180,7 +180,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_sub_umbrella_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::sub_umbrella_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_umbrella_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_umbrella_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {sub_umbrella, "sub_umbrella", offsetof(XMACH_DEF::sub_umbrella_command, sub_umbrella), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, }; } @@ -188,7 +188,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_sub_client_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::sub_client_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_client_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_client_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {client, "client", offsetof(XMACH_DEF::sub_client_command, client), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, }; } @@ -196,7 +196,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_sub_library_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::sub_library_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_library_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::sub_library_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {sub_library, "sub_library", offsetof(XMACH_DEF::sub_library_command, sub_library), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, }; } @@ -204,7 +204,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_symtab_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::symtab_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::symtab_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::symtab_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {symoff, "symoff", offsetof(XMACH_DEF::symtab_command, symoff), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {nsyms, "nsyms", offsetof(XMACH_DEF::symtab_command, nsyms), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_COUNT, -1}, {stroff, "stroff", offsetof(XMACH_DEF::symtab_command, stroff), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, @@ -215,7 +215,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_dysymtab_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::dysymtab_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::dysymtab_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::dysymtab_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {ilocalsym, "ilocalsym", offsetof(XMACH_DEF::dysymtab_command, ilocalsym), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {nlocalsym, "nlocalsym", offsetof(XMACH_DEF::dysymtab_command, nlocalsym), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_COUNT, -1}, {iextdefsym, "iextdefsym", offsetof(XMACH_DEF::dysymtab_command, iextdefsym), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, @@ -240,7 +240,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_version_min_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::version_min_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::version_min_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::version_min_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {version, "version", offsetof(XMACH_DEF::version_min_command, version), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, {sdk, "sdk", offsetof(XMACH_DEF::version_min_command, sdk), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, }; @@ -249,7 +249,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_build_version_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::build_version_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::build_version_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::build_version_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {platform, "platform", offsetof(XMACH_DEF::build_version_command, platform), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {minos, "minos", offsetof(XMACH_DEF::build_version_command, minos), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, {sdk, "sdk", offsetof(XMACH_DEF::build_version_command, sdk), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, @@ -260,7 +260,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_source_version_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::source_version_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::source_version_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::source_version_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {version, "version", offsetof(XMACH_DEF::source_version_command, version), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_VERSION, -1}, }; } @@ -268,7 +268,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_encryption_info_command { const XFW_DEF::HEADER_RECORD records32[] = { {cmd, "cmd", offsetof(XMACH_DEF::encryption_info_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::encryption_info_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::encryption_info_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {cryptoff, "cryptoff", offsetof(XMACH_DEF::encryption_info_command, cryptoff), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {cryptsize, "cryptsize", offsetof(XMACH_DEF::encryption_info_command, cryptsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, cryptoff}, {cryptid, "cryptid", offsetof(XMACH_DEF::encryption_info_command, cryptid), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, @@ -276,7 +276,7 @@ const XFW_DEF::HEADER_RECORD records32[] = { const XFW_DEF::HEADER_RECORD records64[] = { {cmd, "cmd", offsetof(XMACH_DEF::encryption_info_command_64, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::encryption_info_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::encryption_info_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {cryptoff, "cryptoff", offsetof(XMACH_DEF::encryption_info_command_64, cryptoff), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {cryptsize, "cryptsize", offsetof(XMACH_DEF::encryption_info_command_64, cryptsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, cryptoff}, {cryptid, "cryptid", offsetof(XMACH_DEF::encryption_info_command_64, cryptid), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, @@ -286,7 +286,7 @@ const XFW_DEF::HEADER_RECORD records64[] = { namespace X_linkedit_data_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::linkedit_data_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::linkedit_data_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::linkedit_data_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {dataoff, "dataoff", offsetof(XMACH_DEF::linkedit_data_command, dataoff), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {datasize, "datasize", offsetof(XMACH_DEF::linkedit_data_command, datasize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, dataoff}, }; @@ -295,7 +295,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_entry_point_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::entry_point_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::entry_point_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::entry_point_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {entryoff, "entryoff", offsetof(XMACH_DEF::entry_point_command, entryoff), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {stacksize, "stacksize", offsetof(XMACH_DEF::entry_point_command, stacksize), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, }; @@ -304,7 +304,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_fileset_entry_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::fileset_entry_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::fileset_entry_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::fileset_entry_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {vmaddr, "vmaddr", offsetof(XMACH_DEF::fileset_entry_command, vmaddr), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_ADDRESS, -1}, {fileoff, "fileoff", offsetof(XMACH_DEF::fileset_entry_command, fileoff), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, {entry_id, "entry_id", offsetof(XMACH_DEF::fileset_entry_command, entry_id), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_OFFSET, -1}, @@ -315,7 +315,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_unix_thread_command { const XFW_DEF::HEADER_RECORD records[] = { {cmd, "cmd", offsetof(XMACH_DEF::unix_thread_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::unix_thread_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::unix_thread_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {flavor, "flavor", offsetof(XMACH_DEF::unix_thread_command, flavor), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {count, "count", offsetof(XMACH_DEF::unix_thread_command, count), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, }; @@ -324,7 +324,7 @@ const XFW_DEF::HEADER_RECORD records[] = { namespace X_routines_command { const XFW_DEF::HEADER_RECORD records32[] = { {cmd, "cmd", offsetof(XMACH_DEF::routines_command, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::routines_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::routines_command, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {init_address, "init_address", offsetof(XMACH_DEF::routines_command, init_address), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_ADDRESS, -1}, {init_module, "init_module", offsetof(XMACH_DEF::routines_command, init_module), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {reserved1, "reserved1", offsetof(XMACH_DEF::routines_command, reserved1), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, @@ -336,7 +336,7 @@ const XFW_DEF::HEADER_RECORD records32[] = { }; const XFW_DEF::HEADER_RECORD records64[] = { {cmd, "cmd", offsetof(XMACH_DEF::routines_command_64, cmd), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT, -1}, - {cmdsize, "cmdsize", offsetof(XMACH_DEF::routines_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE, -1}, + {cmdsize, "cmdsize", offsetof(XMACH_DEF::routines_command_64, cmdsize), 4, "uint32", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_SIZE | XFW_DEF::VAL_TYPE_RELTOSTRUCT, -1}, {init_address, "init_address", offsetof(XMACH_DEF::routines_command_64, init_address), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT | XFW_DEF::VAL_TYPE_ADDRESS, -1}, {init_module, "init_module", offsetof(XMACH_DEF::routines_command_64, init_module), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT, -1}, {reserved1, "reserved1", offsetof(XMACH_DEF::routines_command_64, reserved1), 8, "uint64", XFW_DEF::VAL_TYPE_DATA_INT, -1}, diff --git a/AbstractWidgets/abstractwidgets.cmake b/AbstractWidgets/abstractwidgets.cmake index 24591b05..5000ea9c 100644 --- a/AbstractWidgets/abstractwidgets.cmake +++ b/AbstractWidgets/abstractwidgets.cmake @@ -33,6 +33,9 @@ set(ABSTRACTWIDGETS_SOURCES ${CMAKE_CURRENT_LIST_DIR}/xgenericheaderwidget.cpp ${CMAKE_CURRENT_LIST_DIR}/xgenericheaderwidget.h ${CMAKE_CURRENT_LIST_DIR}/xgenericheaderwidget.ui + ${CMAKE_CURRENT_LIST_DIR}/xgenerichexwidget.cpp + ${CMAKE_CURRENT_LIST_DIR}/xgenerichexwidget.h + ${CMAKE_CURRENT_LIST_DIR}/xgenerichexwidget.ui ${CMAKE_CURRENT_LIST_DIR}/xgenerictablewidget.cpp ${CMAKE_CURRENT_LIST_DIR}/xgenerictablewidget.h ${CMAKE_CURRENT_LIST_DIR}/xgenerictablewidget.ui diff --git a/AbstractWidgets/abstractwidgets.pri b/AbstractWidgets/abstractwidgets.pri index 4de65802..0520396f 100644 --- a/AbstractWidgets/abstractwidgets.pri +++ b/AbstractWidgets/abstractwidgets.pri @@ -17,6 +17,7 @@ HEADERS += \ $$PWD/xformatwidget.h \ $$PWD/xformatwidget_def.h \ $$PWD/xgenericheaderwidget.h \ + $$PWD/xgenerichexwidget.h \ $$PWD/xgenerictablewidget.h \ $$PWD/xmainwidget.h \ $$PWD/xmainwidgetadvanced.h \ @@ -37,6 +38,7 @@ SOURCES += \ $$PWD/xdialogprocessdata.cpp \ $$PWD/xformatwidget.cpp \ $$PWD/xgenericheaderwidget.cpp \ + $$PWD/xgenerichexwidget.cpp \ $$PWD/xgenerictablewidget.cpp \ $$PWD/xmainwidget.cpp \ $$PWD/xmainwidgetadvanced.cpp \ @@ -46,6 +48,7 @@ FORMS += \ $$PWD/dialogsetgenericwidget.ui \ $$PWD/dialogxmainwidget.ui \ $$PWD/xgenericheaderwidget.ui \ + $$PWD/xgenerichexwidget.ui \ $$PWD/xgenerictablewidget.ui \ $$PWD/xmainwidget.ui diff --git a/AbstractWidgets/xformatwidget.cmake b/AbstractWidgets/xformatwidget.cmake index 628dbeb1..1fcc9e44 100644 --- a/AbstractWidgets/xformatwidget.cmake +++ b/AbstractWidgets/xformatwidget.cmake @@ -33,8 +33,11 @@ if (NOT DEFINED XTABLEVIEW_SOURCES) include(${CMAKE_CURRENT_LIST_DIR}/../../Controls/xtableview.cmake) set(XFORMATWIDGET_SOURCES ${XFORMATWIDGET_SOURCES} ${XTABLEVIEW_SOURCES}) endif() +if (NOT DEFINED XDATETIMEEDITX_SOURCES) + include(${CMAKE_CURRENT_LIST_DIR}/../../Controls/xdatetimeeditx.cmake) + set(XFORMATWIDGET_SOURCES ${XFORMATWIDGET_SOURCES} ${XDATETIMEEDITX_SOURCES}) +endif() -include(${CMAKE_CURRENT_LIST_DIR}/../../Controls/xdatetimeeditx.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../XHexView/xhexview.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../XMemoryMapWidget/xmemorymapwidget.cmake) include(${CMAKE_CURRENT_LIST_DIR}/../../XEntropyWidget/xentropywidget.cmake) diff --git a/AbstractWidgets/xformatwidget.cpp b/AbstractWidgets/xformatwidget.cpp index 697cd5ff..ba1a05f7 100644 --- a/AbstractWidgets/xformatwidget.cpp +++ b/AbstractWidgets/xformatwidget.cpp @@ -314,7 +314,7 @@ QString XFormatWidget::getTypeTitle(XFW_DEF::TYPE type, XBinary::MODE mode, XBin sResult = QString("atom_info_command"); } else if (type == XFW_DEF::TYPE_function_starts_command) { sResult = QString("function_starts_command"); - } else if (type == XFW_DEF::TYPE_dyld_exports_trie_command) { + } else if (type == XFW_DEF::TYPE_MACH_dyld_exports_trie_command) { sResult = QString("dyld_exports_trie_command"); } else if (type == XFW_DEF::TYPE_dyld_chained_fixups_command) { sResult = QString("dyld_chained_fixups_command"); @@ -362,6 +362,8 @@ QString XFormatWidget::getTypeTitle(XFW_DEF::TYPE type, XBinary::MODE mode, XBin sResult = QString("section"); } else if (type == XFW_DEF::TYPE_MACH_section_64) { sResult = QString("section_64"); + } else if (type == XFW_DEF::TYPE_MACH_trie_export) { + sResult = tr("Export"); } else if (type == XFW_DEF::TYPE_DEX_HEADER) { sResult = QString("HEADER"); } @@ -432,7 +434,7 @@ QList XFormatWidget::getHeaderRecords(const XFW_DEF::CWO } else if (pCwOptions->_type == XFW_DEF::TYPE_function_starts_command) { pRecords = XTYPE_MACH::X_linkedit_data_command::records; nNumberOfRecords = XTYPE_MACH::X_linkedit_data_command::__data_size; - } else if (pCwOptions->_type == XFW_DEF::TYPE_dyld_exports_trie_command) { + } else if (pCwOptions->_type == XFW_DEF::TYPE_MACH_dyld_exports_trie_command) { pRecords = XTYPE_MACH::X_linkedit_data_command::records; nNumberOfRecords = XTYPE_MACH::X_linkedit_data_command::__data_size; } else if (pCwOptions->_type == XFW_DEF::TYPE_dyld_chained_fixups_command) { @@ -574,7 +576,7 @@ qint64 XFormatWidget::getStructSize(XFW_DEF::TYPE type) nResult = sizeof(XMACH_DEF::linkedit_data_command); } else if (type == XFW_DEF::TYPE_function_starts_command) { nResult = sizeof(XMACH_DEF::linkedit_data_command); - } else if (type == XFW_DEF::TYPE_dyld_exports_trie_command) { + } else if (type == XFW_DEF::TYPE_MACH_dyld_exports_trie_command) { nResult = sizeof(XMACH_DEF::linkedit_data_command); } else if (type == XFW_DEF::TYPE_dyld_chained_fixups_command) { nResult = sizeof(XMACH_DEF::linkedit_data_command); @@ -676,18 +678,6 @@ void XFormatWidget::setValue(QVariant vValue, qint32 nPosition, qint64 nOffset, _adjustRecWidget(&recWidget, vValue); - SV sv = _setValue(vValue, nPosition); - // if (sv == SV_EDITED) { - // reset(); - // } else if (sv == SV_RELOADDATA) { - // reset(); - // reloadData(true); - // } else if (sv == SV_RELOADALL) { - // reset(); - // reload(); - // reloadData(false); - // } - emit dataChanged(nOffset, nSize); } } else { @@ -1107,8 +1097,13 @@ void XFormatWidget::updateRecWidgets(QIODevice *pDevice, QList *pList if (pListRecWidget->at(i).pWidget) { bool bIsSize = false; - if ((pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_SIZE) && (pListRecWidget->at(i).nSubPosition != -1)) { - bIsSize = true; + if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_SIZE) { + if (pListRecWidget->at(i).nSubPosition != -1) { + bIsSize = true; + } + else if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOSTRUCT) { + bIsSize = true; + } } QList listWidgets = pListRecWidget->at(i).pWidget->findChildren(); @@ -1118,7 +1113,12 @@ void XFormatWidget::updateRecWidgets(QIODevice *pDevice, QList *pList for (qint32 j = 0; j < nNumberOfWidgets; j++) { qint64 nDelta = listWidgets.at(j)->property("DELTA").toLongLong(); if (bIsSize) { - listWidgets.at(j)->setProperty("LOCATION", listVariants.at(pListRecWidget->at(i).nSubPosition).toULongLong() + nDelta); + if (pListRecWidget->at(i).nSubPosition != -1) { + listWidgets.at(j)->setProperty("LOCATION", listVariants.at(pListRecWidget->at(i).nSubPosition).toULongLong() + nDelta); + } else { + listWidgets.at(j)->setProperty("LOCATION", nDelta); + } + listWidgets.at(j)->setProperty("SIZE", listVariants.at(i)); } else { listWidgets.at(j)->setProperty("LOCATION", listVariants.at(i).toULongLong() + nDelta); @@ -1141,13 +1141,17 @@ void XFormatWidget::_adjustRecWidget(RECWIDGET *pRecWidget, QVariant varValue) if (pRecWidget->pLineEdit) bBlockLineEdit = pRecWidget->pLineEdit->blockSignals(true); - QList listWidgets = pRecWidget->pWidget->findChildren(); + qint32 nNumberOfWidgets = 0; + QList listWidgets; - qint32 nNumberOfWidgets = listWidgets.count(); + if (pRecWidget->pWidget) { + listWidgets = pRecWidget->pWidget->findChildren(); + nNumberOfWidgets = listWidgets.count(); - for (qint32 i = 0; i < nNumberOfWidgets; i++) { - bool bState = listWidgets.at(i)->blockSignals(true); - listBlockComboBoxes.append(bState); + for (qint32 i = 0; i < nNumberOfWidgets; i++) { + bool bState = listWidgets.at(i)->blockSignals(true); + listBlockComboBoxes.append(bState); + } } if (pRecWidget->pLineEdit) { @@ -1713,6 +1717,20 @@ void XFormatWidget::_addStruct(const SPSTRUCT &spStruct) _spStructRecord.widgetMode = XFW_DEF::WIDGETMODE_TABLE; _spStructRecord.type = XFW_DEF::TYPE_GENERIC_STRINGTABLE_ANSI; + _addStruct(_spStructRecord); + } + } else if ((_spStruct.widgetMode == XFW_DEF::WIDGETMODE_HEADER) && (_spStruct.type == XFW_DEF::TYPE_MACH_dyld_exports_trie_command)) { + XMACH_DEF::linkedit_data_command _command = mach._read_linkedit_data_command(_spStruct.nStructOffset); + + if (_command.dataoff && _command.datasize) { + SPSTRUCT _spStructRecord = _spStruct; + _spStructRecord.pTreeWidgetItem = pTreeWidgetItem; + _spStructRecord.nStructOffset = _spStruct.nOffset + _command.dataoff; + _spStructRecord.nStructSize = _command.datasize; + _spStructRecord.nStructCount = 0; + _spStructRecord.widgetMode = XFW_DEF::WIDGETMODE_HEX; + _spStructRecord.type = XFW_DEF::TYPE_MACH_trie_export; + _addStruct(_spStructRecord); } } else if ((_spStruct.widgetMode == XFW_DEF::WIDGETMODE_HEADER) && (_spStruct.type == XFW_DEF::TYPE_segment_command)) { @@ -1848,7 +1866,7 @@ XFW_DEF::TYPE XFormatWidget::load_commandIdToType(qint32 nCommandId) } else if (nCommandId == XMACH_DEF::S_LC_FUNCTION_STARTS) { result = XFW_DEF::TYPE_function_starts_command; } else if (nCommandId == XMACH_DEF::S_LC_DYLD_EXPORTS_TRIE) { - result = XFW_DEF::TYPE_dyld_exports_trie_command; + result = XFW_DEF::TYPE_MACH_dyld_exports_trie_command; } else if (nCommandId == XMACH_DEF::S_LC_DYLD_CHAINED_FIXUPS) { result = XFW_DEF::TYPE_dyld_chained_fixups_command; } else if (nCommandId == XMACH_DEF::S_LC_ENCRYPTION_INFO) { @@ -2206,8 +2224,25 @@ bool XFormatWidget::createHeaderTable(QTableWidget *pTableWidget, const QListat(i).nVType & XFW_DEF::VAL_TYPE_OFFSET) || (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_ADDRESS) || - ((pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_SIZE) && (pListRecWidget->at(i).nSubPosition != -1))) { + if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOPARENT) { + (*pListRecWidget)[i].varDelta = var1.toULongLong(); + } else if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOSTRUCT) { + (*pListRecWidget)[i].varDelta = nOffset; + } + + bool bValid = false; + + if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_OFFSET) { + bValid = true; + } else if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_ADDRESS) { + bValid = true; + } else if ((pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_SIZE) && (pListRecWidget->at(i).nSubPosition != -1)) { + bValid = true; + } else if ((pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_SIZE) && (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOSTRUCT)) { + bValid = true; + } + + if (bValid) { _adjustCellWidget(pListRecWidget, pTableWidget, i, HEADER_COLUMN_INFO); XBinary::LT locType = XBinary::LT_UNKNOWN; @@ -2224,15 +2259,11 @@ bool XFormatWidget::createHeaderTable(QTableWidget *pTableWidget, const QListat(nSubPosition).nVType & XFW_DEF::VAL_TYPE_ADDRESS) { locType = XBinary::LT_ADDRESS; } + } else if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOSTRUCT) { + locType = XBinary::LT_OFFSET; } } - if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOPARENT) { - (*pListRecWidget)[i].varDelta = var1.toULongLong(); - } else if (pListRecWidget->at(i).nVType & XFW_DEF::VAL_TYPE_RELTOSTRUCT) { - (*pListRecWidget)[i].varDelta = nOffset; - } - if (locType != XBinary::LT_UNKNOWN) { QToolButton *pButton = new QToolButton(0); pButton->setProperty("LOCATIONTYPE", locType); diff --git a/AbstractWidgets/xformatwidget.h b/AbstractWidgets/xformatwidget.h index b34ffe95..b534c2b9 100644 --- a/AbstractWidgets/xformatwidget.h +++ b/AbstractWidgets/xformatwidget.h @@ -246,7 +246,6 @@ class XFormatWidget : public XShortcutsWidget { SV_RELOADDATA }; - virtual SV _setValue(QVariant vValue, qint32 nPosition) = 0; void adjustGenericHeader(QTableWidget *pTableWidget, const QList *pListHeaderRecords); void adjustGenericTable(QTableView *pTableView, const QList *pListHeaderRecords); virtual void adjustListTable(qint32 nType, QTableWidget *pTableWidget); diff --git a/AbstractWidgets/xformatwidget_def.h b/AbstractWidgets/xformatwidget_def.h index 613ebfe2..07350962 100644 --- a/AbstractWidgets/xformatwidget_def.h +++ b/AbstractWidgets/xformatwidget_def.h @@ -76,7 +76,7 @@ enum TYPE { TYPE_segment_split_info_command, TYPE_atom_info_command, TYPE_function_starts_command, - TYPE_dyld_exports_trie_command, + TYPE_MACH_dyld_exports_trie_command, TYPE_dyld_chained_fixups_command, TYPE_encryption_info_command, TYPE_encryption_info_command_64, @@ -100,6 +100,7 @@ enum TYPE { TYPE_MACH_CS_CodeDirectory, TYPE_MACH_section, TYPE_MACH_section_64, + TYPE_MACH_trie_export, TYPE_MACH_END, TYPE_NE_START, TYPE_NE_IMAGE_DOS_HEADER, @@ -122,7 +123,8 @@ enum WIDGETMODE { WIDGETMODE_UNKNOWN = 0, WIDGETMODE_HEADER, WIDGETMODE_TABLE, - WIDGETMODE_DIALOG_HEADER + WIDGETMODE_DIALOG_HEADER, + WIDGETMODE_HEX }; struct OPTIONS { diff --git a/AbstractWidgets/xgenericheaderwidget.cpp b/AbstractWidgets/xgenericheaderwidget.cpp index 98ba2c67..fe17e0e0 100644 --- a/AbstractWidgets/xgenericheaderwidget.cpp +++ b/AbstractWidgets/xgenericheaderwidget.cpp @@ -41,14 +41,6 @@ XGenericHeaderWidget::~XGenericHeaderWidget() delete ui; } -XFormatWidget::SV XGenericHeaderWidget::_setValue(QVariant vValue, qint32 nPosition) -{ - Q_UNUSED(vValue) - Q_UNUSED(nPosition) - - return SV_NONE; -} - void XGenericHeaderWidget::reloadData(bool bSaveSelection) { qint32 nCurrentRow = 0; @@ -104,7 +96,7 @@ void XGenericHeaderWidget::reloadData(bool bSaveSelection) (getCwOptions()->_type == XFW_DEF::TYPE_sub_client_command) || (getCwOptions()->_type == XFW_DEF::TYPE_sub_library_command) || (getCwOptions()->_type == XFW_DEF::TYPE_symtab_command) || (getCwOptions()->_type == XFW_DEF::TYPE_dysymtab_command) || (getCwOptions()->_type == XFW_DEF::TYPE_segment_split_info_command) || (getCwOptions()->_type == XFW_DEF::TYPE_atom_info_command) || - (getCwOptions()->_type == XFW_DEF::TYPE_function_starts_command) || (getCwOptions()->_type == XFW_DEF::TYPE_dyld_exports_trie_command) || + (getCwOptions()->_type == XFW_DEF::TYPE_function_starts_command) || (getCwOptions()->_type == XFW_DEF::TYPE_MACH_dyld_exports_trie_command) || (getCwOptions()->_type == XFW_DEF::TYPE_dyld_chained_fixups_command) || (getCwOptions()->_type == XFW_DEF::TYPE_encryption_info_command) || (getCwOptions()->_type == XFW_DEF::TYPE_encryption_info_command_64) || (getCwOptions()->_type == XFW_DEF::TYPE_dyld_info_command) || (getCwOptions()->_type == XFW_DEF::TYPE_version_min_command) || (getCwOptions()->_type == XFW_DEF::TYPE_uuid_command) || diff --git a/AbstractWidgets/xgenericheaderwidget.h b/AbstractWidgets/xgenericheaderwidget.h index 9ffae765..00c6741d 100644 --- a/AbstractWidgets/xgenericheaderwidget.h +++ b/AbstractWidgets/xgenericheaderwidget.h @@ -36,9 +36,6 @@ class XGenericHeaderWidget : public XFormatWidget { virtual void reloadData(bool bSaveSelection); virtual void adjustView(); -protected: - virtual SV _setValue(QVariant vValue, qint32 nPosition); - private slots: void on_tableWidgetMain_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn); void on_tableWidgetMain_customContextMenuRequested(const QPoint &pos); diff --git a/AbstractWidgets/xgenerictablewidget.cpp b/AbstractWidgets/xgenerictablewidget.cpp index 00d18214..60a08750 100644 --- a/AbstractWidgets/xgenerictablewidget.cpp +++ b/AbstractWidgets/xgenerictablewidget.cpp @@ -40,14 +40,6 @@ XGenericTableWidget::~XGenericTableWidget() delete ui; } -XFormatWidget::SV XGenericTableWidget::_setValue(QVariant vValue, qint32 nPosition) -{ - Q_UNUSED(vValue) - Q_UNUSED(nPosition) - - return SV_NONE; -} - void XGenericTableWidget::reloadData(bool bSaveSelection) { qint32 nRow = 0; diff --git a/AbstractWidgets/xgenerictablewidget.h b/AbstractWidgets/xgenerictablewidget.h index d55d6a0a..12258af5 100644 --- a/AbstractWidgets/xgenerictablewidget.h +++ b/AbstractWidgets/xgenerictablewidget.h @@ -36,9 +36,6 @@ class XGenericTableWidget : public XFormatWidget { virtual void reloadData(bool bSaveSelection); virtual void adjustView(); -protected: - virtual SV _setValue(QVariant vValue, qint32 nPosition); - private slots: void on_tableViewMain_customContextMenuRequested(const QPoint &pos); void onTableView_currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); diff --git a/AbstractWidgets/xmainwidget.cpp b/AbstractWidgets/xmainwidget.cpp index c0a61f2d..a05c79c0 100644 --- a/AbstractWidgets/xmainwidget.cpp +++ b/AbstractWidgets/xmainwidget.cpp @@ -164,14 +164,6 @@ void XMainWidget::reload() // setTreeItem(ui->treeWidgetNavi, getOptions().nStartType); } -XFormatWidget::SV XMainWidget::_setValue(QVariant vValue, qint32 nPosition) -{ - Q_UNUSED(vValue) - Q_UNUSED(nPosition) - - return SV_NONE; -} - void XMainWidget::setReadonly(bool bState) { XFormatWidget::setReadonly(bState); @@ -258,7 +250,7 @@ void XMainWidget::reloadData(bool bSaveSelection) connect(pWidget, SIGNAL(dataChanged(qint64, qint64)), this, SLOT(dataChangedSlot(qint64, qint64))); connect(pWidget, SIGNAL(followLocation(quint64, qint32, qint64, qint32)), this, SLOT(followLocationSlot(quint64, qint32, qint64, qint32))); - if ((cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEADER) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_TABLE)) { + if ((cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEADER) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_TABLE) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEX)) { XFormatWidget *_pXFormatWidget = dynamic_cast(pWidget); if (_pXFormatWidget) { @@ -318,6 +310,10 @@ XShortcutsWidget *XMainWidget::createWidget(const XFW_DEF::CWOPTIONS &cwOptions) XGenericTableWidget *_pWidget = new XGenericTableWidget(cwOptions.pParent); _pWidget->setCwOptions(cwOptions, false); pResult = _pWidget; + } else if (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEX) { + XGenericHexWidget *_pWidget = new XGenericHexWidget(cwOptions.pParent); + _pWidget->setCwOptions(cwOptions, false); + pResult = _pWidget; } return pResult; @@ -473,7 +469,7 @@ void XMainWidget::showCwWidgetSlot(QString sInitString, bool bNewWindow) connect(pWidget, SIGNAL(dataChanged(qint64, qint64)), this, SLOT(dataChangedSlot(qint64, qint64))); connect(pWidget, SIGNAL(followLocation(quint64, qint32, qint64, qint32)), this, SLOT(followLocationSlot(quint64, qint32, qint64, qint32))); - if ((cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEADER) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_TABLE)) { + if ((cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEADER) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_TABLE) || (cwOptions.widgetMode == XFW_DEF::WIDGETMODE_HEX)) { connect(pWidget, SIGNAL(showCwWidget(QString, bool)), this, SLOT(showCwWidgetSlot(QString, bool))); } diff --git a/AbstractWidgets/xmainwidget.h b/AbstractWidgets/xmainwidget.h index 80ef48e4..cbcd7235 100644 --- a/AbstractWidgets/xmainwidget.h +++ b/AbstractWidgets/xmainwidget.h @@ -25,6 +25,7 @@ #include "xgenericheaderwidget.h" #include "xgenerictablewidget.h" +#include "xgenerichexwidget.h" #include "xformatwidget.h" #include "dialogdemangle.h" #include "dialogwidget.h" @@ -51,7 +52,6 @@ class XMainWidget : public XFormatWidget { virtual void cleanup(); virtual void reload(); - virtual SV _setValue(QVariant vValue, qint32 nPosition); virtual void setReadonly(bool bState); virtual void adjustView(); virtual void reloadData(bool bSaveSelection);