elegant method to inject a dll to processes BEFORE they start
I am making a 'mod' dll that modifies behaviour of the target process. I succeeded to inject my dll and hook some functions of target. But it requires more work to do when I need to hook some APIs BEFORE main module starts(more clearly, before the entry-point). I need to start the target program manually with CREATE_SUSPENDED attribute, inject, then resume. But some applications start with its own launcher program, some often start from x64 processes... such various environment make it hard to automate it. Seems like the best way's inject hooking dll to all process and handle CreateProcess.