mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
12d07d8885
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2734 21ef857c-d57f-4fe0-8362-d861dc6d29cd
112 lines
4.8 KiB
C
112 lines
4.8 KiB
C
/*
|
|
* Process Hacker -
|
|
* function import module
|
|
*
|
|
* Copyright (C) 2009-2010 wj32
|
|
*
|
|
* This file is part of Process Hacker.
|
|
*
|
|
* Process Hacker is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Process Hacker is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#define NTIMPORT_PRIVATE
|
|
#include <ntimport.h>
|
|
#include <ph.h>
|
|
|
|
#define GetProc(DllName, ProcName) GetProcAddress(GetModuleHandle(L##DllName), (ProcName))
|
|
#define InitProc(DllName, ProcName) ((ProcName) = (_##ProcName)GetProc(DllName, #ProcName))
|
|
#define InitProcReq(DllName, ProcName) \
|
|
if (!InitProc(DllName, ProcName)) \
|
|
{ \
|
|
PhShowError( \
|
|
NULL, \
|
|
L"Process Hacker cannot run on your operating system. Unable to find %S in %S.", \
|
|
#ProcName, \
|
|
DllName \
|
|
); \
|
|
return FALSE; \
|
|
}
|
|
|
|
BOOLEAN PhInitializeImports()
|
|
{
|
|
InitProcReq("ntdll.dll", NtAlertResumeThread);
|
|
InitProcReq("ntdll.dll", NtAlertThread);
|
|
InitProcReq("ntdll.dll", NtAllocateVirtualMemory);
|
|
InitProcReq("ntdll.dll", NtClose);
|
|
InitProcReq("ntdll.dll", NtCreateDebugObject);
|
|
InitProcReq("ntdll.dll", NtCreateDirectoryObject);
|
|
InitProcReq("ntdll.dll", NtCreateFile);
|
|
InitProcReq("ntdll.dll", NtDebugActiveProcess);
|
|
InitProcReq("ntdll.dll", NtDeleteFile);
|
|
InitProcReq("ntdll.dll", NtDeviceIoControlFile);
|
|
InitProcReq("ntdll.dll", NtDuplicateObject);
|
|
InitProcReq("ntdll.dll", NtFreeVirtualMemory);
|
|
InitProcReq("ntdll.dll", NtFsControlFile);
|
|
InitProcReq("ntdll.dll", NtGetContextThread);
|
|
InitProc("ntdll.dll", NtGetNextProcess);
|
|
InitProc("ntdll.dll", NtGetNextThread);
|
|
InitProcReq("ntdll.dll", NtLoadDriver);
|
|
InitProcReq("ntdll.dll", NtOpenDirectoryObject);
|
|
InitProcReq("ntdll.dll", NtOpenFile);
|
|
InitProcReq("ntdll.dll", NtOpenProcess);
|
|
InitProcReq("ntdll.dll", NtOpenProcessToken);
|
|
InitProcReq("ntdll.dll", NtOpenThread);
|
|
InitProcReq("ntdll.dll", NtProtectVirtualMemory);
|
|
InitProcReq("ntdll.dll", NtQueryDirectoryObject);
|
|
InitProc("ntdll.dll", NtQueryInformationEnlistment);
|
|
InitProcReq("ntdll.dll", NtQueryInformationProcess);
|
|
InitProc("ntdll.dll", NtQueryInformationResourceManager);
|
|
InitProcReq("ntdll.dll", NtQueryInformationThread);
|
|
InitProcReq("ntdll.dll", NtQueryInformationToken);
|
|
InitProc("ntdll.dll", NtQueryInformationTransaction);
|
|
InitProc("ntdll.dll", NtQueryInformationTransactionManager);
|
|
InitProcReq("ntdll.dll", NtQueryObject);
|
|
InitProcReq("ntdll.dll", NtQuerySection);
|
|
InitProcReq("ntdll.dll", NtQuerySecurityObject);
|
|
InitProcReq("ntdll.dll", NtQuerySystemInformation);
|
|
InitProcReq("ntdll.dll", NtQueryVirtualMemory);
|
|
InitProcReq("ntdll.dll", NtQueueApcThread);
|
|
InitProcReq("ntdll.dll", NtReadFile);
|
|
InitProcReq("ntdll.dll", NtReadVirtualMemory);
|
|
InitProcReq("ntdll.dll", NtRemoveProcessDebug);
|
|
InitProcReq("ntdll.dll", NtResumeProcess);
|
|
InitProcReq("ntdll.dll", NtResumeThread);
|
|
InitProcReq("ntdll.dll", NtSetContextThread);
|
|
InitProcReq("ntdll.dll", NtSetInformationDebugObject);
|
|
InitProcReq("ntdll.dll", NtSetInformationProcess);
|
|
InitProcReq("ntdll.dll", NtSetInformationThread);
|
|
InitProcReq("ntdll.dll", NtSetInformationToken);
|
|
InitProcReq("ntdll.dll", NtSetSecurityObject);
|
|
InitProcReq("ntdll.dll", NtSuspendProcess);
|
|
InitProcReq("ntdll.dll", NtSuspendThread);
|
|
InitProcReq("ntdll.dll", NtTerminateProcess);
|
|
InitProcReq("ntdll.dll", NtTerminateThread);
|
|
InitProcReq("ntdll.dll", NtUnloadDriver);
|
|
InitProcReq("ntdll.dll", NtWaitForSingleObject);
|
|
InitProcReq("ntdll.dll", NtWriteFile);
|
|
InitProcReq("ntdll.dll", NtWriteVirtualMemory);
|
|
InitProcReq("ntdll.dll", RtlCreateQueryDebugBuffer);
|
|
InitProcReq("ntdll.dll", RtlCreateUserThread);
|
|
InitProcReq("ntdll.dll", RtlDestroyQueryDebugBuffer);
|
|
InitProcReq("ntdll.dll", RtlFindMessage);
|
|
InitProcReq("ntdll.dll", RtlMultiByteToUnicodeN);
|
|
InitProcReq("ntdll.dll", RtlMultiByteToUnicodeSize);
|
|
InitProcReq("ntdll.dll", RtlNtStatusToDosError);
|
|
InitProcReq("ntdll.dll", RtlQueryProcessDebugInformation);
|
|
InitProcReq("ntdll.dll", RtlUnicodeToMultiByteN);
|
|
InitProcReq("ntdll.dll", RtlUnicodeToMultiByteSize);
|
|
|
|
return TRUE;
|
|
}
|