• R/O
  • SSH
  • HTTPS

peframework: Commit


Commit MetaInfo

Revision5 (tree)
Time2017-04-15 19:18:57
Authorquiret

Log Message

- added support for iterating through sections in constant PEFile

Change Summary

Incremental Difference

--- src/peloader.cpp (revision 4)
+++ src/peloader.cpp (revision 5)
@@ -1059,6 +1059,17 @@
10591059 LIST_FOREACH_END
10601060 }
10611061
1062+void PEFile::ForAllSections( std::function <void ( const PESection* )> cb ) const
1063+{
1064+ LIST_FOREACH_BEGIN( PESection, this->sections.sectionList.root, sectionNode )
1065+
1066+ const PESection *constSect = item;
1067+
1068+ cb( constSect );
1069+
1070+ LIST_FOREACH_END
1071+}
1072+
10621073 bool PEFile::HasRelocationInfo( void ) const
10631074 {
10641075 // Check any sections.
--- include/peloader.h (revision 4)
+++ include/peloader.h (revision 5)
@@ -1353,6 +1353,7 @@
13531353 bool FindSectionSpace( std::uint32_t spanSize, std::uint32_t& addrOut );
13541354
13551355 void ForAllSections( std::function <void ( PESection* )> cb );
1356+ void ForAllSections( std::function <void ( const PESection* )> cb ) const;
13561357
13571358 // More advanced helpers.
13581359 PESectionDataReference ResolveRVAToRef( std::uint32_t rva ) { return this->sections.ResolveRVAToRef( rva ); }
Show on old repository browser