This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

23
image/SCTNHDRS.CPP Normal file
View 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;
}