Why argument has been changed when using subprocess(python) to start application(windows)?
<p>I use the python code below to start debugger and the application(a simple code I write myself) with argument:</p>

<pre><code>debugger=r'C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\windbg.exe'
exe='test.exe'
argument='\x01\x02...\xff'#from 0x01 to 0xff

subprocess.Popen(debugger+" "+exe+" "+argument)
</code></pre>

<p>Well it worked, but when I set a breakpoint in main function, and checked the argument, it seemed that argv[<a href="http://i.stack.imgur.com/uK3gR.png" rel="nofollow">1</a>] is not exactly right:</p>

<p><a href="http://i.stack.imgur.com/uK3gR.png" rel="nofollow"><img src="http://i.stack.imgur.com/uK3gR.png" alt="enter image description here"></a></p>

<p>It seems that '\x09' and '\x20' are changed to '\x00' and '\x22' is gone.</p>

<p>So what's wrong? Am I doing it in a wrong way?</p>

<p>Command with arguments shold be passed to <code>Popen</code> as list:</p>

<pre><code>subprocess.Popen([debugger, exe, argument])
</code></pre>

python debugging parameters parameter-passing