#include <internal/teb.h>
#include <internal/ldr.h>
-#define NDEBUG
+//#define NDEBUG
#include <internal/debug.h>
#include "syspath.h"
* map the dos header into the process
*/
DPRINT("Mapping view of section\n");
- InitialViewSize = sizeof(PIMAGE_DOS_HEADER);
+ InitialViewSize = sizeof(IMAGE_DOS_HEADER);
ImageBase = NULL;
Status = ZwMapViewOfSection(SectionHandle,
}
DPRINT("Mapping view of section\n");
+ ImageBase = NULL;
Status = ZwMapViewOfSection(SectionHandle,
ProcessHandle,
(PVOID*)&ImageBase,
return(Status);
}
+ DPRINT("ImageBase %x\n", ImageBase);
/*
* TBD
DPRINT("Attaching to process\n");
KeAttachProcess(Process);
NTHeaders = RtlImageNtHeader(ImageBase);
+ DPRINT("NTHeaders %x\n", NTHeaders);
InitialViewSize = ((PIMAGE_DOS_HEADER)ImageBase)->e_lfanew +
sizeof(IMAGE_NT_HEADERS) +
(sizeof (IMAGE_SECTION_HEADER) * NTHeaders->FileHeader.NumberOfSections);
DPRINT("InitialViewSize %x\n", InitialViewSize);
FinalBase = (PVOID)NTHeaders->OptionalHeader.ImageBase;
+ DPRINT("FinalBase %x\n", FinalBase);
NumberOfSections = NTHeaders->FileHeader.NumberOfSections;
+ DPRINT("NrSections %d\n", NumberOfSections);
KeDetachProcess();
DPRINT("Unmapping view of section\n");