Hi.
I'm trying to write a simple program proxy that, once replaced to some executable file, provides a dump of the process environment (command line arguments, environment and so on), executes the original task and returns its exit code.
The purpose of all this is simply analyzing how a frontend program interfaces its son process. Let's have a frontend.exe that fires sonproc.exe and we build this proxy.exe. We rename sonproc.exe as sonproc.exe~, rename proxy.exe as sonproc.exe and let frontend.exe start its son.
The problem is: how can you execute sonproc.exe~ (with CreateProcessExW) as closely as possible to the father's environment? For instance, is it possible to run sonproc.exe~ using sonproc.exe as argument?
The "GetStartupInfo()" and "GetEnvironmentStrings()" functions are what you want to call from in your 'debugger' to get all of the environment and startup variables passed in.