File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed
Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,13 @@ VOID __cdecl BootMain(IN PCCH CmdLine)
6464 /* Initialize I/O subsystem */
6565 FsInit ();
6666
67+ /* Initialize the module list */
68+ if (!PeLdrInitializeModuleList ())
69+ {
70+ UiMessageBoxCritical ("Unable to initialize module list." );
71+ goto Quit ;
72+ }
73+
6774 RunLoader ();
6875
6976Quit :
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ typedef VOID
2626
2727extern PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback ;
2828
29+ BOOLEAN
30+ PeLdrInitializeModuleList (VOID );
31+
2932BOOLEAN
3033PeLdrLoadImage (
3134 _In_ PCSTR FilePath ,
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ DBG_DEFAULT_CHANNEL(PELOADER);
2525
2626/* GLOBALS *******************************************************************/
2727
28+ LIST_ENTRY FrLdrModuleList ;
29+
2830PELDR_IMPORTDLL_LOAD_CALLBACK PeLdrImportDllLoadCallback = NULL ;
2931
3032#ifdef _WIN64
@@ -518,6 +520,29 @@ PeLdrpScanImportAddressTable(
518520
519521/* FUNCTIONS *****************************************************************/
520522
523+ BOOLEAN
524+ PeLdrInitializeModuleList (VOID )
525+ {
526+ PLDR_DATA_TABLE_ENTRY FreeldrDTE ;
527+
528+ InitializeListHead (& FrLdrModuleList );
529+
530+ /* Allocate a data table entry for freeldr.sys.
531+ The base name is scsiport.sys for imports from ntbootdd.sys */
532+ if (!PeLdrAllocateDataTableEntry (& FrLdrModuleList ,
533+ "scsiport.sys" ,
534+ "freeldr.sys" ,
535+ & __ImageBase ,
536+ & FreeldrDTE ))
537+ {
538+ /* Cleanup and bail out */
539+ ERR ("Failed to allocate DTE for freeldr\n" );
540+ return FALSE;
541+ }
542+
543+ return TRUE;
544+ }
545+
521546PVOID
522547PeLdrInitSecurityCookie (PLDR_DATA_TABLE_ENTRY LdrEntry )
523548{
You can’t perform that action at this time.
0 commit comments