|
|
|
|
|
by ryanprichard
3456 days ago
|
|
Yeah, I considered that route, but I was concerned that it'd be unreliable -- maybe with other programs doing clever tricks with import/export tables, or maybe with antivirus. I can't think of a specific reason it wouldn't work, though. I think it'd have to override CreateProcess to propagate the API hook. IIRC, ConEmu's CreateProcess starts a child in a suspended state so it can install its hook before resuming the child. Maybe it'd have to hook GetProcAddress, too. I was assuming I'd use genuine console handles, but recognize that they're associated with the special console, so divert their API calls. Maybe the technique would make programs slower. I know that's a complaint people have about ConEmu. There's a similar (4th?) technique I've considered -- instead of hooking every process attached to the console, hook APIs in the conhost process and reimplement the internal protocol. It should avoid the performance problems and confine the hackiness to one address space. The trouble is that the protocol is undocumented. A small change could break everything without warning, but MS could also redesign the whole thing, making a fix impossible. |
|
[1] https://msdn.microsoft.com/en-us/library/ms971319.aspx