memmod: fix protected delayed load the right way
The reason this was failing before is that dloadsup.h's DloadObtainSection was doing a linear search of sections to find which header corresponds with the IMAGE_DELAYLOAD_DESCRIPTOR section, and we were stupidly overwriting the VirtualSize field, so the linear search wound up matching the .text section, which then it found to not be marked writable and failed with FAST_FAIL_DLOAD_PROTECTION_FAILURE. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -332,6 +332,17 @@ func (imgimpdesc *IMAGE_IMPORT_DESCRIPTOR) OriginalFirstThunk() uint32 {
|
||||
return imgimpdesc.characteristicsOrOriginalFirstThunk
|
||||
}
|
||||
|
||||
type IMAGE_DELAYLOAD_DESCRIPTOR struct {
|
||||
Attributes uint32
|
||||
DllNameRVA uint32
|
||||
ModuleHandleRVA uint32
|
||||
ImportAddressTableRVA uint32
|
||||
ImportNameTableRVA uint32
|
||||
BoundImportAddressTableRVA uint32
|
||||
UnloadInformationTableRVA uint32
|
||||
TimeDateStamp uint32
|
||||
}
|
||||
|
||||
type IMAGE_LOAD_CONFIG_CODE_INTEGRITY struct {
|
||||
Flags uint16
|
||||
Catalog uint16
|
||||
|
||||
Reference in New Issue
Block a user