aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-09-18 21:40:27 +0200
committerToni Uhlig <matzeton@googlemail.com>2019-09-18 21:40:27 +0200
commitc52fa4b2b1049a2a53f3fcffdb41fa9cde232b90 (patch)
tree2194185395e404f070c008bf28f2b7f6d76019c2
parent34c4ec281e24068f192ee56efe45ebd83ecb323f (diff)
added VAlloc, VUnlink and VFree test
-rw-r--r--CMD/CMD.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/CMD/CMD.cpp b/CMD/CMD.cpp
index eb2b270..980b165 100644
--- a/CMD/CMD.cpp
+++ b/CMD/CMD.cpp
@@ -122,6 +122,25 @@ int wmain(int argc, wchar_t **argv)
value = KMemory::Rpm<DWORD>(targetPID, rdata);
std::cout << "Value: " << std::hex << value << std::endl;
+ PVOID targetAddr = (PVOID)((UINT64)NULL);
+ SIZE_T targetSize = 4096;
+ try {
+ if (!ki.VAlloc(targetPID, &targetAddr, &targetSize, PAGE_EXECUTE_READWRITE)) {
+ std::wcout << L"VAlloc failed" << std::endl;
+ }
+#if 0
+ if (!ki.VUnlink(targetPID, targetAddr)) {
+ std::wcout << L"VUnlink failed" << std::endl;
+ }
+#endif
+ if (!ki.VFree(targetPID, targetAddr, targetSize)) {
+ std::wcout << L"VFree failed" << std::endl;
+ }
+ }
+ catch (std::runtime_error& err) {
+ std::wcout << err.what() << std::endl;
+ }
+
std::this_thread::sleep_for(std::chrono::microseconds(2500000));
}
else