- cleanup because I forgot some refactoring in last commit
@@ -33,36 +33,8 @@ | ||
33 | 33 | inline PEFunctionRegistryARM64( const PEFunctionRegistryARM64& ) = delete; |
34 | 34 | inline PEFunctionRegistryARM64( PEFunctionRegistryARM64&& ) = default; |
35 | 35 | |
36 | - void SerializeDataDirectory( PEFile::PESection *targetSect, std::uint64_t peImageBase ) override | |
37 | - { | |
38 | - const auto& exceptRFs = this->entries; | |
36 | + void SerializeDataDirectory( PEFile::PESection *targetSect, std::uint64_t peImageBase ) override; | |
39 | 37 | |
40 | - std::uint32_t numExceptEntries = (std::uint32_t)exceptRFs.GetCount(); | |
41 | - | |
42 | - const std::uint32_t exceptTableSize = ( sizeof(PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64) * numExceptEntries ); | |
43 | - | |
44 | - if ( numExceptEntries != 0 ) | |
45 | - { | |
46 | - PEFile::PESectionAllocation exceptTableAlloc; | |
47 | - targetSect->Allocate( exceptTableAlloc, exceptTableSize, sizeof(std::uint32_t) ); | |
48 | - | |
49 | - for ( std::uint32_t n = 0; n < numExceptEntries; n++ ) | |
50 | - { | |
51 | - const PEFileDetails::PERuntimeFunctionARM64& rfEntry = entries[ n ]; | |
52 | - | |
53 | - PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64 info; | |
54 | - info.BeginAddress = rfEntry.BeginAddress.GetRVA(); | |
55 | - info.UnwindData = rfEntry.UnwindData; | |
56 | - | |
57 | - const std::uint32_t rfEntryOff = ( n * sizeof(PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64) ); | |
58 | - | |
59 | - exceptTableAlloc.WriteToSection( &info, sizeof(info), rfEntryOff ); | |
60 | - } | |
61 | - | |
62 | - this->allocEntry = std::move( exceptTableAlloc ); | |
63 | - } | |
64 | - } | |
65 | - | |
66 | 38 | peVector <PEFileDetails::PERuntimeFunctionARM64> entries; |
67 | 39 | }; |
68 | 40 |
@@ -112,6 +112,36 @@ | ||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | +void PEFileDetails::PEFunctionRegistryARM64::SerializeDataDirectory( PEFile::PESection *targetSect, std::uint64_t peImageBase ) | |
116 | +{ | |
117 | + const auto& exceptRFs = this->entries; | |
118 | + | |
119 | + std::uint32_t numExceptEntries = (std::uint32_t)exceptRFs.GetCount(); | |
120 | + | |
121 | + const std::uint32_t exceptTableSize = ( sizeof(PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64) * numExceptEntries ); | |
122 | + | |
123 | + if ( numExceptEntries != 0 ) | |
124 | + { | |
125 | + PEFile::PESectionAllocation exceptTableAlloc; | |
126 | + targetSect->Allocate( exceptTableAlloc, exceptTableSize, sizeof(std::uint32_t) ); | |
127 | + | |
128 | + for ( std::uint32_t n = 0; n < numExceptEntries; n++ ) | |
129 | + { | |
130 | + const PEFileDetails::PERuntimeFunctionARM64& rfEntry = entries[ n ]; | |
131 | + | |
132 | + PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64 info; | |
133 | + info.BeginAddress = rfEntry.BeginAddress.GetRVA(); | |
134 | + info.UnwindData = rfEntry.UnwindData; | |
135 | + | |
136 | + const std::uint32_t rfEntryOff = ( n * sizeof(PEStructures::IMAGE_RUNTIME_FUNCTION_ENTRY_ARM64) ); | |
137 | + | |
138 | + exceptTableAlloc.WriteToSection( &info, sizeof(info), rfEntryOff ); | |
139 | + } | |
140 | + | |
141 | + this->allocEntry = std::move( exceptTableAlloc ); | |
142 | + } | |
143 | +} | |
144 | + | |
115 | 145 | // The centralized deserializer implementation. |
116 | 146 | struct PEFunctionRegistryDataDirectoryParser : public PEFile::PEDataDirectoryParser |
117 | 147 | { |