151 RZ_LOG_ERROR(
"Corrupted CoreSymbolication header: size out of bounds (0x%x)\n", hdr->
size);
175 const size_t word_size =
bits / 8;
184 ut64 page_zero_size = 0;
185 size_t page_zero_idx = 0;
223 if (!strcmp(seg->
name,
"__PAGEZERO")) {
224 page_zero_size = seg->
size;
230 for (
i = 0;
i < hdr->
n_segments && page_zero_size > 0;
i++) {
231 if (
i == page_zero_idx) {
235 if (seg->
vaddr < page_zero_size) {
236 seg->
vaddr += page_zero_size;
240 bool relative_to_strings =
false;
248 ut8 *cursor =
b + start_of_sections;
249 ut8 *upper_boundary =
end - word_size;
250 for (
i = 0;
i < hdr->
n_sections && cursor < upper_boundary;
i++) {
251 ut8 *sect_start = cursor;
254 if (sect->
vaddr < page_zero_size) {
255 sect->
vaddr += page_zero_size;
258 if (cursor >= upper_boundary) {
263 if (cursor >= upper_boundary) {
267 if (!
i && !sect_name_off) {
268 relative_to_strings =
true;
274 string_origin = relative_to_strings ?
b + start_of_strings : sect_start;
284 ut8 *cursor =
b + start_of_symbols;
293 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
299 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
307 if (i < hdr->n_symbols) {
317 ut8 *cursor =
b + start_of_lined_symbols;
329 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
334 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
339 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
346 if (i < hdr->n_lined_symbols) {
356 ut8 *cursor =
b + start_of_line_info;
364 string_origin = relative_to_strings ?
b + start_of_strings : cursor;
371 if (i < hdr->n_line_info) {
RzBinInfo * info(RzBinFile *bf)
int bits(struct state *s, int need)
#define RZ_CS_EL_SIZE_SYM
#define RZ_CS_EL_SIZE_SECT_64
#define RZ_CS_EL_SIZE_SEG
#define RZ_CS_EL_SIZE_LSYM
RZ_API void rz_coresym_cache_element_free(RzCoreSymCacheElement *element)
#define RZ_CS_EL_SIZE_SECT_32
static char * str_dup_safe_fixed(const ut8 *b, const ut8 *str, ut64 len, const ut8 *end)
static RzCoreSymCacheElementHdr * rz_coresym_cache_element_header_new(RzBuffer *buf, size_t off, int bits)
#define RZ_CS_EL_SIZE_LINFO
static char * str_dup_safe(const ut8 *b, const ut8 *str, const ut8 *end)
#define RZ_CS_EL_OFF_SEGS
void * malloc(size_t size)
static const char file_name
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
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_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
static ut32 rz_read_le32(const void *src)
static ut64 rz_read_le64(const void *src)
static ut64 rz_read_ble(const void *src, bool big_endian, int size)
#define RZ_LOG_ERROR(fmtstr,...)
RzCoreSymCacheElementSymbol sym
RzCoreSymCacheElementFLC flc
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()