This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree 7 files changed +7
-77
lines changed
tests/src/Loader/regressions/GitHub_15544
7 files changed +7
-77
lines changed Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ NativeImageDumper::DumpNativeImage()
720
720
721
721
for (COUNT_T i = 0 ; i < m_decoder.GetNumberOfSections (); i++)
722
722
{
723
- PTR_IMAGE_SECTION_HEADER section = m_decoder.FindFirstSection () + i ;
723
+ PTR_IMAGE_SECTION_HEADER section = dptr_add ( m_decoder.FindFirstSection (), i) ;
724
724
m_display->Section (reinterpret_cast <char *>(section->Name ),
725
725
section->VirtualAddress ,
726
726
section->SizeOfRawData );
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ class PEDecoder
182
182
UINT32 GetWin32VersionValue () const ;
183
183
COUNT_T GetNumberOfRvaAndSizes () const ;
184
184
COUNT_T GetNumberOfSections () const ;
185
- PTR_IMAGE_SECTION_HEADER FindFirstSection () const ;
185
+ IMAGE_SECTION_HEADER * FindFirstSection () const ;
186
186
IMAGE_SECTION_HEADER *FindSection (LPCSTR sectionName) const ;
187
187
188
188
DWORD GetImageIdentity () const ;
Original file line number Diff line number Diff line change @@ -1178,7 +1178,7 @@ inline DWORD PEDecoder::GetImageIdentity() const
1178
1178
}
1179
1179
1180
1180
1181
- inline PTR_IMAGE_SECTION_HEADER PEDecoder::FindFirstSection () const
1181
+ inline IMAGE_SECTION_HEADER * PEDecoder::FindFirstSection () const
1182
1182
{
1183
1183
CONTRACT (IMAGE_SECTION_HEADER *)
1184
1184
{
Original file line number Diff line number Diff line change @@ -445,7 +445,6 @@ BOOL PEDecoder::HasWriteableSections() const
445
445
CONTRACT_CHECK
446
446
{
447
447
INSTANCE_CHECK;
448
- PRECONDITION (CheckNTHeaders ());
449
448
PRECONDITION (CheckFormat ());
450
449
NOTHROW;
451
450
GC_NOTRIGGER;
@@ -454,7 +453,7 @@ BOOL PEDecoder::HasWriteableSections() const
454
453
}
455
454
CONTRACT_CHECK_END;
456
455
457
- PTR_IMAGE_SECTION_HEADER pSection = FindFirstSection ();
456
+ PTR_IMAGE_SECTION_HEADER pSection = FindFirstSection (FindNTHeaders () );
458
457
_ASSERTE (pSection != NULL );
459
458
460
459
PTR_IMAGE_SECTION_HEADER pSectionEnd = pSection + VAL16 (FindNTHeaders ()->FileHeader .NumberOfSections );
Original file line number Diff line number Diff line change @@ -1029,9 +1029,7 @@ PTR_PEImageLayout PEImage::CreateLayoutFlat(BOOL bPermitWriteableSections)
1029
1029
1030
1030
PTR_PEImageLayout pFlatLayout = PEImageLayout::LoadFlat (GetFileHandle (),this );
1031
1031
1032
- if (!bPermitWriteableSections
1033
- && pFlatLayout->CheckNTHeaders ()
1034
- && pFlatLayout->HasWriteableSections ())
1032
+ if (!bPermitWriteableSections && pFlatLayout->HasWriteableSections ())
1035
1033
{
1036
1034
pFlatLayout->Release ();
1037
1035
@@ -1116,7 +1114,8 @@ void PEImage::Load()
1116
1114
1117
1115
#ifdef PLATFORM_UNIX
1118
1116
if (m_pLayouts[IMAGE_FLAT] != NULL
1119
- && m_pLayouts[IMAGE_FLAT]->CheckILOnlyFormat ()
1117
+ && m_pLayouts[IMAGE_FLAT]->CheckFormat ()
1118
+ && m_pLayouts[IMAGE_FLAT]->IsILOnly ()
1120
1119
&& !m_pLayouts[IMAGE_FLAT]->HasWriteableSections ())
1121
1120
{
1122
1121
// IL-only images with writeable sections are mapped in general way,
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments