From 5bdf7d313f45c71229d09d27f6ae0e1f6dc49222 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 29 Sep 2023 01:56:57 +0300 Subject: [PATCH] LibELF: Add types for native executable --- LibELF/include/LibELF/Types.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/LibELF/include/LibELF/Types.h b/LibELF/include/LibELF/Types.h index 577c52d0cd..cc0351d01b 100644 --- a/LibELF/include/LibELF/Types.h +++ b/LibELF/include/LibELF/Types.h @@ -1,5 +1,7 @@ #pragma once +#include + #include namespace LibELF @@ -153,4 +155,35 @@ namespace LibELF Elf64Xword p_align; }; + +#if ARCH(i386) + using ElfNativeAddr = Elf32Addr; + using ElfNativeOff = Elf32Off; + using ElfNativeHalf = Elf32Half; + using ElfNativeWord = Elf32Word; + using ElfNativeSword = Elf32Sword; + using ElfNativeXword = Elf32Xword; + using ElfNativeSxword = Elf32Sxword; + using ElfNativeFileHeader = Elf32FileHeader; + using ElfNativeSectionHeader = Elf32SectionHeader; + using ElfNativeSymbol = Elf32Symbol; + using ElfNativeRelocation = Elf32Relocation; + using ElfNativeRelocationA = Elf32RelocationA; + using ElfNativeProgramHeader = Elf32ProgramHeader; +#elif ARCH(x86_64) + using ElfNativeAddr = Elf64Addr; + using ElfNativeOff = Elf64Off; + using ElfNativeHalf = Elf64Half; + using ElfNativeWord = Elf64Word; + using ElfNativeSword = Elf64Sword; + using ElfNativeXword = Elf64Xword; + using ElfNativeSxword = Elf64Sxword; + using ElfNativeFileHeader = Elf64FileHeader; + using ElfNativeSectionHeader = Elf64SectionHeader; + using ElfNativeSymbol = Elf64Symbol; + using ElfNativeRelocation = Elf64Relocation; + using ElfNativeRelocationA = Elf64RelocationA; + using ElfNativeProgramHeader = Elf64ProgramHeader; +#endif + } \ No newline at end of file