retdec
pe_template_aux.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_FILEFORMAT_FILE_FORMAT_PE_PE_TEMPLATE_AUX_H
8 #define RETDEC_FILEFORMAT_FILE_FORMAT_PE_PE_TEMPLATE_AUX_H
9 
10 #include "retdec/pelib/PeLib.h"
11 
12 namespace retdec {
13 namespace fileformat {
14 
22 template<int bits> bool peSectionName(const PeLib::PeHeaderT<bits> &peHeader, std::string &name, unsigned long long sectionIndex)
23 {
24  if(sectionIndex >= peHeader.getNumberOfSections())
25  {
26  return false;
27  }
28 
29  name = peHeader.getSectionNameFromStringTable(sectionIndex);
30  if(name.empty())
31  {
32  name = peHeader.getSectionName(sectionIndex);
33  }
34 
35  return true;
36 }
37 
38 } // namespace fileformat
39 } // namespace retdec
40 
41 #endif
bool peSectionName(const PeLib::PeHeaderT< bits > &peHeader, std::string &name, unsigned long long sectionIndex)
Definition: pe_template_aux.h:22
Definition: archive_wrapper.h:19