Added a dedicated file for handling the OS ABI values.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "elf_header.h"
|
||||
#include "elf_osabi.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -83,6 +84,15 @@ struct elf_header* ParseObjectFile(const char* bytes, size_t count) {
|
||||
printf("Data: Unknown byte order\n");
|
||||
}
|
||||
|
||||
if (bytes[EI_HEADER_VERSION] == 1) printf("ELF File Version: Current (1)\n");
|
||||
else printf("ELF File Version: Invalid (%d)\n", bytes[EI_HEADER_VERSION]);
|
||||
|
||||
char buffer[255];
|
||||
|
||||
GetELFOSABIString(bytes[EI_OSABI], buffer);
|
||||
|
||||
printf("OS ABI: %s\n", buffer);
|
||||
|
||||
// int64_t entryAddress;
|
||||
|
||||
// memcpy(&entryAddress, &bytes[EI_ENTRY_ADDRESS_POINT], sizeof(int64_t));
|
||||
|
||||
Reference in New Issue
Block a user