dshikashio / Pybag

Python module for Windbg's dbgeng plus additional wrappers.
MIT License
56 stars 15 forks source link

Hoping you could add CreateProcess2 #19

Closed d-millar closed 3 months ago

d-millar commented 3 months ago

If you have time and the inclination, something like this works:

    def CreateProcess2(self, cmdline, options, initial_dir, env):
        if isinstance(cmdline, str):
            cmdline = cmdline.encode()
        if isinstance(initial_dir, str):
            initial_dir = initial_dir.encode()
        if isinstance(env, str):
            env = env.encode()

        hr = self._cli.CreateProcess2(self._proc_server_hndl, cmdline, byref(options), sizeof(options), initial_dir, env)
        exception.check_err(hr)
d-millar commented 3 months ago

where options is instantiated as DbgEng._DEBUG_CREATE_PROCESS_OPTIONS() and env must be include '/0'-delineated key=value pairs

dshikashio commented 3 months ago

Thanks! Added this and your other issue now. Sorry for the delay - was off on vacation. New version 2.2.11 building now.

d-millar commented 3 months ago

No worries - much appreciated!