for( i_cnt = 0; i_cnt < i_phdrnum; i_cnt++ ) {
// Inset ObjectInfo ---
+ // p_vaddr - Virtual address in memory image.
+ // p_memsz - Size of contents in memory.
p_objinfo = ObjectInfo_InsetObject(
p_pginfo, p_proghdr->p_vaddr, p_proghdr->p_memsz, NULL, 0x00 );
if( NULL == p_objinfo ) {
// Set ProgramHdr Value to ObjectInfo ---
p_objinfo->b_type = OBJINFO_TYPE_PROGHDR;
+
p_objinfo->file.i_fid = p_binfo->i_binfile;
+ // p_offset - File offset of contents.
p_objinfo->file.pv_offset = (void *)(pb_data + p_proghdr->p_offset);
+ // p_filesz - Size of contents in file.
p_objinfo->file.qw_size = p_proghdr->p_filesz;
+ // p_type - Entry type.
+ p_objinfo->info.proghdr.dw_type = p_proghdr->p_type;
+ // p_flags - Access permission flags.
+ p_objinfo->info.proghdr.dw_flags = p_proghdr->p_flags;
+ // p_align - Alignment in memory and file.
p_objinfo->info.proghdr.qw_align = p_proghdr->p_align;
+ // ELF Program Header
+ p_objinfo->info.proghdr.pv_proghdr = (void *)p_proghdr;
// for Next-Loop proc.
p_proghdr = (Elf64_Phdr *)(pb_data + p_elfhdr->e_phoff + (i_cnt * i_phdrsize));
p_objinfo = ObjectInfo_InsetObject(
p_pginfo, p_section->ptr_addr.value, p_section->qw_size, NULL, 0x01 );
- p_objinfo->b_type = OBJINFO_TYPE_SECTION;
- p_objinfo->file.i_fid = p_section->i_fid;
+ p_objinfo->b_type = OBJINFO_TYPE_SECTION;
+
+ p_objinfo->file.i_fid = p_section->i_fid;
p_objinfo->file.pv_offset = (void *)p_section->pb_data;
+ p_objinfo->file.qw_size = p_section->qw_size;
}
}
*/
}
+ // sh_name - Section name (index into the section header string table).
+ // sh_type - Section type.
+ // sh_flags - Section flags.
+ // sh_addr - Address in memory image.
+ // sh_offset - Offset in file.
+ // sh_size - Size in bytes.
+ // sh_link - Index of a related section.
+ // sh_info - Depends on section type.
+ // sh_addralign - Alignment in bytes.
+ // sh_entsize - Size of each entry in section.
return 0x00;
// ObjectInfo (DATA) ---
char *pstr_name; // Object Name (Param./Func./etc...)
union {
+ Byte b_data[128];
+
struct {
- QWord qw_align;
-
+ DWord dw_type; /* Entry type. */
+ DWord dw_flags; /* Access permission flags. */
+ QWord qw_align; /* Alignment in memory and file. */
+ void *pv_proghdr;
} proghdr;
+ struct {
+ void *pv_sechdr;
+ } section;
+
} info;