21 #define IS_PTR_AUTH(x) ((x & (1ULL << 63)) != 0)
22 #define IS_PTR_BIND(x) ((x & (1ULL << 62)) != 0)
27 int nsegs_to_rebase =
RZ_MIN(obj->nchained_starts, obj->nsegs);
28 for (
int i = 0;
i < nsegs_to_rebase;
i++) {
29 if (!obj->chained_starts[
i]) {
32 ut64 page_size = obj->chained_starts[
i]->page_size;
35 if (end < off || start > eob) {
40 for (; page_idx <= page_end_idx; page_idx++) {
41 if (page_idx >= obj->chained_starts[
i]->page_count) {
44 ut16 page_start = obj->chained_starts[
i]->page_start[page_idx];
48 ut64 cursor =
start + page_idx * page_size + page_start;
49 while (cursor < eob && cursor <
end) {
56 ut64 ptr_value = raw_ptr;
59 switch (obj->chained_starts[
i]->pointer_format) {
62 if (is_auth && is_bind) {
66 }
else if (!is_auth && is_bind) {
70 }
else if (is_auth && !is_bind) {
74 ptr_value =
p->target + obj->baddr;
79 ptr_value = ((
ut64)
p->high8 << 56) |
p->target;
90 ptr_value =
p->target + obj->baddr;
95 ptr_value = ((
ut64)
p->high8 << 56) |
p->target;
96 ptr_value += obj->baddr;
110 ptr_value = obj->baddr + (((
ut64)
p->high8 << 56) |
p->target);
125 ptr_value =
p->target + obj->baddr;
130 ptr_value = obj->baddr + (((
ut64)
p->high8 << 56) |
p->target);
137 obj->chained_starts[
i]->pointer_format, cursor);
141 if (cursor >=
off && cursor <= eob - 8) {
144 cursor +=
delta * stride;
157 struct MACH0_(obj_t) * obj;
166 ctx->obj = (
void *)user;
185 if (
r <= 0 || !
len) {
229 return !!obj->chained_starts;
233 if (seg_index >= obj->nsegs || seg_index >= obj->nchained_starts) {
236 return obj->chained_starts && obj->chained_starts[seg_index];
static io_buf in_buf
Input and output buffers.
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 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 static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
RZ_API void Ht_() free(HtName_(Ht) *ht)
@ DYLD_CHAINED_PTR_START_NONE
@ DYLD_CHAINED_PTR_64_OFFSET
@ DYLD_CHAINED_PTR_ARM64E_USERLAND24
@ DYLD_CHAINED_PTR_ARM64E
@ DYLD_CHAINED_PTR_64_KERNEL_CACHE
@ DYLD_CHAINED_PTR_ARM64E_KERNEL
static ut8 * buf_get_whole_buf(RzBuffer *b, ut64 *sz)
RZ_API void MACH0_() rebase_buffer(struct MACH0_(obj_t) *obj, ut64 off, ut8 *buf, ut64 count)
static ut64 buf_get_size(RzBuffer *b)
static st64 buf_seek(RzBuffer *b, st64 addr, int whence)
static st64 buf_write(RzBuffer *b, const ut8 *buf, ut64 len)
static st64 buf_read(RzBuffer *b, ut8 *buf, ut64 len)
static bool buf_fini(RzBuffer *b)
static const RzBufferMethods buf_methods
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)
RZ_API bool MACH0_() segment_needs_rebasing_and_stripping(struct MACH0_(obj_t) *obj, size_t seg_index)
static bool buf_resize(RzBuffer *b, ut64 newsize)
static bool buf_init(RzBuffer *b, const void *user)
#define rz_return_if_fail(expr)
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_methods(RZ_NONNULL const RzBufferMethods *methods, void *init_user)
Creates a new buffer with a specific back end.
RZ_API bool rz_buf_resize(RZ_NONNULL RzBuffer *b, ut64 newsize)
Resize the buffer size.
static ut64 rz_seek_offset(ut64 cur, ut64 length, st64 addr, int whence)
change cur according to addr and whence (RZ_BUF_SET/RZ_BUF_CUR/RZ_BUF_END)
RZ_API st64 rz_buf_write_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL const ut8 *buf, ut64 len)
Write len bytes of the buffer at the specified address.
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
RZ_DEPRECATE RZ_API RZ_BORROW ut8 * rz_buf_data(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut64 *size)
Return a borrowed array of bytes representing the buffer data.
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
static ut64 rz_read_le64(const void *src)
static void rz_write_le64(void *dest, ut64 val)
#define RZ_LOG_WARN(fmtstr,...)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()