9 #ifndef _INCLUDE_RZ_BIN_MACH0_H_
10 #define _INCLUDE_RZ_BIN_MACH0_H_
13 #define FEATURE_SYMLIST 0
15 #define RZ_BIN_MACH0_STRING_LENGTH 256
17 #define CSMAGIC_CODEDIRECTORY 0xfade0c02
18 #define CSMAGIC_EMBEDDED_SIGNATURE 0xfade0cc0
19 #define CSMAGIC_DETACHED_SIGNATURE 0xfade0cc1
20 #define CSMAGIC_ENTITLEMENTS 0xfade7171
21 #define CSMAGIC_REQUIREMENT 0xfade0c00
22 #define CSMAGIC_REQUIREMENTS 0xfade0c01
24 #define CS_PAGE_SIZE 4096
26 #define CS_HASHTYPE_SHA1 1
27 #define CS_HASHTYPE_SHA256 2
28 #define CS_HASHTYPE_SHA256_TRUNCATED 3
30 #define CS_HASH_SIZE_SHA1 20
31 #define CS_HASH_SIZE_SHA256 32
32 #define CS_HASH_SIZE_SHA256_TRUNCATED 20
34 #define CSSLOT_CODEDIRECTORY 0
35 #define CSSLOT_INFOSLOT 1
36 #define CSSLOT_REQUIREMENTS 2
37 #define CSSLOT_RESOURCEDIR 3
38 #define CSSLOT_APPLICATION 4
39 #define CSSLOT_ENTITLEMENTS 5
40 #define CSSLOT_CMS_SIGNATURE 0x10000
113 struct MACH0_(opts_t) {
120 struct MACH0_(obj_t) {
122 struct MACH0_(mach_header) hdr;
123 struct MACH0_(segment_command) * segs;
128 ut32 nchained_starts;
129 struct MACH0_(section) * sects;
131 struct MACH0_(nlist) * symtab;
140 size_t imports_by_ord_size;
141 HtPP *imports_by_name;
148 struct MACH0_(dylib_module) * modtab;
187 bool reloc_targets_map_base_calculated;
195 #define MACH0_VFILE_NAME_REBASED_STRIPPED "rebased_stripped"
196 #define MACH0_VFILE_NAME_RELOC_TARGETS "reloc-targets"
197 #define MACH0_VFILE_NAME_PATCHED "patched"
static ut64 baddr(RzBinFile *bf)
static RzList * libs(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
RzList * relocs(RzBinFile *bf)
static char * signature(RzBinFile *bf, bool json)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static ut64 va2pa(uint64_t addr, ut32 n_maps, cache_map_t *maps, RzBuffer *cache_buf, ut64 slide, ut32 *offset, ut32 *left)
static const char struct stat static buf struct stat static buf static vhangup int options
RZ_API ut64 MACH0_() reloc_targets_map_base(RzBinFile *bf, struct MACH0_(obj_t) *obj)
base vaddr where to map the artificial reloc target vfile
RzList *MACH0_() mach_fields(RzBinFile *bf)
RzList *MACH0_() get_maps_unpatched(RzBinFile *bf)
RZ_BORROW RzSkipList *MACH0_() get_relocs(struct MACH0_(obj_t) *bin)
const char *MACH0_() get_intrp(struct MACH0_(obj_t) *bin)
RzList *MACH0_() get_maps(RzBinFile *bf)
RZ_API void MACH0_() rebase_buffer(struct MACH0_(obj_t) *obj, ut64 off, ut8 *buf, ut64 count)
RzList *MACH0_() get_segments(RzBinFile *bf)
char *MACH0_() section_type_to_string(ut64 type)
const RzList *MACH0_() get_symbols_list(struct MACH0_(obj_t) *bin)
char *MACH0_() get_class(struct MACH0_(obj_t) *bin)
RZ_API RZ_OWN char *MACH0_() get_name(struct MACH0_(obj_t) *mo, ut32 stridx, bool filter)
Get a string from the string table referenced by the LC_SYMTAB command.
RZ_API bool MACH0_() needs_reloc_patching(struct MACH0_(obj_t) *obj)
RzList *MACH0_() section_flag_to_rzlist(ut64 flag)
RZ_API ut64 MACH0_() reloc_targets_vfile_size(struct MACH0_(obj_t) *obj)
size of the artificial reloc target vfile
#define RZ_BIN_MACH0_STRING_LENGTH
void MACH0_() mach_headerfields(RzBinFile *bf)
char *MACH0_() get_filetype(struct MACH0_(obj_t) *bin)
char *MACH0_() get_filetype_from_hdr(struct MACH0_(mach_header) *hdr)
RZ_API ut64 MACH0_() paddr_to_vaddr(struct MACH0_(obj_t) *bin, ut64 offset)
struct section_t *MACH0_() get_sections(struct MACH0_(obj_t) *bin)
struct lib_t *MACH0_() get_libs(struct MACH0_(obj_t) *bin)
int MACH0_() get_bits_from_hdr(struct MACH0_(mach_header) *hdr)
char *MACH0_() get_cpusubtype(struct MACH0_(obj_t) *bin)
const struct symbol_t *MACH0_() get_symbols(struct MACH0_(obj_t) *bin)
ut64 MACH0_() get_main(struct MACH0_(obj_t) *bin)
void *MACH0_() mach0_free(struct MACH0_(obj_t) *bin)
RZ_API RzBuffer *MACH0_() new_rebasing_and_stripping_buf(struct MACH0_(obj_t) *obj)
RZ_API bool MACH0_() needs_rebasing_and_stripping(struct MACH0_(obj_t) *obj)
bool MACH0_() is_big_endian(struct MACH0_(obj_t) *bin)
ut64 MACH0_() get_baddr(struct MACH0_(obj_t) *bin)
bool MACH0_() has_nx(struct MACH0_(obj_t) *bin)
bool MACH0_() is_pie(struct MACH0_(obj_t) *bin)
RzList *MACH0_() get_virtual_files(RzBinFile *bf)
const char *MACH0_() get_cputype(struct MACH0_(obj_t) *bin)
RZ_API ut64 MACH0_() vaddr_to_paddr(struct MACH0_(obj_t) *bin, ut64 addr)
struct import_t *MACH0_() get_imports(struct MACH0_(obj_t) *bin)
int MACH0_() get_bits(struct MACH0_(obj_t) *bin)
const char *MACH0_() get_cputype_from_hdr(struct MACH0_(mach_header) *hdr)
RZ_API bool MACH0_() segment_needs_rebasing_and_stripping(struct MACH0_(obj_t) *obj, size_t seg_index)
RZ_API void MACH0_() patch_relocs(RzBinFile *bf, struct MACH0_(obj_t) *obj)
Patching of external relocs in a sparse overlay buffer.
void MACH0_() pull_symbols(struct MACH0_(obj_t) *mo, RzBinSymbolCallback cb, void *user)
char *MACH0_() get_cpusubtype_from_hdr(struct MACH0_(mach_header) *hdr)
const char *MACH0_() get_os(struct MACH0_(obj_t) *bin)
void MACH0_() opts_set_default(struct MACH0_(opts_t) *options, RzBinFile *bf)
struct addr_t *MACH0_() get_entrypoint(struct MACH0_(obj_t) *bin)
static bool filter(RzParse *p, ut64 addr, RzFlag *f, RzAnalysisHint *hint, char *data, char *str, int len, bool big_endian)
XX curplugin == o->plugin.
struct blob_index_t index[]
static registers_t x86_32[]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()