Index: llvm/docs/yaml2obj.rst =================================================================== --- llvm/docs/yaml2obj.rst +++ llvm/docs/yaml2obj.rst @@ -34,6 +34,56 @@ StructuredData: - Binary: {type: str} - UInt32: {type: int} + - LoadConfig: + Size: {type: int} + TimeDateStamp: {type: int} + MajorVersion: {type: int} + MinorVersion: {type: int} + GlobalFlagsClear: {type: int} + GlobalFlagsSet: {type: int} + CriticalSectionDefaultTimeout: {type: int} + DeCommitFreeBlockThreshold: {type: int} + DeCommitTotalFreeThreshold: {type: int} + LockPrefixTable: {type: int} + MaximumAllocationSize: {type: int} + VirtualMemoryThreshold: {type: int} + ProcessAffinityMask: {type: int} + ProcessHeapFlags: {type: int} + CSDVersion: {type: int} + DependentLoadFlags: {type: int} + EditList: {type: int} + SecurityCookie: {type: int} + SEHandlerTable: {type: int} + SEHandlerCount: {type: int} + GuardCFCheckFunction: {type: int} + GuardCFCheckDispatch: {type: int} + GuardCFFunctionTable: {type: int} + GuardCFFunctionCount: {type: int} + GuardFlags: {type: int} + CodeIntegrity: + Flags: {type: int} + Catalog: {type: int} + CatalogOffset: {type: int} + GuardAddressTakenIatEntryTable: {type: int} + GuardAddressTakenIatEntryCount: {type: int} + GuardLongJumpTargetTable: {type: int} + GuardLongJumpTargetCount: {type: int} + DynamicValueRelocTable: {type: int} + CHPEMetadataPointer: {type: int} + GuardRFFailureRoutine: {type: int} + GuardRFFailureRoutineFunctionPointer: {type: int} + DynamicValueRelocTableOffset: {type: int} + DynamicValueRelocTableSection: {type: int} + GuardRFVerifyStackPointerFunctionPointer: {type: int} + HotPatchTableOffset: {type: int} + EnclaveConfigurationPointer: {type: int} + VolatileMetadataPointer: {type: int} + GuardEHContinuationTable: {type: int} + GuardEHContinuationCount: {type: int} + GuardXFGCheckFunctionPointer: {type: int} + GuardXFGDispatchFunctionPointer: {type: int} + GuardXFGTableDispatchFunctionPointer: {type: int} + CastGuardOsDeterminedFailureMode: {type: int} symbols: - Name: .text Index: llvm/include/llvm/BinaryFormat/COFF.h =================================================================== --- llvm/include/llvm/BinaryFormat/COFF.h +++ llvm/include/llvm/BinaryFormat/COFF.h @@ -130,6 +130,10 @@ return Machine == IMAGE_FILE_MACHINE_ARM64 || isArm64EC(Machine); } +template bool is64Bit(T Machine) { + return Machine == IMAGE_FILE_MACHINE_AMD64 || isAnyArm64(Machine); +} + enum Characteristics : unsigned { C_Invalid = 0, Index: llvm/include/llvm/ObjectYAML/COFFYAML.h =================================================================== --- llvm/include/llvm/ObjectYAML/COFFYAML.h +++ llvm/include/llvm/ObjectYAML/COFFYAML.h @@ -15,6 +15,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/BinaryFormat/COFF.h" +#include "llvm/Object/COFF.h" #include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h" #include "llvm/ObjectYAML/CodeViewYAMLTypeHashing.h" #include "llvm/ObjectYAML/CodeViewYAMLTypes.h" @@ -69,6 +70,8 @@ struct SectionDataEntry { std::optional UInt32; yaml::BinaryRef Binary; + std::optional LoadConfig32; + std::optional LoadConfig64; size_t size() const; void writeAsBinary(raw_ostream &OS) const; @@ -246,6 +249,18 @@ static void mapping(IO &IO, COFF::AuxiliaryCLRToken &ACT); }; +template <> struct MappingTraits { + static void mapping(IO &IO, object::coff_load_configuration32 &ACT); +}; + +template <> struct MappingTraits { + static void mapping(IO &IO, object::coff_load_configuration64 &ACT); +}; + +template <> struct MappingTraits { + static void mapping(IO &IO, object::coff_load_config_code_integrity &ACT); +}; + template <> struct MappingTraits { static void mapping(IO &IO, COFFYAML::Symbol &S); Index: llvm/lib/ObjectYAML/COFFEmitter.cpp =================================================================== --- llvm/lib/ObjectYAML/COFFEmitter.cpp +++ llvm/lib/ObjectYAML/COFFEmitter.cpp @@ -16,7 +16,6 @@ #include "llvm/ADT/StringMap.h" #include "llvm/DebugInfo/CodeView/DebugStringTableSubsection.h" #include "llvm/DebugInfo/CodeView/StringsAndChecksums.h" -#include "llvm/Object/COFF.h" #include "llvm/ObjectYAML/ObjectYAML.h" #include "llvm/ObjectYAML/yaml2obj.h" #include "llvm/Support/BinaryStreamWriter.h" @@ -48,10 +47,7 @@ } bool isPE() const { return Obj.OptionalHeader.has_value(); } - bool is64Bit() const { - return Obj.Header.Machine == COFF::IMAGE_FILE_MACHINE_AMD64 || - COFF::isAnyArm64(Obj.Header.Machine); - } + bool is64Bit() const { return COFF::is64Bit(Obj.Header.Machine); } uint32_t getFileAlignment() const { return Obj.OptionalHeader->Header.FileAlignment; @@ -598,13 +594,28 @@ size_t Size = Binary.binary_size(); if (UInt32) Size += sizeof(*UInt32); + if (LoadConfig32) + Size += LoadConfig32->Size; + if (LoadConfig64) + Size += LoadConfig64->Size; return Size; } +template static void writeLoadConfig(T &S, raw_ostream &OS) { + OS.write(reinterpret_cast(&S), + std::min(sizeof(S), static_cast(S.Size))); + if (sizeof(S) < S.Size) + OS.write_zeros(S.Size - sizeof(S)); +} + void COFFYAML::SectionDataEntry::writeAsBinary(raw_ostream &OS) const { if (UInt32) OS << binary_le(*UInt32); Binary.writeAsBinary(OS); + if (LoadConfig32) + writeLoadConfig(*LoadConfig32, OS); + if (LoadConfig64) + writeLoadConfig(*LoadConfig64, OS); } namespace llvm { Index: llvm/lib/ObjectYAML/COFFYAML.cpp =================================================================== --- llvm/lib/ObjectYAML/COFFYAML.cpp +++ llvm/lib/ObjectYAML/COFFYAML.cpp @@ -547,10 +547,100 @@ IO.mapRequired("SymbolTableIndex", ACT.SymbolTableIndex); } +void MappingTraits::mapping( + IO &IO, object::coff_load_config_code_integrity &S) { + IO.mapOptional("Flags", S.Flags); + IO.mapOptional("Catalog", S.Catalog); + IO.mapOptional("CatalogOffset", S.CatalogOffset); +} + +template +void mapLoadConfigMember(IO &IO, T &LoadConfig, const char *Name, M &Member) { + // Map only members that mach a specified size. + if (reinterpret_cast(&Member) - + reinterpret_cast(&LoadConfig) < + LoadConfig.Size) + IO.mapOptional(Name, Member); +} + +template void mapLoadConfig(IO &IO, T &LoadConfig) { + IO.mapOptional("Size", LoadConfig.Size, + support::ulittle32_t(sizeof(LoadConfig))); + // The size must be large enough to fit at least the size member itself. + if (LoadConfig.Size < sizeof(LoadConfig.Size)) { + IO.setError("Size must be at least " + Twine(sizeof(LoadConfig.Size))); + return; + } + +#define MCase(X) mapLoadConfigMember(IO, LoadConfig, #X, LoadConfig.X) + MCase(TimeDateStamp); + MCase(MajorVersion); + MCase(MinorVersion); + MCase(GlobalFlagsClear); + MCase(GlobalFlagsSet); + MCase(CriticalSectionDefaultTimeout); + MCase(DeCommitFreeBlockThreshold); + MCase(DeCommitTotalFreeThreshold); + MCase(LockPrefixTable); + MCase(MaximumAllocationSize); + MCase(VirtualMemoryThreshold); + MCase(ProcessAffinityMask); + MCase(ProcessHeapFlags); + MCase(CSDVersion); + MCase(DependentLoadFlags); + MCase(EditList); + MCase(SecurityCookie); + MCase(SEHandlerTable); + MCase(SEHandlerCount); + MCase(GuardCFCheckFunction); + MCase(GuardCFCheckDispatch); + MCase(GuardCFFunctionTable); + MCase(GuardCFFunctionCount); + MCase(GuardFlags); + MCase(CodeIntegrity); + MCase(GuardAddressTakenIatEntryTable); + MCase(GuardAddressTakenIatEntryCount); + MCase(GuardLongJumpTargetTable); + MCase(GuardLongJumpTargetCount); + MCase(DynamicValueRelocTable); + MCase(CHPEMetadataPointer); + MCase(GuardRFFailureRoutine); + MCase(GuardRFFailureRoutineFunctionPointer); + MCase(DynamicValueRelocTableOffset); + MCase(DynamicValueRelocTableSection); + MCase(GuardRFVerifyStackPointerFunctionPointer); + MCase(HotPatchTableOffset); + MCase(EnclaveConfigurationPointer); + MCase(VolatileMetadataPointer); + MCase(GuardEHContinuationTable); + MCase(GuardEHContinuationCount); + MCase(GuardXFGCheckFunctionPointer); + MCase(GuardXFGDispatchFunctionPointer); + MCase(GuardXFGTableDispatchFunctionPointer); + MCase(CastGuardOsDeterminedFailureMode); +#undef MCase +} + +void MappingTraits::mapping( + IO &IO, object::coff_load_configuration32 &S) { + mapLoadConfig(IO, S); +} + +void MappingTraits::mapping( + IO &IO, object::coff_load_configuration64 &S) { + mapLoadConfig(IO, S); +} + void MappingTraits::mapping( IO &IO, COFFYAML::SectionDataEntry &E) { IO.mapOptional("UInt32", E.UInt32); IO.mapOptional("Binary", E.Binary); + + COFF::header &H = *static_cast(IO.getContext()); + if (COFF::is64Bit(H.Machine)) + IO.mapOptional("LoadConfig", E.LoadConfig64); + else + IO.mapOptional("LoadConfig", E.LoadConfig32); } void MappingTraits::mapping(IO &IO, COFFYAML::Symbol &S) { Index: llvm/test/tools/llvm-readobj/arm64ec-chpe.yaml =================================================================== --- llvm/test/tools/llvm-readobj/arm64ec-chpe.yaml +++ llvm/test/tools/llvm-readobj/arm64ec-chpe.yaml @@ -39,7 +39,9 @@ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] VirtualAddress: 0x4000 VirtualSize: 328 - SectionData: '40010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050008001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + StructuredData: + - LoadConfig: + CHPEMetadataPointer: 0x180005000 - Name: .data Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] VirtualAddress: 0x5000 Index: llvm/test/tools/yaml2obj/COFF/load-config.yaml =================================================================== --- /dev/null +++ llvm/test/tools/yaml2obj/COFF/load-config.yaml @@ -0,0 +1,320 @@ +## Test all members of 64-bit load config. +# RUN: yaml2obj --docnum=1 %s -o %t +# RUN: llvm-readobj --coff-load-config %t | FileCheck %s --check-prefix=ALL + +## Simple 32-bit load config. +# RUN: yaml2obj --docnum=2 %s -o %t +# RUN: llvm-readobj --coff-load-config %t | FileCheck %s --check-prefix=LOADCFG32 + +## Create load config with all fields using default values. +# RUN: yaml2obj --docnum=3 %s -o %t +# RUN: llvm-readobj --coff-load-config %t | FileCheck %s --check-prefix=DEF + +## Create laod config larger than coff_load_configuration32 struct. +# RUN: yaml2obj --docnum=4 %s -o %t +# RUN: llvm-readobj --hex-dump=.rdata %t | FileCheck %s --check-prefix=LARGE + +## Try to specify load config field that barely fits specified size. +# RUN: yaml2obj --docnum=5 %s -o %t +# RUN: llvm-readobj --hex-dump=.rdata %t | FileCheck %s --check-prefix=SMALL +# SMALL: 0x180001000 09000000 00000000 aaffffff ff + +## Try to specify load config field that does not fit specified size. +# RUN: not yaml2obj --docnum=6 %s -o %t 2>&1 | FileCheck %s --check-prefix=TOOSMALL +# TOOSMALL: error: unknown key 'MajorVersion' + +## Set load config size to 0. +# RUN: not yaml2obj --docnum=7 %s -o %t 2>&1 | FileCheck %s --check-prefix=ZERO +# ZERO: error: Size must be at least 4 + +# ALL: Format: COFF-x86-64 +# ALL: Arch: x86_64 +# ALL: AddressSize: 64bit +# ALL: LoadConfig [ +# ALL: Size: 0x150 +# ALL: TimeDateStamp: 1970-01-01 00:00:01 (0x1) +# ALL: MajorVersion: 0x2 +# ALL: MinorVersion: 0x3 +# ALL: GlobalFlagsClear: 0x4 +# ALL: GlobalFlagsSet: 0x5 +# ALL: CriticalSectionDefaultTimeout: 0x6 +# ALL: DeCommitFreeBlockThreshold: 0x7 +# ALL: DeCommitTotalFreeThreshold: 0x8 +# ALL: LockPrefixTable: 0x9 +# ALL: MaximumAllocationSize: 0x100000 +# ALL: VirtualMemoryThreshold: 0x2000000 +# ALL: ProcessHeapFlags: 0x2 +# ALL: ProcessAffinityMask: 0x1 +# ALL: CSDVersion: 0x3 +# ALL: DependentLoadFlags: 0x4 +# ALL: EditList: 0x5 +# ALL: SecurityCookie: 0x6 +# ALL: SEHandlerTable: 0x0 +# ALL: SEHandlerCount: 0 +# ALL: GuardCFCheckFunction: 0x9 +# ALL: GuardCFCheckDispatch: 0x1 +# ALL: GuardCFFunctionTable: 0x0 +# ALL: GuardCFFunctionCount: 0 +# ALL: GuardFlags [ (0x4) +# ALL: ] +# ALL: GuardAddressTakenIatEntryTable: 0x0 +# ALL: GuardAddressTakenIatEntryCount: 0 +# ALL: GuardLongJumpTargetTable: 0x0 +# ALL: GuardLongJumpTargetCount: 0 +# ALL: DynamicValueRelocTable: 0x2 +# ALL: CHPEMetadataPointer: 0x0 +# ALL: GuardRFFailureRoutine: 0x4 +# ALL: GuardRFFailureRoutineFunctionPointer: 0x5 +# ALL: DynamicValueRelocTableOffset: 0x6 +# ALL: DynamicValueRelocTableSection: 7 +# ALL: GuardRFVerifyStackPointerFunctionPointer: 0x8 +# ALL: HotPatchTableOffset: 0x9 +# ALL: EnclaveConfigurationPointer: 0x1 +# ALL: VolatileMetadataPointer: 0x2 +# ALL: GuardEHContinuationTable: 0x0 +# ALL: GuardEHContinuationCount: 0 +# ALL: ] + +# LOADCFG32: LoadConfig [ +# LOADCFG32: MaximumAllocationSize: 0x100000 +# LOADCFG32: VirtualMemoryThreshold: 0x2000000 +# LOADCFG32: CHPEMetadataPointer: 0 + +# DEF: Format: COFF-x86-64 +# DEF: Arch: x86_64 +# DEF: AddressSize: 64bit +# DEF: LoadConfig [ +# DEF: Size: 0x138 +# DEF: MajorVersion: 0x0 +# DEF: MinorVersion: 0x0 +# DEF: GuardEHContinuationCount: 0 +# DEF: ] + +# LARGE: 0x00401000 d0000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401010 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401020 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401030 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401040 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401050 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401060 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401070 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401080 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x00401090 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x004010a0 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x004010b0 00000000 00000000 ff000000 00000000 ................ +# LARGE-NEXT: 0x004010c0 00000000 00000000 00000000 00000000 ................ +# LARGE-NEXT: 0x004010d0 aabbccdd .... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 320 + StructuredData: + - LoadConfig: + Size: 0x150 + TimeDateStamp: 1 + MajorVersion: 2 + MinorVersion: 3 + GlobalFlagsClear: 4 + GlobalFlagsSet: 5 + CriticalSectionDefaultTimeout: 6 + DeCommitFreeBlockThreshold: 7 + DeCommitTotalFreeThreshold: 8 + LockPrefixTable: 9 + MaximumAllocationSize: 0x100000 + VirtualMemoryThreshold: 0x2000000 + ProcessAffinityMask: 1 + ProcessHeapFlags: 2 + CSDVersion: 3 + DependentLoadFlags: 4 + EditList: 5 + SecurityCookie: 6 + SEHandlerTable: 0 + SEHandlerCount: 0 + GuardCFCheckFunction: 9 + GuardCFCheckDispatch: 1 + GuardCFFunctionTable: 0 + GuardCFFunctionCount: 0 + GuardFlags: 4 + CodeIntegrity: + Flags: 0x100 + Catalog: 5 + CatalogOffset: 6 + GuardAddressTakenIatEntryTable: 0 + GuardAddressTakenIatEntryCount: 0 + GuardLongJumpTargetTable: 0 + GuardLongJumpTargetCount: 0 + DynamicValueRelocTable: 2 + CHPEMetadataPointer: 0 + GuardRFFailureRoutine: 4 + GuardRFFailureRoutineFunctionPointer: 5 + DynamicValueRelocTableOffset: 6 + DynamicValueRelocTableSection: 7 + GuardRFVerifyStackPointerFunctionPointer: 8 + HotPatchTableOffset: 9 + EnclaveConfigurationPointer: 1 + VolatileMetadataPointer: 2 + GuardEHContinuationTable: 0 + GuardEHContinuationCount: 0 + GuardXFGCheckFunctionPointer: 5 + GuardXFGDispatchFunctionPointer: 6 + GuardXFGTableDispatchFunctionPointer: 7 + CastGuardOsDeterminedFailureMode: 8 +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_I386 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 320 + StructuredData: + - LoadConfig: + MaximumAllocationSize: 0x100000 + VirtualMemoryThreshold: 0x2000000 +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 320 + StructuredData: + - LoadConfig: +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x400000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_I386 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 0xd4 + StructuredData: + - LoadConfig: + Size: 0xd0 + CastGuardOsDeterminedFailureMode: 0xff + - UInt32: 0xddccbbaa +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 13 + StructuredData: + - LoadConfig: + Size: 9 + MajorVersion: 0xbbaa + - UInt32: 0xffffffff +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 320 + StructuredData: + - LoadConfig: + Size: 8 + MajorVersion: 10 +symbols: [] +... + +--- !COFF +OptionalHeader: + ImageBase: 0x180000000 + SectionAlignment: 4096 + FileAlignment: 512 + DLLCharacteristics: [ ] + LoadConfigTable: + RelativeVirtualAddress: 0x1000 + Size: 320 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 0x1000 + VirtualSize: 320 + StructuredData: + - LoadConfig: + Size: 0 +symbols: [] +...