File indexing completed on 2024-06-23 11:48:50

0001 /******************************************************************
0002  *
0003  * kdbgwin - Helper application for DrKonqi
0004  *
0005  * This file is part of the KDE project
0006  *
0007  * SPDX-FileCopyrightText: 2010 Ilie Halip <lupuroshu@gmail.com>
0008  *
0009  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0010  *****************************************************************/
0011 
0012 #include "callbacks.h"
0013 
0014 BOOL Callbacks::ReadProcessMemory(HANDLE hProcess, DWORD64 qwBaseAddr, PVOID lpBuf, DWORD nSize, LPDWORD lpBytesRead)
0015 {
0016     SIZE_T st;
0017     BOOL bRet = ::ReadProcessMemory(hProcess, (LPVOID)qwBaseAddr, (LPVOID)lpBuf, nSize, &st);
0018     *lpBytesRead = (DWORD)st;
0019     // qCDebug(DRKONQI_LOG) << "bytes read=" << st << "; bRet=" << bRet << "; LastError: " << GetLastError();
0020     return bRet;
0021 }
0022 
0023 PVOID Callbacks::SymFunctionTableAccess64(HANDLE hProcess, DWORD64 qwAddr)
0024 {
0025     PVOID ret = ::SymFunctionTableAccess64(hProcess, qwAddr);
0026     // qCDebug(DRKONQI_LOG) << "ret=" << ret << "; LastError: " << GetLastError();
0027     return ret;
0028 }
0029 
0030 DWORD64 Callbacks::SymGetModuleBase64(HANDLE hProcess, DWORD64 qwAddr)
0031 {
0032     DWORD64 ret = ::SymGetModuleBase64(hProcess, qwAddr);
0033     // qCDebug(DRKONQI_LOG) << "ret=" << ret << "; LastError: " << GetLastError();
0034     return ret;
0035 }