fix (ELF): commented elf status messages out

This commit is contained in:
antifallobst 2023-04-25 23:14:17 +02:00
parent 203a8c2049
commit 62816ebcbd
1 changed files with 15 additions and 15 deletions

View File

@ -73,28 +73,28 @@ elf_executable_T* elf_executable_create(uint8_t* buffer) {
return NULL; return NULL;
} }
log(LOG_INFO, "ELF header:"); // log(LOG_INFO, "ELF header:");
log(LOG_INFO, " -> Architecture: %s", g_elf_target_architecture_strings[executable_temp.executable->header.identity[4]]); // log(LOG_INFO, " -> Architecture: %s", g_elf_target_architecture_strings[executable_temp.executable->header.identity[4]]);
log(LOG_INFO, " -> Endian: %s", g_elf_endianness_strings[executable_temp.executable->header.identity[5]]); // log(LOG_INFO, " -> Endian: %s", g_elf_endianness_strings[executable_temp.executable->header.identity[5]]);
log(LOG_INFO, " -> SysABI: %s", g_elf_sysabi_strings[executable_temp.executable->header.identity[7]]); // log(LOG_INFO, " -> SysABI: %s", g_elf_sysabi_strings[executable_temp.executable->header.identity[7]]);
log(LOG_INFO, " -> Type: %s", g_elf_object_type_strings[executable_temp.executable->header.type]); // log(LOG_INFO, " -> Type: %s", g_elf_object_type_strings[executable_temp.executable->header.type]);
log(LOG_INFO, " -> ISA: %s", g_elf_instruction_set_strings[executable_temp.executable->header.isa]); // log(LOG_INFO, " -> ISA: %s", g_elf_instruction_set_strings[executable_temp.executable->header.isa]);
log(LOG_INFO, " -> Entry: 0x%x", executable_temp.executable->header.address_entry_point); // log(LOG_INFO, " -> Entry: 0x%x", executable_temp.executable->header.address_entry_point);
log(LOG_INFO, " -> PHDR offset: 0x%x", executable_temp.executable->header.offset_program_header); // log(LOG_INFO, " -> PHDR offset: 0x%x", executable_temp.executable->header.offset_program_header);
log(LOG_INFO, " -> PHDR num: %d", executable_temp.executable->header.num_program_header_entries); // log(LOG_INFO, " -> PHDR num: %d", executable_temp.executable->header.num_program_header_entries);
log(LOG_INFO, " -> SHDR offset: 0x%x", executable_temp.executable->header.offset_section_header); // log(LOG_INFO, " -> SHDR offset: 0x%x", executable_temp.executable->header.offset_section_header);
log(LOG_INFO, " -> SHDR num: %d\n", executable_temp.executable->header.num_section_header_entries); // log(LOG_INFO, " -> SHDR num: %d\n", executable_temp.executable->header.num_section_header_entries);
executable_temp.buffer = buffer; executable_temp.buffer = buffer;
log(LOG_INFO, "Section Headers:"); // log(LOG_INFO, "Section Headers:");
elf_section_T* sections = (elf_section_T*)&buffer[executable_temp.executable->header.offset_section_header]; elf_section_T* sections = (elf_section_T*)&buffer[executable_temp.executable->header.offset_section_header];
executable_temp.section_header_string_table = &sections[executable_temp.executable->header.string_section_index]; executable_temp.section_header_string_table = &sections[executable_temp.executable->header.string_section_index];
for (int i = 0; i < executable_temp.executable->header.num_section_header_entries; i++) { for (int i = 0; i < executable_temp.executable->header.num_section_header_entries; i++) {
string_t name = (string_t)&(&buffer[executable_temp.section_header_string_table->offset])[sections[i].name_offset]; string_t name = (string_t)&(&buffer[executable_temp.section_header_string_table->offset])[sections[i].name_offset];
log(LOG_INFO, " [%s] '%s'", g_elf_section_type_strings[MIN(sections[i].type, ELF_SECTION_ENUM_END)], name); // log(LOG_INFO, " [%s] '%s'", g_elf_section_type_strings[MIN(sections[i].type, ELF_SECTION_ENUM_END)], name);
switch (sections[i].type) { switch (sections[i].type) {
case ELF_SECTION_SYMBOL_TABLE: { case ELF_SECTION_SYMBOL_TABLE: {
@ -112,12 +112,12 @@ elf_executable_T* elf_executable_create(uint8_t* buffer) {
} }
} }
log(LOG_INFO, "Program Headers:"); // log(LOG_INFO, "Program Headers:");
executable_temp.executable->num_mappings = 0; executable_temp.executable->num_mappings = 0;
elf_segment_T* segments = (elf_segment_T*)&buffer[executable_temp.executable->header.offset_program_header]; elf_segment_T* segments = (elf_segment_T*)&buffer[executable_temp.executable->header.offset_program_header];
for (int i = 0; i < executable_temp.executable->header.num_program_header_entries; i++) { for (int i = 0; i < executable_temp.executable->header.num_program_header_entries; i++) {
log(LOG_INFO, " %s", g_elf_segment_type_strings[MIN(segments[i].type, ELF_SEGMENT_ENUM_END)]); // log(LOG_INFO, " %s", g_elf_segment_type_strings[MIN(segments[i].type, ELF_SEGMENT_ENUM_END)]);
switch (segments[i].type) { switch (segments[i].type) {
case ELF_SEGMENT_LOAD: { case ELF_SEGMENT_LOAD: {