• R/O
  • SSH
  • HTTPS

peframework: Commit


Commit MetaInfo

Revision35 (tree)
Time2019-11-11 01:29:34
Authorquiret

Log Message

- cleanup because I forgot some refactoring in last commit

Change Summary

Incremental Difference

--- library/include/peloader.freg.arm64.h (revision 34)
+++ library/include/peloader.freg.arm64.h (revision 35)
@@ -33,36 +33,8 @@
3333 inline PEFunctionRegistryARM64( const PEFunctionRegistryARM64& ) = delete;
3434 inline PEFunctionRegistryARM64( PEFunctionRegistryARM64&& ) = default;
3535
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;
3937
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-
6638 peVector <PEFileDetails::PERuntimeFunctionARM64> entries;
6739 };
6840
--- library/src/peloader.freg.cpp (revision 34)
+++ library/src/peloader.freg.cpp (revision 35)
@@ -112,6 +112,36 @@
112112 }
113113 }
114114
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+
115145 // The centralized deserializer implementation.
116146 struct PEFunctionRegistryDataDirectoryParser : public PEFile::PEDataDirectoryParser
117147 {
Show on old repository browser