diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2019-12-07 13:54:48 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2019-12-07 13:54:48 +0100 |
commit | 48dc2c110bfba0803c8938def50935db844d9ba6 (patch) | |
tree | eeb87287a6d998648126e45bff283de836b9e7ef /IntegrationTest | |
parent | f8ec9c39503e67cb33670cad21c76b4f370f0193 (diff) |
added some integration tests (and found a bug)
Diffstat (limited to 'IntegrationTest')
-rw-r--r-- | IntegrationTest/IntegrationTest.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/IntegrationTest/IntegrationTest.cpp b/IntegrationTest/IntegrationTest.cpp index dd56fb8..b1a0a29 100644 --- a/IntegrationTest/IntegrationTest.cpp +++ b/IntegrationTest/IntegrationTest.cpp @@ -16,6 +16,8 @@ int main() { + ULONG_PTR this_pid = GetCurrentProcessId(); + KM_ASSERT_EQUAL(true, true, "Integration Test Init"); try { @@ -23,8 +25,22 @@ int main() KM_ASSERT_EQUAL(true, ki.Init(), "Kernel Interface Init"); KM_ASSERT_EQUAL(true, ki.Handshake(), "Kernel Interface Handshake"); KM_ASSERT_EQUAL(SRR_TIMEOUT, ki.RecvWait(), "Kernel Interface Receive Wait"); - KM_ASSERT_EQUAL(true, ki.Ping(), "Kernel Interface PING - PONG"); + KM_ASSERT_EQUAL(true, ki.Ping(), "Kernel Interface PING - PONG #1"); + KM_ASSERT_EQUAL(true, ki.Ping(), "Kernel Interface PING - PONG #2"); + KM_ASSERT_EQUAL(true, ki.Ping(), "Kernel Interface PING - PONG #3"); + + { + PVOID addr = (PVOID)0x60000000; + SIZE_T size = 0x100; + KM_ASSERT_EQUAL(true, + ki.VAlloc((HANDLE)this_pid, &addr, &size, PAGE_READWRITE), "Kernel Interface VirtualAlloc"); + //KM_ASSERT_EQUAL(false, + // ki.VAlloc((HANDLE)this_pid, &addr, &size, PAGE_READWRITE), "Kernel Interface VirtualAlloc again should fail"); + //KM_ASSERT_EQUAL(true, + // ki.VFree((HANDLE)this_pid, addr, size), "Kernel Interface VirtualFree"); + } + KM_ASSERT_EQUAL(true, ki.Ping(), "Kernel Interface PING - PONG #4"); KM_ASSERT_EQUAL(true, ki.Exit(), "Kernel Interface Driver Shutdown"); } catch (std::runtime_error& err) { @@ -33,5 +49,6 @@ int main() std::wcout << "Done." << std::endl; error: - Sleep(3000); + std::wcout << std::endl << "[PRESS RETURN KEY TO EXIT]" << std::endl; + getchar(); }
\ No newline at end of file |