diff options
| author | boris <wzn@moneybot.cc> | 2019-01-03 16:51:40 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2019-01-03 16:51:40 +1300 |
| commit | e1f048c8f922613aec1f63791c2191e55cbd5132 (patch) | |
| tree | 887f57c58673e775bff8c1df3f23943ef8ddd6cd /csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp | |
| parent | c0f1354a301ce2a2fc867a89fafdde4571c07c02 (diff) | |
ricardo milos :DDDD::D:D:D:
Diffstat (limited to 'csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp')
| -rw-r--r-- | csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp index abed829..1bbfed0 100644 --- a/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp +++ b/csgo-loader/csgo-client/RemoteCode/RemoteProcess.cpp @@ -29,6 +29,10 @@ namespace RemoteCode m_ProcessId = ProcessEntry.th32ProcessID;
m_Process = OpenProcess(PROCESS_ALL_ACCESS, false, ProcessEntry.th32ProcessID);
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Found process \"%s\" -> %p", ProcessEntry.szExeFile, m_Process);
+ );
+
if(!m_Process)
ERROR_ASSERT(STR("[000G:%08x] There was an error with accessing a process."), GetLastError());
@@ -45,9 +49,13 @@ namespace RemoteCode static auto ZwReadVirtualMemory = Syscalls->Find<long(__stdcall *)(void *, void *, void *, size_t, void *)>(FNV("ZwReadVirtualMemory"));
NTSTATUS Status = ZwReadVirtualMemory(m_Process, Address, Data, SizeOfData, nullptr);
-
+
if(NT_ERROR(Status))
ERROR_ASSERT(STR("[00DF:%08x] There was an error with accessing a process."), Status);
+
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Read %zd bytes from process\n", SizeOfData);
+ );
}
void RemoteProcess::WriteMemoryWrapper_Internal(void *Address, void *Data, size_t SizeOfData)
@@ -58,6 +66,10 @@ namespace RemoteCode if(NT_ERROR(Status))
ERROR_ASSERT(STR("[00DF:%08x] There was an error with accessing a process."), Status);
+
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Wrote %zd bytes to process\n", SizeOfData);
+ );
}
void *RemoteProcess::Allocate(size_t AllocationSize)
@@ -78,6 +90,10 @@ namespace RemoteCode if(NT_ERROR(Status))
ERROR_ASSERT(STR("[00DF:%08x] There was an error with accessing a process."), Status);
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Allocated page at %p (%zd bytes)\n", AllocationAddress, AllocationSize);
+ );
+
return AllocationAddress;
}
@@ -101,6 +117,11 @@ namespace RemoteCode ERROR_ASSERT(STR("[00DF:00001C00] An integrity check failed."));
CloseHandle(Toolhelp);
+
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Found module \"%s\" at %p\n", ModuleEntry.szModule, ModuleEntry.hModule);
+ );
+
return RemoteModule(ModuleEntry.hModule);
}
}
|
