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

Function RemoveImageNotify

KernelLibrary/SysMon.cpp:706–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704
705
706void RemoveImageNotify(_In_ PVOID context) {
707 NTSTATUS status = PsRemoveLoadImageNotifyRoutine(OnImageLoadNotify);
708 if (!NT_SUCCESS(status)) {
709 LogError("failed to remove image load callbacks (status=%08X)\n", status);
710 }
711 // free the buckup dir memory
712 ExFreePool(g_BackupDir.Buffer);
713
714 // free remaining items
715 while (!IsListEmpty(&g_SysMonGlobals.ItemHead)) {
716 auto entry = RemoveHeadList(&g_SysMonGlobals.ItemHead);
717 ExFreePool(CONTAINING_RECORD(entry, FullItem<ItemHeader>, Entry));
718 }
719 status = g_sec.FreeSection();
720 if (!NT_SUCCESS(status)) {
721 LogDebug("free section failed 0x%x\n", status);
722 }
723#ifdef _WIN64
724 status = g_secWow.FreeSection();
725 if (!NT_SUCCESS(status)) {
726 LogDebug("free wow section failed 0x%x\n", status);
727 }
728#endif //
729
730 PsTerminateSystemThread(status);
731}
732
733void RemoveFilter(_In_ PVOID context) {
734 NTSTATUS status = STATUS_SUCCESS;

Callers

nothing calls this directly

Calls 4

LogErrorFunction · 0.85
IsListEmptyFunction · 0.85
LogDebugFunction · 0.85
FreeSectionMethod · 0.80

Tested by

no test coverage detected