Initial
This commit is contained in:
23
image/SCTNHDRS.CPP
Normal file
23
image/SCTNHDRS.CPP
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <image/sctnhdrs.hpp>
|
||||
|
||||
WORD ImageSectionHeaders::enclosingSectionHeader(DWORD virtualAddress,ImageSectionHeader &someImageSectionHeader,DWORD &deltaOffset)
|
||||
{
|
||||
DWORD sectionCount(((Array<ImageSectionHeader>&)*this).size());
|
||||
|
||||
deltaOffset=0;
|
||||
for(short sectionIndex=0;sectionIndex<sectionCount;sectionIndex++)
|
||||
{
|
||||
ImageSectionHeader &imageSectionHeader=((Array<ImageSectionHeader>&)*this)[sectionIndex];
|
||||
if(virtualAddress>=imageSectionHeader.virtualAddress()&&
|
||||
virtualAddress<imageSectionHeader.virtualAddress()+imageSectionHeader.virtualSize())
|
||||
{
|
||||
someImageSectionHeader=imageSectionHeader;
|
||||
if(!isMemImage())deltaOffset=imageSectionHeader.virtualAddress()-imageSectionHeader.pointerRawData();
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user