无法远程连接到windbg服务器,可能是因为dll版本不匹配? 我的目标是从另一个C++程序中控制WEBBG的运行实例。我看到API可以让您远程连接到调试客户端,所以我尝试使用它,并通过输入以下命令确保从运行的windbg客户端启动服务器:

无法远程连接到windbg服务器,可能是因为dll版本不匹配? 我的目标是从另一个C++程序中控制WEBBG的运行实例。我看到API可以让您远程连接到调试客户端,所以我尝试使用它,并通过输入以下命令确保从运行的windbg客户端启动服务器:,c++,winapi,windbg,C++,Winapi,Windbg,.server npipe:pipe=testname 通过在命令行参数中输入以下内容,我可以打开windbg的第二个实例并远程连接到第一个实例: -远程npipe:Pipe=sup,Server=DESKTOP-JT5S9BR 但是,当我尝试从我的C++控制台应用程序中连接时,我从HeRebug中得到以下错误:服务器当前被禁用。< /代码> < /P> #include <dbgeng.h> #include <iostream> int main() { H

.server npipe:pipe=testname

通过在命令行参数中输入以下内容,我可以打开windbg的第二个实例并远程连接到第一个实例:

-远程npipe:Pipe=sup,Server=DESKTOP-JT5S9BR

<>但是,当我尝试从我的C++控制台应用程序中连接时,我从HeRebug中得到以下错误:<代码>服务器当前被禁用。< /代码> < /P>
#include <dbgeng.h>
#include <iostream>

int main()
{
    HRESULT hr;
    IDebugClient7* debugger = nullptr;

    hr = DebugConnectWide(L"npipe:Pipe=testname,Server=DESKTOP-NAME", IID_PPV_ARGS(&debugger));

    std::getchar();
}

#包括
#包括
int main()
{
HRESULT-hr;
IDebugClient7*调试器=nullptr;
hr=DebugConnectWide(L“npipe:Pipe=testname,Server=DESKTOP-NAME”,IID_PPV_ARGS(&debugger));
std::getchar();
}

我在文档中读到,如果windbg的所有实例都希望远程连接,那么使用相同的版本是很重要的。所以我的问题可能与此有关。我看到在我的计算机上有很多版本的代码> dgGn.dll,代码> >代码> dBGNG.LIB < /C>,我如何确保我的C++应用程序运行的版本是BGNGG?< /P> < P>是的,你需要服务器运行的版本。 通常情况下,在服务器和客户机中安装相同的windbg版本,并从客户机windbg安装文件夹运行应用程序即可

或者,您可以将dbgeng复制到exe所在的本地文件夹中

复制c:\prograxxxxxx\dbgeng.dll。到可执行文件的目录

下面是一个流程示例

执行DebugConnect()的代码(DebugConectWide的Ascii版本)

在本地计算机上运行的命令行参数中包含cdb的进程列表

server debuggee client and wmic  commandlines 

C:\>whoami
kr\xxxxx

C:\>wmic process get CommandLine /format:list | grep -i cdb
CommandLine=cdb  -server npipe:pipe=windpipe cdb
CommandLine=cdb
CommandLine=cdb  -remote npipe:server=KR,pipe=windpipe
CommandLine=grep  -i cdb
复制了正确的dbgeng.dll并将其重命名为test_dbgeng.dll

copy "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbgeng.dll" .
ren dbgeng.dll test_dbgeng.dll
执行二进制文件重命名回dbgeng.dll并重新执行二进制文件

concliw.exe
usage concliw.exe remote connection string
concliw.exe "npipe:server=KR,pipe=windpipe"
hresult = 8007053d      dbgclient = 0000000000000000

ren test_dbgeng.dll dbgeng.dll

concliw.exe "npipe:server=KR,pipe=windpipe"
Outputmask = 3f7
hresult = 0     mask = 3f7
hresult = 0     dbgclient = 000001FA6B9D2590
copy "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\dbgeng.dll" .
ren dbgeng.dll test_dbgeng.dll
concliw.exe
usage concliw.exe remote connection string
concliw.exe "npipe:server=KR,pipe=windpipe"
hresult = 8007053d      dbgclient = 0000000000000000

ren test_dbgeng.dll dbgeng.dll

concliw.exe "npipe:server=KR,pipe=windpipe"
Outputmask = 3f7
hresult = 0     mask = 3f7
hresult = 0     dbgclient = 000001FA6B9D2590