MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / KbGetKernelProcAddress

Function KbGetKernelProcAddress

User-Bridge/API/User-Bridge.cpp:1342–1362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1340namespace Stuff
1341{
1342 BOOL WINAPI KbGetKernelProcAddress(LPCWSTR RoutineName, WdkTypes::PVOID* KernelAddress)
1343 {
1344 if (!RoutineName || !KernelAddress) return FALSE;
1345 SIZE_T NameLength = 0;
1346 __try {
1347 NameLength = wcslen(RoutineName);
1348 } __except(EXCEPTION_EXECUTE_HANDLER) {
1349 return FALSE;
1350 }
1351 if (NameLength > 64) {
1352 SetLastError(ERROR_INVALID_NAME);
1353 return FALSE; // Very long name, seems like invalid data buffer
1354 }
1355 KB_GET_KERNEL_PROC_ADDRESS_IN Input = {};
1356 KB_GET_KERNEL_PROC_ADDRESS_OUT Output = {};
1357 Input.RoutineName = reinterpret_cast<WdkTypes::LPCWSTR>(RoutineName);
1358 Input.SizeOfBufferInBytes = static_cast<ULONG>(NameLength) * sizeof(WCHAR); // We're sure that Length <= 64
1359 BOOL Status = KbSendRequest(Ctls::KbGetKernelProcAddress, &Input, sizeof(Input), &Output, sizeof(Output));
1360 *KernelAddress = Output.Address;
1361 return Status;
1362 }
1363
1364 BOOL WINAPI KbStallExecutionProcessor(ULONG Microseconds)
1365 {

Callers 1

GetKernelProcAddressFunction · 0.70

Calls 1

KbSendRequestFunction · 0.85

Tested by

no test coverage detected