Merge pull request #51 from Mattiwatti/getpe32dataw_impl

Implement missing cases in GetPE32DataW_impl
This commit is contained in:
Duncan Ogilvie 2020-09-23 23:49:32 +02:00 committed by GitHub
commit 958039802f
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -548,7 +548,7 @@ public:
case UE_SECTIONNAME: case UE_SECTIONNAME:
return WhichSection < sections.size() ? ULONG_PTR(&sections.at(WhichSection).GetHeader().Name[0]) : 0; return WhichSection < sections.size() ? ULONG_PTR(&sections.at(WhichSection).GetHeader().Name[0]) : 0;
case UE_IMAGEBASE: case UE_IMAGEBASE:
return headers->OptionalHeader.ImageBase; return (ULONG_PTR)headers->OptionalHeader.ImageBase;
case UE_SIZEOFIMAGE: case UE_SIZEOFIMAGE:
return headers->OptionalHeader.SizeOfImage; return headers->OptionalHeader.SizeOfImage;
case UE_RELOCATIONTABLEADDRESS: case UE_RELOCATIONTABLEADDRESS:
@ -559,6 +559,14 @@ public:
return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress; return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress;
case UE_TLSTABLESIZE: case UE_TLSTABLESIZE:
return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size; return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size;
case UE_TIMEDATESTAMP:
return headers->FileHeader.TimeDateStamp;
case UE_CHECKSUM:
return headers->OptionalHeader.CheckSum;
case UE_SUBSYSTEM:
return headers->OptionalHeader.Subsystem;
case UE_NUMBEROFRVAANDSIZES:
return headers->OptionalHeader.NumberOfRvaAndSizes;
default: default:
__debugbreak(); __debugbreak();
} }

View File

@ -612,7 +612,7 @@ public:
case UE_SECTIONNAME: case UE_SECTIONNAME:
return WhichSection < sections.size() ? ULONG_PTR(&sections.at(WhichSection).GetHeader().Name[0]) : 0; return WhichSection < sections.size() ? ULONG_PTR(&sections.at(WhichSection).GetHeader().Name[0]) : 0;
case UE_IMAGEBASE: case UE_IMAGEBASE:
return headers->OptionalHeader.ImageBase; return (ULONG_PTR)headers->OptionalHeader.ImageBase;
case UE_SIZEOFIMAGE: case UE_SIZEOFIMAGE:
return headers->OptionalHeader.SizeOfImage; return headers->OptionalHeader.SizeOfImage;
case UE_RELOCATIONTABLEADDRESS: case UE_RELOCATIONTABLEADDRESS:
@ -623,6 +623,14 @@ public:
return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress; return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress;
case UE_TLSTABLESIZE: case UE_TLSTABLESIZE:
return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size; return headers->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size;
case UE_TIMEDATESTAMP:
return headers->FileHeader.TimeDateStamp;
case UE_CHECKSUM:
return headers->OptionalHeader.CheckSum;
case UE_SUBSYSTEM:
return headers->OptionalHeader.Subsystem;
case UE_NUMBEROFRVAANDSIZES:
return headers->OptionalHeader.NumberOfRvaAndSizes;
default: default:
__debugbreak(); __debugbreak();
} }