aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--KMemDriver/Memory.c1
-rw-r--r--MemDriverLib/MemDriverLib.cpp2
2 files changed, 1 insertions, 2 deletions
diff --git a/KMemDriver/Memory.c b/KMemDriver/Memory.c
index 7a571ea..d9c46e7 100644
--- a/KMemDriver/Memory.c
+++ b/KMemDriver/Memory.c
@@ -289,7 +289,6 @@ NTSTATUS AllocMemoryToProcess(IN PEPROCESS pep, IN OUT PVOID *baseAddr, IN OUT S
if (!apc) {
return STATUS_UNSUCCESSFUL;
}
- *outSize = ADDRESS_AND_SIZE_TO_SPAN_PAGES(*baseAddr, 4096);
KeStackAttachProcess((PRKPROCESS)pep, apc);
status = ZwAllocateVirtualMemory(ZwCurrentProcess(), baseAddr, 0, outSize, MEM_COMMIT, protect);
if (!NT_SUCCESS(status)) {
diff --git a/MemDriverLib/MemDriverLib.cpp b/MemDriverLib/MemDriverLib.cpp
index 0c985c3..e1d56d1 100644
--- a/MemDriverLib/MemDriverLib.cpp
+++ b/MemDriverLib/MemDriverLib.cpp
@@ -212,7 +212,7 @@ bool KInterface::VAlloc(HANDLE targetPID, PVOID *address, SIZE_T *size, ULONG pr
if (SendRecvWait(MEM_VALLOC) == SRR_SIGNALED) {
m_last_ntstatus = vr->StatusRes;
if (vr->StatusRes ||
- vr->SizeRes != *size)
+ vr->SizeRes < *size)
{
std::stringstream err_str;
err_str << "Call VAlloc(0x" << std::hex << *address