4 ms·
I did socket hooking via DLL injection for a company i worked for. I was somewhat amazed that it was allowed, and I'm amazed it still is.
by thefourthchime 6y ago
I did socket hooking via DLL injection for a company i worked for. I was somewhat amazed that it was allowed, and I'm amazed it still is.
- banana_giraffe 6y agoI've mentioned it here before. I have a "cd" replacement tool for Windows. It works by writing a separate thread to cmd.exe's process and remotely running it to do things in cmd's process (change the current directory, update a few enviornment variables cmd.exe uses behind the scenes). I am flabbergasted that it works, and it still works after all of these years.
- dgellow 6y agoIs the code available somewhere? I would be interested to read it
- banana_giraffe 6y agoIf you really want to see it, I put the core of it here: https://pastebin.com/v92Aesty https://pastebin.com/v92Aesty ExecuteRemoteThread() does what it's name says, copying RemoteThread to cmd.exe, and running it. The rest of the code is about getting pointers to a few WinAPIs that are used in a safe way, and dancing around not having a CRT that can be sanely used inside of cmd.exe.
- dgellow 6y agoThanks!
- JoshGlazebrook 6y agoI've also done some socket hooking work in C/C++. Any idea if it's feasible to do with Go?