8000 Very minor changes. · coderforlife/pe-file@2930c14 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2930c14

Browse files
committed
Very minor changes.
1 parent 098df35 commit 2930c14

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

PEDataTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ namespace PE {
547547
uint32_t PointerToLinenumbers;
548548
uint16_t NumberOfRelocations;
549549
uint16_t NumberOfLinenumbers;
550-
uint32_t Characteristics;
550+
CharacteristicFlags Characteristics;
551551
};
552552

553553
//

PEFile.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@ void* File::GetResourceDirect(void* _data, const_resid type, const_resid name) {
108108
const DOSHeader *dosh = (DOSHeader*)data;
109109
if (dosh->e_magic != DOSHeader::SIGNATURE) { return NULL; }
110110
int32_t peOffset = dosh->e_lfanew;
111-
const NTHeaders32 *nth32 = (NTHeaders32*)(data+peOffset);
112-
//const NTHeaders64 *nth64 = (NTHeaders64*)(data+peOffset);
113-
const FileHeader* header = &nth32->FileHeader; // identical for 32 and 64 bits
114-
const OptionalHeader* opt = &nth32->OptionalHeader;
115-
if (nth32->Signature != NTHeaders::SIGNATURE) { return NULL; }
111+
const NTHeaders32 *nth = (NTHeaders*)(data+peOffset);
112+
if (nth->Signature != NTHeaders::SIGNATURE) { return NULL; }
113+
const FileHeader* header = &nth->FileHeader; // identical for 32 and 64 bits
114+
const OptionalHeader* opt = &nth->OptionalHeader;
116115
bool is64bit = !(header->Characteristics & FileHeader::MACHINE_32BIT);
117116
if ((is64bit && opt->Magic != OptionalHeader64::SIGNATURE) || (!is64bit && opt->Magic != OptionalHeader32::SIGNATURE)) { return NULL; }
118117

0 commit comments

Comments
 (0)
0