Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NtLockVirtualMemory fix #5

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion SKLib/include/Setup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ namespace setup {
ULONG64 PsQueryFullProcessImageName = parser.GetSymbolRVA(L"PsQueryFullProcessImageName");
ULONG64 KiNmiInterruptStart = parser.GetSymbolRVA(L"KiNmiInterruptStart");
ULONG64 WmipSMBiosVersionInfo = parser.GetSymbolRVA(L"WmipSMBiosVersionInfo");
ULONG64 NtLockVirtualMemory = parser.GetSymbolRVA(L"NtLockVirtualMemory"e);
if (WmipSMBiosTableLength == INVALID_OFFSET
|| PsEnumProcesses == INVALID_OFFSET
|| PspInsertProcess == INVALID_OFFSET
Expand All @@ -109,6 +110,7 @@ namespace setup {
|| PsQueryFullProcessImageName == INVALID_OFFSET
|| KiNmiInterruptStart == INVALID_OFFSET
|| WmipSMBiosVersionInfo == INVALID_OFFSET
|| NtLockVirtualMemory == INVALID_OFFSET
) {
printf("[-] ntoskrnl offsets invalid!\n");
#ifdef BUILD_SPOOFER
Expand Down Expand Up @@ -139,6 +141,7 @@ namespace setup {
offsets.PsQueryFullProcessImageName = PsQueryFullProcessImageName;
offsets.KiNmiInterruptStart = KiNmiInterruptStart;
offsets.WmipSMBiosVersionInfo = WmipSMBiosVersionInfo;
offsets.NtLockVirtualMemory = NtLockVirtualMemory;
}
#pragma endregion

Expand Down Expand Up @@ -223,4 +226,4 @@ namespace setup {
}
}

#endif
#endif
3 changes: 2 additions & 1 deletion SKLib/include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct OffsetDump {
ULONG64 PiDDBLock;
ULONG64 PiDDBCacheTable;
ULONG64 KiNmiInterruptStart;
ULONG64 NtLockVirtualMemory;
};

typedef struct _CLEANUP_DATA {
Expand Down Expand Up @@ -151,4 +152,4 @@ namespace SKLib {
void Dispose();
}

#endif
#endif
8 changes: 5 additions & 3 deletions SKLib/src/winternlex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,12 @@ void winternl::InitImageInfo(PVOID pImageBase)
DbgMsg("[HOOK] Could not find PsGetThreadTeb");
DebugBreak();
}
else {
DbgMsg("[HOOK] ZwLockVirtualMemory: %p", winternl::NtLockVirtualMemory);

winternl::NtLockVirtualMemory = (fnNtLockVirtualMemory)((ULONG64)winternl::ntoskrnlBase + offsets.NtLockVirtualMemory);
if (!offsets.NtLockVirtualMemory) {
DbgMsg2("[WINTERNL] Failed getting NtLockVirtualMemory!");
DebugBreak();
}

winternl::PsEnumProcesses = (fnPsEnumProcesses)((ULONG64)winternl::ntoskrnlBase + offsets.PsEnumProcesses);
if (!offsets.PsEnumProcesses) {
DbgMsg("[WINTERNL] Failed getting PsEnumProcesses!");
Expand Down