9 #define ROUND_UP_4(x) ((x) + (4 - 1)) / 4 * 4
18 [
X86] = { 160, 0x48, 32, 0x3c },
19 [
X86_64] = { 216, 0x70, 64, 0x98 },
20 [
ARM] = { 72, 0x48, 32, 0x34 },
21 [
AARCH64] = { 272, 0x70, 64, 0xf8 }
27 RZ_LOG_WARN(
"Fetching registers from core file not supported for this architecture.\n");
38 note->prstatus.regstate_size = layout->
regsize;
40 if (!note->prstatus.regstate) {
45 RZ_LOG_WARN(
"Failed to read register state from CORE file\n");
84 Elf_(Addr) strings_offset;
90 for (
Elf_(Addr)
i = 0;
i < n_maps;
i++) {
91 if (strings_offset >= note_segment_header->n_descsz) {
112 strings_offset += strlen(
name) + 1;
119 switch (note_segment_header->n_type) {
157 Elf_(Nhdr) note_segment_header;
204 switch (
bin->ehdr.e_machine) {
228 if (!segment->is_valid || segment->data.p_type !=
PT_NOTE) {
#define rz_bin_elf_foreach_segments(bin, segment)
bool Elf_() rz_bin_elf_read_addr(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Addr) *result)
bool Elf_() rz_bin_elf_read_off(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Off) *result)
bool Elf_() rz_bin_elf_read_word(RZ_NONNULL ELFOBJ *bin, RZ_NONNULL RZ_INOUT ut64 *offset, RZ_NONNULL RZ_OUT Elf_(Word) *result)
bool Elf_() rz_bin_elf_mul_addr(Elf_(Addr) *result, Elf_(Addr) addr, Elf_(Addr) value)
static bool parse_note_prstatus(ELFOBJ *bin, RzVector *notes, Elf_(Nhdr) *note_segment_header, ut64 offset)
static bool read_note_segment_header(ELFOBJ *bin, ut64 *offset, Elf_(Nhdr) *note_segment_header)
static void note_free(void *e, RZ_UNUSED void *user)
static void note_prstatus_free(RzBinElfNotePrStatus *ptr)
static bool set_note_segment(ELFOBJ *bin, RzVector *notes, RzBinElfSegment *segment)
static bool set_note_file(ELFOBJ *bin, RzBinElfNoteFile *file, ut64 *offset, char *name)
bool Elf_() rz_bin_elf_has_notes(RZ_NONNULL ELFOBJ *bin)
static RzBinElfPrStatusLayout prstatus_layouts[ARCH_LEN]
static bool parse_note_file(ELFOBJ *bin, RzVector *notes, Elf_(Nhdr) *note_segment_header, ut64 offset)
static bool get_note_file(ELFOBJ *bin, RzBinElfNoteFile *file, ut64 *offset)
static void note_segment_free(void *e, RZ_UNUSED void *user)
RZ_OWN RzVector *Elf_() rz_bin_elf_notes_new(RZ_NONNULL ELFOBJ *bin)
static void note_file_free(RzBinElfNoteFile *ptr)
RZ_BORROW RzBinElfPrStatusLayout *Elf_() rz_bin_elf_get_prstatus_layout(RZ_NONNULL ELFOBJ *bin)
static bool get_note_file_aux(ELFOBJ *bin, RzBinElfNoteFile *file, ut64 *offset)
static bool set_note(ELFOBJ *bin, RzVector *notes, Elf_(Nhdr) *note_segment_header, ut64 offset)
RZ_API void Ht_() free(HtName_(Ht) *ht)
#define rz_return_val_if_fail(expr, val)
RZ_API RZ_OWN char * rz_buf_get_nstring(RZ_NONNULL RzBuffer *b, ut64 addr, size_t size)
Get a string with a max length from the buffer.
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.
#define RZ_LOG_WARN(fmtstr,...)
RZ_API void * rz_vector_push(RzVector *vec, void *x)
RZ_API void rz_vector_fini(RzVector *vec)
RZ_API void rz_vector_free(RzVector *vec)
RZ_API RzVector * rz_vector_new(size_t elem_size, RzVectorFree free, void *free_user)
static size_t rz_vector_len(const RzVector *vec)
RZ_API void rz_vector_init(RzVector *vec, size_t elem_size, RzVectorFree free, void *free_user)
Information about the binary layout in a NT_PRSTATUS note for core files of a certain architecture an...
Parsed PT_NOTE of type NT_PRSTATUS.
ut64(WINAPI *w32_GetEnabledXStateFeatures)()