static Kernel32() { var lib = DynamicImport.ImportLibrary("kernel32.dll"); _createRemoteThreadEx = DynamicImport.ImportMethod(lib, "CreateRemoteThreadEx"); _openProcess = DynamicImport.ImportMethod(lib, "OpenProcess"); _waitForSingleObject = DynamicImport.ImportMethod(lib, "WaitForSingleObject"); }
static NtDll() { var lib = DynamicImport.ImportLibrary("ntdll.dll"); _ntAllocateVirtualMemory = DynamicImport.ImportMethod(lib, "NtAllocateVirtualMemory"); _ntClose = DynamicImport.ImportMethod(lib, "NtClose"); _ntFreeVirtualMemory = DynamicImport.ImportMethod(lib, "NtFreeVirtualMemory"); _ntOpenProcess = DynamicImport.ImportMethod(lib, "NtOpenProcess"); _ntProtectVirtualMemory = DynamicImport.ImportMethod(lib, "NtProtectVirtualMemory"); _ntReadVirtualMemory = DynamicImport.ImportMethod(lib, "NtReadVirtualMemory"); _ntWriteVirtualMemory = DynamicImport.ImportMethod(lib, "NtWriteVirtualMemory"); _rtlNtStatusToDosError = DynamicImport.ImportMethod(lib, "RtlNtStatusToDosError"); }