Fix arm32 db/formats/dmp/dmp (#18062)

This commit is contained in:
Liumeo 2020-12-19 04:00:09 -05:00 committed by GitHub
parent 1491be12b6
commit 64e36a85af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View File

@ -78,7 +78,7 @@ static int r_bin_dmp64_init_bmp_pages(struct r_bin_dmp64_obj_t *obj) {
}
ut64 paddr_base = obj->bmp_header->FirstPage;
ut64 num_pages = obj->bmp_header->Pages;
RBitmap *bitmap = r_bitmap_new(num_pages);
RBitmap *bitmap = r_bitmap_new (num_pages);
r_bitmap_set_bytes (bitmap, obj->bitmap, num_pages / 8);
ut64 num_bitset = 0;
@ -109,7 +109,7 @@ static int r_bin_dmp64_init_bmp_header(struct r_bin_dmp64_obj_t *obj) {
r_sys_perror ("R_NEW0 (dmp_bmp_header)");
return false;
}
if (r_buf_read_at (obj->b, sizeof (dmp64_header), (ut8*)obj->bmp_header, sizeof (dmp_bmp_header) - sizeof (ut8*)) < 0) {
if (r_buf_read_at (obj->b, sizeof (dmp64_header), (ut8*)obj->bmp_header, offsetof (dmp_bmp_header, Bitmap)) < 0) {
eprintf ("Warning: read bmp_header\n");
return false;
}
@ -119,10 +119,10 @@ static int r_bin_dmp64_init_bmp_header(struct r_bin_dmp64_obj_t *obj) {
}
ut64 bitmapsize = obj->bmp_header->Pages / 8;
obj->bitmap = calloc (1, bitmapsize);
if (r_buf_read_at (obj->b, sizeof (dmp64_header) + sizeof (dmp_bmp_header) - sizeof (ut8*), obj->bitmap, bitmapsize) < 0) {
if (r_buf_read_at (obj->b, sizeof (dmp64_header) + offsetof (dmp_bmp_header, Bitmap), obj->bitmap, bitmapsize) < 0) {
eprintf ("Warning: read bitmap\n");
return false;
};
}
return true;
}

View File

@ -489,7 +489,7 @@ R_PACKED (
struct windows_exception_record64 {
ut32 exception_code;
ut32 exception_flags;
struct windows_exception_record64 *exception_record;
ut64 exception_record;
ut64 exception_address;
ut32 number_parameters;
ut32 __unusedAlignment;

View File

@ -14,12 +14,10 @@
extern "C" {
#endif
enum {
R_SYS_BITS_8 = 1,
R_SYS_BITS_16 = 2,
R_SYS_BITS_32 = 4,
R_SYS_BITS_64 = 8,
};
#define R_SYS_BITS_8 1
#define R_SYS_BITS_16 2
#define R_SYS_BITS_32 4
#define R_SYS_BITS_64 8
typedef struct {
char *sysname;