ReactOS 0.4.16-dev-91-g764881a
|
#include "ntndk.h"
#include "shimlib.h"
#include <strsafe.h>
#include "apphelp.h"
#include "shimeng.h"
Go to the source code of this file.
Macros | |
#define | WIN32_NO_STATUS |
#define | IN_APPHELP |
#define | APPHELP_NOSDBPAPI |
#define | ARRAY_Init(Array, TypeOfArray) ARRAY_InitWorker((Array), sizeof(TypeOfArray)) |
#define | ARRAY_Append(Array, TypeOfArray) (TypeOfArray*)ARRAY_AppendWorker((Array), sizeof(TypeOfArray), 5) |
#define | ARRAY_At(Array, TypeOfArray, at) (TypeOfArray*)ARRAY_AtWorker((Array), sizeof(TypeOfArray), at) |
#define | ARRAY_Size(Array) (Array)->Size__ |
#define | MAX_LAYER_LENGTH 256 |
#define | SYSTEM32 L"\\system32" |
#define | WINSXS L"\\winsxs" |
Typedefs | |
typedef FARPROC(WINAPI * | GETPROCADDRESSPROC) (HINSTANCE, LPCSTR) |
Variables | |
static const UNICODE_STRING | Ntdll = RTL_CONSTANT_STRING(L"ntdll.dll") |
static const UNICODE_STRING | Kernel32 = RTL_CONSTANT_STRING(L"kernel32.dll") |
static const UNICODE_STRING | Verifier = RTL_CONSTANT_STRING(L"verifier.dll") |
HMODULE | g_hInstance |
static UNICODE_STRING | g_WindowsDirectory |
static UNICODE_STRING | g_System32Directory |
static UNICODE_STRING | g_SxsDirectory |
static UNICODE_STRING | g_LoadingShimDll |
ULONG | g_ShimEngDebugLevel = 0xffffffff |
BOOL | g_bComPlusImage = FALSE |
BOOL | g_bShimDuringInit = FALSE |
BOOL | g_bShimEngInitialized = FALSE |
BOOL | g_bInternalHooksUsed = FALSE |
static ARRAY | g_pShimInfo |
static ARRAY | g_pHookArray |
static ARRAY | g_InExclude |
HOOKAPIEX | g_IntHookEx [] |
#define ARRAY_Append | ( | Array, | |
TypeOfArray | |||
) | (TypeOfArray*)ARRAY_AppendWorker((Array), sizeof(TypeOfArray), 5) |
#define ARRAY_At | ( | Array, | |
TypeOfArray, | |||
at | |||
) | (TypeOfArray*)ARRAY_AtWorker((Array), sizeof(TypeOfArray), at) |
#define ARRAY_Init | ( | Array, | |
TypeOfArray | |||
) | ARRAY_InitWorker((Array), sizeof(TypeOfArray)) |
#define SYSTEM32 L"\\system32" |
#define WINSXS L"\\winsxs" |
Definition at line 95 of file shimeng.c.
Definition at line 64 of file shimeng.c.
Referenced by ARRAY_AppendWorker().
Definition at line 1650 of file ldrapi.c.
Referenced by SE_DynamicShim().
Definition at line 255 of file shimeng.c.
Referenced by SE_DllLoaded(), SE_DllUnloaded(), SE_InstallAfterInit(), SE_ProcessDying(), and SeiCreateShimModuleInfo().
Definition at line 1065 of file shimeng.c.
Referenced by SeiInit().
VOID WINAPI SE_DllLoaded | ( | PLDR_DATA_TABLE_ENTRY | LdrEntry | ) |
Definition at line 1447 of file shimeng.c.
Referenced by LdrpGetShimEngineInterface(), and LdrpLoadDll().
VOID WINAPI SE_DllUnloaded | ( | PLDR_DATA_TABLE_ENTRY | LdrEntry | ) |
Definition at line 1465 of file shimeng.c.
Referenced by LdrpGetShimEngineInterface(), and LdrUnloadDll().
BOOL WINAPI SE_DynamicShim | ( | LPCWSTR | ProcessImage, |
HSDB | hsdb, | ||
PVOID | pQueryResult, | ||
LPCSTR | Module, | ||
LPDWORD | lpdwDynamicToken | ||
) |
Definition at line 1487 of file shimeng.c.
VOID NTAPI SE_InstallAfterInit | ( | PUNICODE_STRING | ProcessImage, |
PVOID | pShimData | ||
) |
Definition at line 1436 of file shimeng.c.
Referenced by LdrpGetShimEngineInterface(), and LdrpInitializeProcess().
VOID NTAPI SE_InstallBeforeInit | ( | PUNICODE_STRING | ProcessImage, |
PVOID | pShimData | ||
) |
Definition at line 1417 of file shimeng.c.
Referenced by LdrpGetShimEngineInterface(), and LdrpLoadShimEngine().
Definition at line 1474 of file shimeng.c.
Referenced by SeiHookImports(), SeiResetEntryProcessed(), SeiSetEntryProcessed(), and StubGetProcAddress().
Definition at line 1441 of file shimeng.c.
Referenced by LdrpGetShimEngineInterface(), and LdrShutdownProcess().
Definition at line 439 of file shimeng.c.
Referenced by SeiBuildShimRefArray().
VOID SeiAddHooks | ( | PHOOKAPIEX | hooks, |
DWORD | dwHookCount, | ||
PSHIMINFO | pShim | ||
) |
Definition at line 556 of file shimeng.c.
Referenced by SeiAddInternalHooks(), and SeiCombineHookInfo().
Definition at line 751 of file shimeng.c.
Referenced by SeiInit().
Definition at line 428 of file shimeng.c.
Referenced by SeiBuildShimRefArray().
PSHIMINFO SeiAppendHookInfo | ( | PSHIMMODULE | pShimModuleInfo, |
PHOOKAPIEX | pHookApi, | ||
DWORD | dwHookCount, | ||
PCWSTR | ShimName | ||
) |
Definition at line 327 of file shimeng.c.
Referenced by SeiInit().
Definition at line 860 of file shimeng.c.
Referenced by SeiBuildInclExclList(), and SeiReadInExclude().
Definition at line 915 of file shimeng.c.
Referenced by SeiInit().
Definition at line 942 of file shimeng.c.
Referenced by SeiInit().
|
static |
Definition at line 474 of file shimeng.c.
Referenced by SeiInit().
Definition at line 271 of file shimeng.c.
Referenced by SeiInit().
Definition at line 727 of file shimeng.c.
Referenced by SeiInit().
Definition at line 228 of file shimeng.c.
Referenced by SeiAddHooks(), and StubGetProcAddress().
PSHIMMODULE SeiCreateShimModuleInfo | ( | PCWSTR | DllName, |
PVOID | BaseAddress | ||
) |
Definition at line 294 of file shimeng.c.
Referenced by SeiInit().
BOOL WINAPIV SeiDbgPrint | ( | SEI_LOG_LEVEL | Level, |
PCSTR | Function, | ||
PCSTR | Format, | ||
... | |||
) |
Outputs diagnostic info.
[in] | Level | The level to log this message with, choose any of [SHIM_ERR, SHIM_WARN, SHIM_INFO]. |
[in] | FunctionName | The function this log should be attributed to. |
[in] | Format | The format string. |
... | Variable arguments providing additional information. |
Definition at line 160 of file shimeng.c.
Referenced by SeiBuildShimRefArray(), and SeiInit().
PHOOKMODULEINFO SeiFindHookModuleInfo | ( | PUNICODE_STRING | ModuleName, |
PVOID | BaseAddress | ||
) |
Definition at line 352 of file shimeng.c.
Referenced by SE_DllLoaded(), SeiAddHooks(), SeiFindHookModuleInfoForImportDescriptor(), and StubGetProcAddress().
PHOOKMODULEINFO SeiFindHookModuleInfoForImportDescriptor | ( | PBYTE | DllBase, |
PIMAGE_IMPORT_DESCRIPTOR | ImportDescriptor | ||
) |
Definition at line 375 of file shimeng.c.
Referenced by SeiHookImports().
PINEXCLUDE SeiFindInExclude | ( | PARRAY | InExclude, |
PCUNICODE_STRING | DllName | ||
) |
Definition at line 797 of file shimeng.c.
Referenced by SeiAppendInExclude(), and SeiIsExcluded().
Definition at line 410 of file shimeng.c.
Referenced by SeiAddFlag(), and SeiInit().
Definition at line 246 of file shimeng.c.
Referenced by StubGetProcAddress().
Definition at line 419 of file shimeng.c.
Referenced by SeiAddFlag().
BOOL SeiGetShimData | ( | PUNICODE_STRING | ProcessImage, |
PVOID | pShimData, | ||
HSDB * | pHsdb, | ||
SDBQUERYRESULT * | pQuery | ||
) |
Definition at line 1367 of file shimeng.c.
Referenced by SE_InstallBeforeInit().
PSHIMMODULE SeiGetShimModuleInfo | ( | PVOID | BaseAddress | ) |
Definition at line 280 of file shimeng.c.
Referenced by SE_IsShimDll(), and SeiInit().
Definition at line 401 of file shimeng.c.
Referenced by SeiBuildShimRefArray(), and SeiInit().
VOID SeiHookImports | ( | PLDR_DATA_TABLE_ENTRY | LdrEntry | ) |
Definition at line 958 of file shimeng.c.
Referenced by PatchNewModules(), and SE_DllLoaded().
VOID SeiInit | ( | LPCWSTR | ProcessImage, |
HSDB | hsdb, | ||
SDBQUERYRESULT * | pQuery, | ||
BOOLEAN | ProcessInit | ||
) |
Definition at line 1185 of file shimeng.c.
Referenced by SE_DynamicShim(), and SE_InstallBeforeInit().
Definition at line 128 of file shimeng.c.
Referenced by SeiDbgPrint().
Definition at line 1083 of file shimeng.c.
Referenced by SeiInit().
BOOL SeiIsExcluded | ( | PLDR_DATA_TABLE_ENTRY | LdrEntry, |
PHOOKAPIEX | HookApi | ||
) |
Definition at line 812 of file shimeng.c.
Referenced by SeiHookImports().
Definition at line 213 of file shimeng.c.
Referenced by SeiCompareFunctionName(), SeiHookImports(), SeiPrintFunctionName(), and SeiResolveAPI().
VOID SeiPatchNewImport | ( | PIMAGE_THUNK_DATA | FirstThunk, |
PHOOKAPIEX | HookApi, | ||
PLDR_DATA_TABLE_ENTRY | LdrEntry | ||
) |
Definition at line 764 of file shimeng.c.
Referenced by SeiHookImports().
Definition at line 218 of file shimeng.c.
Referenced by SeiHookImports(), SeiIsExcluded(), SeiPatchNewImport(), SeiResolveAPI(), and StubGetProcAddress().
Definition at line 889 of file shimeng.c.
Referenced by SeiBuildGlobalInclExclList(), and SeiBuildInclExclList().
Definition at line 1156 of file shimeng.c.
Referenced by SeiInit().
VOID SeiResolveAPI | ( | PHOOKMODULEINFO | HookModuleInfo | ) |
Definition at line 665 of file shimeng.c.
Referenced by SE_DllLoaded(), and SeiResolveAPIs().
Definition at line 711 of file shimeng.c.
Referenced by SeiInit().
Definition at line 1105 of file shimeng.c.
Referenced by SeiInit().
Definition at line 456 of file shimeng.c.
Referenced by SeiBuildShimRefArray().
Definition at line 628 of file shimeng.c.
Definition at line 33 of file shimeng.c.
Referenced by SeiCheckComPlusImage().
Definition at line 36 of file shimeng.c.
Referenced by SeiAddInternalHooks().
Definition at line 34 of file shimeng.c.
Referenced by SE_DllLoaded(), SE_DynamicShim(), and SE_InstallBeforeInit().
Definition at line 35 of file shimeng.c.
Referenced by SE_DynamicShim(), and SeiInit().
|
extern |
Definition at line 18 of file MainWindow.cpp.
Referenced by SE_DynamicShim(), SeiHookImports(), and SeiResetEntryProcessed().
|
static |
Definition at line 39 of file shimeng.c.
Referenced by SeiBuildGlobalInclExclList(), SeiBuildInclExclList(), and SeiInit().
HOOKAPIEX g_IntHookEx[] |
Definition at line 43 of file shimeng.c.
Referenced by SeiAddInternalHooks(), and StubGetProcAddress().
|
static |
Definition at line 31 of file shimeng.c.
Referenced by SeiHookImports(), SeiInit(), and SeiSetEntryProcessed().
|
static |
Definition at line 38 of file shimeng.c.
Referenced by SeiAddHooks(), SeiFindHookModuleInfo(), SeiInit(), and SeiResolveAPIs().
|
static |
Definition at line 37 of file shimeng.c.
Referenced by NotifyShims(), SeiCombineHookInfo(), SeiCreateShimModuleInfo(), SeiGetShimModuleInfo(), and SeiInit().
ULONG g_ShimEngDebugLevel = 0xffffffff |
Definition at line 32 of file shimeng.c.
Referenced by SeiDbgPrint(), and SeiInitDebugSupport().
|
static |
Definition at line 30 of file shimeng.c.
Referenced by SeiInitPaths(), and SeiIsExcluded().
|
static |
Definition at line 29 of file shimeng.c.
Referenced by SeiInitPaths(), and SeiIsExcluded().
|
static |
Definition at line 28 of file shimeng.c.
Referenced by SeiInitPaths().
|
static |
Definition at line 24 of file shimeng.c.
Referenced by SeiResetEntryProcessed(), and SeiSetEntryProcessed().
|
static |
Definition at line 23 of file shimeng.c.
Referenced by SeiResetEntryProcessed(), and SeiSetEntryProcessed().
|
static |
Definition at line 25 of file shimeng.c.
Referenced by SeiResetEntryProcessed(), and SeiSetEntryProcessed().