| 704 | |
| 705 | |
| 706 | void 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 | |
| 733 | void RemoveFilter(_In_ PVOID context) { |
| 734 | NTSTATUS status = STATUS_SUCCESS; |
nothing calls this directly
no test coverage detected