microsoft / WinDbg-Samples

Sample extensions, scripts, and API uses for WinDbg.
MIT License
707 stars 117 forks source link

How to interface JS through TCP #30

Closed ImanHosseini closed 2 years ago

ImanHosseini commented 3 years ago

I want to make a TCP connection between my JS script and another process, is that possible? I know that I can read/write files, but that is not really convenient as a means of talking to another process compared to a TCP connection [over localhost], if no networking is possible, what is the ideal solution for this?

SecSuperN0va commented 2 years ago

I wasn't able to find a way to do networking tasks directly from the debugger, however I was able to execute shell commands on the host. Using that I was able to run curl and pass it the relevant data I wanted to send to my server and this seems to work quite well. Perhaps not what you're looking for, but it definitely works well enough for interaction with a simple REST interface.

TimMisiak commented 2 years ago

This is not possible directly in JS extensions. You can write native data model extensions that provide this functionality to JS and other data model components.