Fix warnings in RBin.{dmp,elf} (#17865)

This commit is contained in:
pancake 2020-10-28 10:21:07 +01:00 committed by GitHub
parent 0b8eb60ff7
commit e9916a1914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 20 deletions

View File

@ -39,8 +39,8 @@ static int r_bin_dmp64_init_memory_runs(struct r_bin_dmp64_obj_t *obj) {
free (runs);
return false;
}
page->start = (run->BasePage + j) * PAGE_SIZE ;
page->file_offset = base + num_page * PAGE_SIZE;
page->start = (run->BasePage + j) * DMP_PAGE_SIZE ;
page->file_offset = base + num_page * DMP_PAGE_SIZE;
r_list_append (obj->pages, page);
num_page++;
}
@ -90,8 +90,8 @@ static int r_bin_dmp64_init_bmp_pages(struct r_bin_dmp64_obj_t *obj) {
if (!page) {
return false;
}
page->start = i * PAGE_SIZE;
page->file_offset = paddr_base + num_bitset * PAGE_SIZE;
page->start = i * DMP_PAGE_SIZE;
page->file_offset = paddr_base + num_bitset * DMP_PAGE_SIZE;
r_list_append (obj->pages, page);
num_bitset++;
}

View File

@ -21,7 +21,7 @@
#define DMP_DUMPTYPE_BITMAPKERNEL 6
#define DMP_DUMPTYPE_AUTOMATIC 7
#define PAGE_SIZE 0x1000
#define DMP_PAGE_SIZE 0x1000
typedef struct _PHYSICAL_MEMORY_RUN {
ut64 BasePage;

View File

@ -42,19 +42,6 @@
#define COMPUTE_PLTGOT_POSITION(rel, pltgot_addr, n_initial_unused_entries) \
((rel->rva - pltgot_addr - n_initial_unused_entries * R_BIN_ELF_WORDSIZE) / R_BIN_ELF_WORDSIZE)
#if R_BIN_ELF64
static inline int UTX_MUL(ut64 *r, ut64 a, ut64 b) {
return UT64_MUL (r, a, b);
}
#else
static inline int UTX_MUL(ut64 *r, ut64 a, ut64 b) {
ut32 r2 = *r;
int res = UT32_MUL (&r2, a, b);
*r = r2;
return res;
}
#endif
#define GROWTH_FACTOR (1.5)
#define round_up(a) ((((a) + (4) - (1)) / (4)) * (4))

View File

@ -103,9 +103,9 @@ static RList *sections(RBinFile *bf) {
ptr->name = strdup ("Memory_Section");
ptr->paddr = page->file_offset;
ptr->size = PAGE_SIZE;
ptr->size = DMP_PAGE_SIZE;
ptr->vaddr = page->start;
ptr->vsize = PAGE_SIZE;
ptr->vsize = DMP_PAGE_SIZE;
ptr->add = true;
ptr->perm = R_PERM_R;