Detour in NodeJS service (TypeScript calling C++) #263
Unanswered
igupta-microsoft
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all, my name is Ishita and I have recently started working with Detours for our NodeJS service.
I want to hook Detour to the winsock2 APIs "socket" and "closeSocket". The Detour is implemented in a .cc file which is compiled into a binary that is loaded into a TypeScript class using "require". Now the TypeScript class has a method that does a "fetch" call, and I am expecting the Detour to attach to the "socket" call that will happen in the background of "fetch" and replace it with my function. But I do see that the attachment is not happening. Can someone please give me some pointers as to what I might be doing wrong? I know that DetourAttach is happening successfully as DetourTransactionCommit is not returning any error.
Here's some code snippets for reference:
The binding happens like this:
And then we use it in the TS class like this:
Beta Was this translation helpful? Give feedback.
All reactions