16 return (obj && obj->
kv) ? obj->
kv :
NULL;
25 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
26 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
36 rz_list_foreach (obj->
pe32_bins, it, pe32_bin) {
37 list = Pe32_rz_bin_mdmp_pe_get_entrypoint(pe32_bin);
41 rz_list_foreach (obj->
pe64_bins, it, pe64_bin) {
42 list = Pe64_rz_bin_mdmp_pe_get_entrypoint(pe64_bin);
66 ret->
type =
strdup(
"MDMP (MiniDump crash report data)");
105 ret->
os =
rz_str_newf(
"Windows NT Server Domain Controller %d.%d.%d",
129 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
130 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
145 rz_list_foreach (obj->
pe32_bins, it, pe32_bin) {
146 if (!(
libs = Pe32_rz_bin_pe_get_libs(pe32_bin->bin))) {
149 for (
i = 0; !
libs[
i].last;
i++) {
155 rz_list_foreach (obj->
pe64_bins, it, pe64_bin) {
156 if (!(
libs = Pe64_rz_bin_pe_get_libs(pe64_bin->bin))) {
159 for (
i = 0; !
libs[
i].last;
i++) {
187 struct minidump_memory_descriptor *memory;
193 map->paddr = (memory->memory).
rva;
194 map->psize = (memory->memory).data_size;
195 map->vaddr = memory->start_of_memory_range;
196 map->vsize = (memory->memory).data_size;
203 struct minidump_memory_descriptor64 *memory64;
210 map->psize = memory64->data_size;
211 map->vaddr = memory64->start_of_memory_range;
212 map->vsize = memory64->data_size;
216 index += memory64->data_size;
223 struct minidump_module *
module;
224 struct minidump_string *
str;
226 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
227 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
245 if (
module->module_name_rva +
sizeof(
struct minidump_string) >=
rz_buf_size(obj->
b)) {
250 str = (
struct minidump_string *)
b;
251 int ptr_name_len = (
str->length + 2) * 4;
252 if (ptr_name_len < 1 || ptr_name_len >
sizeof(
b) - 4) {
280 rz_list_foreach (obj->
pe32_bins, it0, pe32_bin) {
281 if (pe32_bin->vaddr ==
module->base_of_image && pe32_bin->bin) {
282 pe_secs = Pe32_rz_bin_mdmp_pe_get_sections(pe32_bin);
287 rz_list_foreach (obj->
pe64_bins, it0, pe64_bin) {
288 if (pe64_bin->vaddr ==
module->base_of_image && pe64_bin->bin) {
289 pe_secs = Pe64_rz_bin_mdmp_pe_get_sections(pe64_bin);
295 RZ_LOG_WARN(
"Parsing data sections for large dumps can take time, "
296 "please be patient (if strings are not needed, try with -z)!\n");
301 struct minidump_location_descriptor *location =
NULL;
302 struct minidump_memory_descriptor *
module;
303 struct minidump_memory_descriptor64 *module64;
304 struct minidump_memory_info *mem_info;
325 ptr->
size = location ? location->data_size : 0;
331 state = mem_info->state;
332 type = mem_info->type;
333 a_protect = mem_info->allocation_protect;
335 location = &(
module->memory);
337 " type=0x%08" PFMT64x " allocation_protect=0x%08" PFMT64x " Memory_Section",
348 ptr->
addr = module64->start_of_memory_range;
349 ptr->
size = module64->data_size;
355 state = mem_info->state;
356 type = mem_info->type;
357 a_protect = mem_info->allocation_protect;
360 " type=0x%08" PFMT64x " allocation_protect=0x%08" PFMT64x " Memory_Section",
363 index += module64->data_size;
373 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
374 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
384 rz_list_foreach (obj->
pe32_bins, it, pe32_bin) {
385 if (pe32_bin->bin && pe32_bin->bin->relocs) {
389 rz_list_foreach (obj->
pe64_bins, it, pe64_bin) {
390 if (pe64_bin->bin && pe64_bin->bin->relocs) {
400 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
401 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
412 rz_list_foreach (obj->
pe32_bins, it, pe32_bin) {
413 list = Pe32_rz_bin_mdmp_pe_get_imports(pe32_bin);
419 rz_list_foreach (obj->
pe64_bins, it, pe64_bin) {
420 list = Pe64_rz_bin_mdmp_pe_get_imports(pe64_bin);
431 struct Pe32_rz_bin_mdmp_pe_bin *pe32_bin;
432 struct Pe64_rz_bin_mdmp_pe_bin *pe64_bin;
442 rz_list_foreach (obj->
pe32_bins, it, pe32_bin) {
443 list = Pe32_rz_bin_mdmp_pe_get_symbols(bf->
rbin, pe32_bin);
447 rz_list_foreach (obj->
pe64_bins, it, pe64_bin) {
448 list = Pe64_rz_bin_mdmp_pe_get_symbols(bf->
rbin, pe64_bin);
469 .desc =
"Minidump format rz_bin plugin",
487 #ifndef RZ_PLUGIN_INCORE
RZ_API RZ_OWN RzList * rz_bin_file_strings(RZ_NONNULL RzBinFile *bf, size_t min_length, bool raw_strings)
Generates a RzList struct containing RzBinString from a given RzBinFile.
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
RZ_API void rz_bin_map_free(RzBinMap *map)
RZ_API void rz_bin_import_free(RzBinImport *imp)
RZ_API void rz_bin_section_free(RzBinSection *bs)
static RzList * mem(RzBinFile *bf)
static Sdb * get_sdb(RzBinFile *bf)
static bool load_buffer(RzBinFile *bf, RzBinObject *obj, RzBuffer *buf, Sdb *sdb)
static RzList * symbols(RzBinFile *bf)
static RzList * libs(RzBinFile *bf)
static RzList * strings(RzBinFile *bf)
static void destroy(RzBinFile *bf)
RZ_API RzLibStruct rizin_plugin
static bool check_buffer(RzBuffer *b)
static RzBinInfo * info(RzBinFile *bf)
static RzList * entries(RzBinFile *bf)
static RzList * maps(RzBinFile *bf)
static RzList * sections(RzBinFile *bf)
static RzList * imports(RzBinFile *bf)
static RzList * relocs(RzBinFile *bf)
RzBinPlugin rz_bin_plugin_mdmp
RZ_API void rz_bin_mem_free(void *data)
static ut64 rva(RzBinObject *o, ut64 paddr, ut64 vaddr, int va)
size_t map(int syms, int left, int len)
RZ_API char * sdb_fmt(const char *fmt,...)
RZ_API void Ht_() free(HtName_(Ht) *ht)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * calloc(size_t number, size_t size)
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")
void rz_bin_mdmp_free(struct rz_bin_mdmp_obj *obj)
ut64 rz_bin_mdmp_get_paddr(struct rz_bin_mdmp_obj *obj, ut64 vaddr)
struct rz_bin_mdmp_obj * rz_bin_mdmp_new_buf(RzBuffer *buf)
ut32 rz_bin_mdmp_get_perm(struct rz_bin_mdmp_obj *obj, ut64 vaddr)
struct minidump_memory_info * rz_bin_mdmp_get_mem_info(struct rz_bin_mdmp_obj *obj, ut64 vaddr)
#define MDMP_PROCESSOR_ARCHITECTURE_AMD64
#define MDMP_PROCESSOR_ARCHITECTURE_ARM
#define MDMP_PROCESSOR_ARCHITECTURE_IA64
#define MDMP_VER_NT_WORKSTATION
#define MDMP_VER_NT_SERVER
#define MDMP_VER_NT_DOMAIN_CONTROLLER
#define MDMP_PROCESSOR_ARCHITECTURE_INTEL
RZ_API int sdb_ns_set(Sdb *s, const char *name, Sdb *r)
RZ_API int sdb_num_set(Sdb *s, const char *key, ut64 v, ut32 cas)
#define rz_return_val_if_fail(expr, val)
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.
void(* RzListFree)(void *ptr)
#define RZ_LOG_WARN(fmtstr,...)
RZ_API int rz_str_utf16_to_utf8(ut8 *dst, int len_dst, const ut8 *src, int len_src, bool little_endian)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
XX curplugin == o->plugin.
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
Description of a single memory mapping into virtual memory from a binary.
struct minidump_system_info * system_info
struct rz_bin_mdmp_obj::minidump_streams::@163 memories64
struct rz_bin_mdmp_obj::minidump_streams streams
struct minidump_header * hdr
if(dbg->bits==RZ_SYS_BITS_64)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()