mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-27 04:44:31 +00:00
read in data directory table
This commit is contained in:
parent
1a3b1f2ccb
commit
f84bffdebe
@ -104,9 +104,19 @@ bool readOptionalHeader(bounded_buffer *b, optional_header_32 &header) {
|
||||
#undef READ_DWORD
|
||||
#undef READ_BYTE
|
||||
|
||||
::uint32_t maxEnt = header.NumberOfRvaAndSizes;
|
||||
for(::uint32_t i = 0; i < maxEnt; i++) {
|
||||
for(::uint32_t i = 0; i < header.NumberOfRvaAndSizes; i++) {
|
||||
::uint32_t c = (i*sizeof(data_directory));
|
||||
::uint32_t o;
|
||||
|
||||
o = c + _offset(data_directory, VirtualAddress);
|
||||
if(readDword(b, o, header.DataDirectory[i].VirtualAddress) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
o = c+ _offset(data_directory, Size);
|
||||
if(readDword(b, o, header.DataDirectory[i].Size) == false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user