mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
- Jesus Christ... will Hell freeze over before someone finally listens and implements a proper PE loader in Freeloader?
svn path=/trunk/; revision=23793
This commit is contained in:
parent
ab77204ef9
commit
655e78f3cc
1 changed files with 13 additions and 0 deletions
|
@ -72,6 +72,8 @@ VOID INIT_FUNCTION _main(ULONG MultiBootMagic, PROS_LOADER_PARAMETER_BLOCK _Load
|
|||
#pragma alloc_text(INIT, _main)
|
||||
#endif
|
||||
|
||||
extern LDR_DATA_TABLE_ENTRY HalModuleObject;
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -240,6 +242,17 @@ _main(ULONG MultiBootMagic,
|
|||
(PVOID)KERNEL_BASE,
|
||||
&DriverSize);
|
||||
|
||||
//
|
||||
//
|
||||
// HACK HACK HACK WHEN WILL YOU PEOPLE FIX FREELDR?!?!?!
|
||||
// FREELDR SENDS US AN ***INVALID*** HAL PE HEADER!!!
|
||||
// WE READ IT IN LdrInitModuleManagement ABOVE!!!
|
||||
// WE SET .SizeOfImage TO A *GARBAGE* VALUE!!!
|
||||
//
|
||||
// This dirty hack fixes it, and should make symbol lookup work too.
|
||||
//
|
||||
HalModuleObject.SizeOfImage = RtlImageNtHeader((PVOID)HalModuleObject.DllBase)->OptionalHeader.SizeOfImage;
|
||||
|
||||
/* Increase the last kernel address with the size of HAL */
|
||||
LastKernelAddress += PAGE_ROUND_UP(DriverSize);
|
||||
|
||||
|
|
Loading…
Reference in a new issue