p_mach.h: use proper upx types.

This commit is contained in:
Markus F.X.J. Oberhumer 2016-09-20 10:05:08 +02:00
parent c678ccdfb1
commit 09d9f71ae9

View File

@ -48,9 +48,9 @@ __packed_struct(Mach_fat_arch)
__packed_struct_end()
typedef struct {
uint32_t cmd;
uint32_t cmdsize;
uint32_t data[2]; // because cmdsize >= 16
upx_uint32_t cmd;
upx_uint32_t cmdsize;
upx_uint32_t data[2]; // because cmdsize >= 16
} Mach_command; // generic prefix
/*************************************************************************
@ -294,71 +294,71 @@ __packed_struct(Mach_uuid_command)
__packed_struct_end()
typedef struct {
uint32_t cmd; // LC_MAIN; MH_EXECUTE only
uint32_t cmdsize; // 24
uint64_t entryoff; // file offset of main() [expected in __TEXT]
uint64_t stacksize; // non-default initial stack size
upx_uint32_t cmd; // LC_MAIN; MH_EXECUTE only
upx_uint32_t cmdsize; // 24
upx_uint64_t entryoff; // file offset of main() [expected in __TEXT]
upx_uint64_t stacksize; // non-default initial stack size
} Mach_main_command;
typedef struct {
uint32_t cmd; // LC_SOURCE_VERSION
uint32_t cmdsize; // 16
uint32_t long version;
upx_uint32_t cmd; // LC_SOURCE_VERSION
upx_uint32_t cmdsize; // 16
upx_uint32_t version;
} Mach_source_version_command;
typedef struct {
uint32_t cmd; // LC_VERSION_MIN_MACOSX
uint32_t cmdsize; // 16
uint32_t version; // X.Y.Z ==> xxxx.yy.zz
uint32_t sdk; // X.Y.Z ==> xxxx.yy.zz
upx_uint32_t cmd; // LC_VERSION_MIN_MACOSX
upx_uint32_t cmdsize; // 16
upx_uint32_t version; // X.Y.Z ==> xxxx.yy.zz
upx_uint32_t sdk; // X.Y.Z ==> xxxx.yy.zz
} Mach_version_min_command;
typedef struct {
uint32_t cmd; // LC_DYLD_INFO_ONLY
uint32_t cmdsize; // 48
uint32_t rebase_off;
uint32_t rebase_size;
uint32_t bind_off;
uint32_t bind_size;
uint32_t weak_bind_off;
uint32_t weak_bind_size;
uint32_t lazy_bind_off;
uint32_t lazy_bind_size;
uint32_t export_off;
uint32_t export_size;
upx_uint32_t cmd; // LC_DYLD_INFO_ONLY
upx_uint32_t cmdsize; // 48
upx_uint32_t rebase_off;
upx_uint32_t rebase_size;
upx_uint32_t bind_off;
upx_uint32_t bind_size;
upx_uint32_t weak_bind_off;
upx_uint32_t weak_bind_size;
upx_uint32_t lazy_bind_off;
upx_uint32_t lazy_bind_size;
upx_uint32_t export_off;
upx_uint32_t export_size;
} Mach_dyld_info_only_command;
typedef struct {
uint32_t cmd;
uint32_t cmdsize;
uint32_t name;
upx_uint32_t cmd;
upx_uint32_t cmdsize;
upx_uint32_t name;
} Mach_load_dylinker_command;
typedef struct {
uint32_t name; /* library's path name */
uint32_t timestamp; /* library's build time stamp */
uint32_t current_version; /* library's current version number */
uint32_t compatibility_version; /* library's compatibility vers number*/
upx_uint32_t name; /* library's path name */
upx_uint32_t timestamp; /* library's build time stamp */
upx_uint32_t current_version; /* library's current version number */
upx_uint32_t compatibility_version; /* library's compatibility vers number*/
} Mach_dylib;
typedef struct {
uint32_t cmd;
uint32_t cmdsize;
upx_uint32_t cmd;
upx_uint32_t cmdsize;
Mach_dylib dylib;
} Mach_load_dylib_command;
typedef struct {
uint32_t cmd;
uint32_t cmdsize;
uint32_t dataoff;
uint32_t datasize;
upx_uint32_t cmd;
upx_uint32_t cmdsize;
upx_uint32_t dataoff;
upx_uint32_t datasize;
} Mach_function_starts_command;
typedef struct {
uint32_t cmd;
uint32_t cmdsize;
uint32_t dataoff;
uint32_t datasize;
upx_uint32_t cmd;
upx_uint32_t cmdsize;
upx_uint32_t dataoff;
upx_uint32_t datasize;
} Mach_data_in_code_command;
template <class TMachITypes>