MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / InjectDLL

Method InjectDLL

KernelLibrary/Section.cpp:384–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384NTSTATUS Section::InjectDLL(DllStats* pDllStats) {
385 NTSTATUS status = STATUS_SUCCESS;
386
387 if (!pDllStats->IsVaid()) {
388 // invalid data
389 ASSERT(NULL);
390 return STATUS_INVALID_PARAMETER_MIX;
391 }
392 // https://dennisbabkin.com/inside_nt_apc/
393 PKAPC pApc = (PKAPC)ExAllocatePoolWithTag(NonPagedPool, sizeof(KAPC), 'cpak');
394
395 if (!pApc) {
396 return STATUS_MEMORY_NOT_ALLOCATED;
397 }
398
399 /*KeInitializeApc(pApc, KeGetCurrentThread(),
400 OriginalApcEnvironment,
401 KernelRoutine, RundownRoutine, NormalRoutine,
402 KernelMode,
403 pApc, );*/
404
405 //Prevent our driver from unloading be incrementing its reference count
406 ObReferenceObject(g_DriverObject);
407
408 return status;
409}
410
411NTSTATUS Section::MapSectionForShellCode(DllStats* pDllStats,
412 PVOID* pBaseAddr) {

Callers

nothing calls this directly

Calls 1

IsVaidMethod · 0.80

Tested by

no test coverage detected