#include <internal/i386/segment.h>
#include <ntdll/ldr.h>
#include <internal/teb.h>
+#include <ntdll/base.h>
//#define NDEBUG
#include <kernel32/kernel32.h>
PVOID BaseAddress;
ULONG BytesWritten;
HANDLE DupNTDllSectionHandle, DupSectionHandle;
-
-
+
ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
ObjectAttributes.RootDirectory = NULL;
ObjectAttributes.ObjectName = NULL;
return(hSection);
}
-#define NTDLL_BASE (0x80000000)
-
static NTSTATUS CreatePeb(HANDLE ProcessHandle, PWSTR CommandLine)
{
NTSTATUS Status;
ULONG StartupInfoSize;
PROCESSINFOW StartupInfo;
- PebBase = PEB_BASE;
+ PebBase = (PVOID)PEB_BASE;
PebSize = 0x1000;
Status = ZwAllocateVirtualMemory(ProcessHandle,
&PebBase,
memset(&Peb, 0, sizeof(Peb));
- Peb.StartupInfo = PEB_STARTUPINFO;
+ Peb.StartupInfo = (PPROCESSINFOW)PEB_STARTUPINFO;
ZwWriteVirtualMemory(ProcessHandle,
(PVOID)PEB_BASE,
sizeof(Peb),
&BytesWritten);
- StartupInfoBase = PEB_STARTUPINFO;
+ StartupInfoBase = (PVOID)PEB_STARTUPINFO;
StartupInfoSize = 0x1000;
Status = ZwAllocateVirtualMemory(ProcessHandle,
&StartupInfoBase,
hSection = KERNEL32_MapFile(lpApplicationName,
lpCommandLine,
- &Headers, &DosHeader);
+ &Headers,
+ &DosHeader);
Status = NtCreateProcess(&hProcess,
PROCESS_ALL_ACCESS,