<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx</link><description>The rest is up to the debugger.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3660150</link><pubDate>Mon, 02 Jul 2007 17:40:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3660150</guid><dc:creator>Mark Steward</dc:creator><description>&lt;P&gt;I frequently find myself having to do this for API calls (SendMessage, especially) that aren't available on the command line. &amp;nbsp;Isn't there an easier way to call into Win32 (without VBA)?&lt;/P&gt;
&lt;P&gt;Another handy call is for when the debugger itself is hosed (works in ntsd):&lt;/P&gt;
&lt;P&gt;resp=@esp-8&lt;/P&gt;
&lt;P&gt;ed @esp 0n{TargetPID}&lt;/P&gt;
&lt;P&gt;g=kernel32!DebugActiveProcessStop&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;Yaniv Pessach wrote &lt;A href="http://blogonsoftware.blogspot.com/2007/06/execute-any-windows-api-from.html"&gt;a program that takes a function name and a parameter list on the command line&lt;/A&gt;. Ony simple types are supported, but for some purposes that may be enough. -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3660185</link><pubDate>Mon, 02 Jul 2007 17:43:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3660185</guid><dc:creator>KJK::Hyperion</dc:creator><description>&lt;p&gt;Just what is it that makes Notepad such a perfect designated debugger victim?&lt;/p&gt;
</description></item><item><title>Doh</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3660199</link><pubDate>Mon, 02 Jul 2007 17:49:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3660199</guid><dc:creator>Mark Steward</dc:creator><description>&lt;p&gt;Make that ed @esp @eip 0n{TargetPID}&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661480</link><pubDate>Mon, 02 Jul 2007 19:33:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661480</guid><dc:creator>El Guapo</dc:creator><description>&lt;P&gt;Er, why not just try again. Why go through all that manual command entering into the debugger when all you need to do is run it again without the SW_HIDE?&lt;/P&gt;
&lt;DIV class=post&gt;[&lt;I&gt;Why waste your time with Image File Execution options? Just run Notepad under the debugger manually! -Raymond&lt;/I&gt;]&lt;/DIV&gt;</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661508</link><pubDate>Mon, 02 Jul 2007 19:38:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661508</guid><dc:creator>anonymous</dc:creator><description>&lt;p&gt;&amp;gt; Just what is it that makes Notepad such a perfect&lt;/p&gt;
&lt;p&gt;&amp;gt; designated debugger victim?&lt;/p&gt;
&lt;p&gt;It's single-threaded and straight-forward crud code.&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661598</link><pubDate>Mon, 02 Jul 2007 19:50:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661598</guid><dc:creator>GregM</dc:creator><description>&lt;p&gt;&amp;quot;Just what is it that makes Notepad such a perfect designated debugger victim?&amp;quot;&lt;/p&gt;
&lt;p&gt;My guess: it's lightweight so it starts fast, and it's in the PATH, so it's fast to type the command line.&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661606</link><pubDate>Mon, 02 Jul 2007 19:51:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661606</guid><dc:creator>GregM</dc:creator><description>&lt;p&gt;&amp;quot;Why go through all that manual command entering into the debugger when all you need to do is run it again without the SW_HIDE?&amp;quot;&lt;/p&gt;
&lt;p&gt;This assumes that it's easy to run it again exactly as it was just run. &amp;nbsp;That may not be the case.&lt;/p&gt;
</description></item><item><title>   Do you know how Raymond Chen shows hidden Windows? &amp;raquo; Thursday Night</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661624</link><pubDate>Mon, 02 Jul 2007 19:52:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661624</guid><dc:creator>   Do you know how Raymond Chen shows hidden Windows? » Thursday Night</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.paulbetts.org/index.php/2007/07/02/do-you-know-how-raymond-chen-shows-hidden-windows/"&gt;http://blog.paulbetts.org/index.php/2007/07/02/do-you-know-how-raymond-chen-shows-hidden-windows/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3661680</link><pubDate>Mon, 02 Jul 2007 19:56:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3661680</guid><dc:creator>KJK::Hyperion</dc:creator><description>&lt;p&gt;Yes, but, I wonder why not cmd? or the venerable winver? There's _something_ about notepad&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3662019</link><pubDate>Mon, 02 Jul 2007 20:42:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3662019</guid><dc:creator>Anders</dc:creator><description>&lt;p&gt;or just use winspy (&lt;a rel="nofollow" target="_new" href="http://www.catch22.net/software/winspypics.asp"&gt;http://www.catch22.net/software/winspypics.asp&lt;/a&gt;) and show the window&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3662032</link><pubDate>Mon, 02 Jul 2007 20:44:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3662032</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;You can also use the .call command if you don't want to fool around with the stack directly. For example:&lt;/p&gt;
&lt;p&gt;0:001&amp;gt; .call user32!NtUserShowWindow(0x303e2, 6)&lt;/p&gt;
&lt;p&gt;Thread is set up for call, 'g' will execute.&lt;/p&gt;
&lt;p&gt;WARNING: This can have serious side-effects,&lt;/p&gt;
&lt;p&gt;including deadlocks and corruption of the debuggee.&lt;/p&gt;
&lt;p&gt;0:001&amp;gt; g&lt;/p&gt;
&lt;p&gt;eax=7ffde000 ebx=00000000 ecx=00000000 edx=77c4f06d esi=00000000 edi=00000000&lt;/p&gt;
&lt;p&gt;eip=77c02ea8 esp=01c3f7e0 ebp=01c3f80c iopl=0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; nv up ei pl zr na pe nc&lt;/p&gt;
&lt;p&gt;cs=001b &amp;nbsp;ss=0023 &amp;nbsp;ds=0023 &amp;nbsp;es=0023 &amp;nbsp;fs=003b &amp;nbsp;gs=0000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; efl=00000246&lt;/p&gt;
&lt;p&gt;ntdll!DbgBreakPoint:&lt;/p&gt;
&lt;p&gt;77c02ea8 cc &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int &amp;nbsp; &amp;nbsp; 3&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3662829</link><pubDate>Mon, 02 Jul 2007 22:10:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3662829</guid><dc:creator>Mark Steward</dc:creator><description>&lt;p&gt;KJK::Hyperion: I wondered this, and decided that Notepad's more popular than Winver and has a main window. &amp;nbsp;In fact, it's got most elements of a Windows program (writing a Notepad replacement was a common project in Win32 programming books), and simpler code than Calc or Winmine. &amp;nbsp;You can also change its title, or type something in and scan memory for it. &amp;nbsp;Cmd has the whole console window thing, which it just annoying.&lt;/p&gt;
&lt;p&gt;Kevin: what symbols are you using?&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3663880</link><pubDate>Tue, 03 Jul 2007 00:00:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3663880</guid><dc:creator>Ehtyar</dc:creator><description>&lt;p&gt;For sending random messages to windows: &lt;a rel="nofollow" target="_new" href="http://www.maxoutput.com/SendMsg.html"&gt;http://www.maxoutput.com/SendMsg.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For modifying properties of random windows: &lt;a rel="nofollow" target="_new" href="http://nirsoft.net/utils/winexp.html"&gt;http://nirsoft.net/utils/winexp.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ehtyar.&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3664078</link><pubDate>Tue, 03 Jul 2007 00:20:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3664078</guid><dc:creator>Nick</dc:creator><description>&lt;p&gt;I admit I'm not real knowledgeable when it comes to Win32 debugging, but I got lost about the time ntsd was invoked.&lt;/p&gt;
&lt;p&gt;I assume you're connecting the debugger to Notepad, and then issuing commands to manually execute the ShowWindow API call, correct?&lt;/p&gt;
&lt;p&gt;I've not heard of ntsd before. Does it come with Windows, or is it part of Visual Studio (which I have installed)?&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3665221</link><pubDate>Tue, 03 Jul 2007 02:39:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3665221</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;&amp;gt; I've not heard of ntsd before. Does it come with Windows, or is it part&lt;/p&gt;
&lt;p&gt;&amp;gt; of Visual Studio (which I have installed)?&lt;/p&gt;
&lt;p&gt;It's part of the &amp;quot;Debugging Tools for Windows&amp;quot;.&lt;/p&gt;
</description></item><item><title>Interesting Finds: July 2, 2007</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3666440</link><pubDate>Tue, 03 Jul 2007 06:05:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3666440</guid><dc:creator>Jason Haley</dc:creator><description /></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3667912</link><pubDate>Tue, 03 Jul 2007 09:46:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3667912</guid><dc:creator>Chad Austin</dc:creator><description>&lt;p&gt;Python (with the pywin32 package) works pretty well too:&lt;/p&gt;
&lt;p&gt;import win32gui, win32con&lt;/p&gt;
&lt;p&gt;win32gui.ShowWindow(0x5656, win32con.SW_SHOW)&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3668797</link><pubDate>Tue, 03 Jul 2007 11:48:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3668797</guid><dc:creator>Jonathan</dc:creator><description>
&lt;p&gt;I must say that's a rather poor design on the kernel's part, and
very easy to cause minor behavior changes when launched under debugger
- exactly those who would hide the bug you're trying to find. Also,
this trick is non-trivial (= few would ever figure it out without
having the accurate magic spell from a great wizard).&lt;/p&gt;

&lt;p&gt;Alternately, you could run ntsd as a debugging server:&lt;/p&gt;

&lt;p&gt;ntsd -server tcp:port=1234 -gGW&lt;/p&gt;

&lt;p&gt;And then connect with windbg:&lt;/p&gt;

&lt;p&gt;windbg -remote tcp:server=localhost,port=1234&lt;/p&gt;

&lt;p&gt;Also works for services that are not allowed to interact with the desktop. And across the network too (of course).&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;And what would be a better design? -Raymond&lt;/i&gt;]&lt;/div&gt;</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3668835</link><pubDate>Tue, 03 Jul 2007 11:58:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3668835</guid><dc:creator>Neil</dc:creator><description>&lt;p&gt;Kevin wrote:&lt;/p&gt;
&lt;p&gt;You can also use the .call command if you don't want to fool around with the stack directly. For example:&lt;/p&gt;
&lt;p&gt;0:001&amp;gt; .call user32!NtUserShowWindow(0x303e2, 6)&lt;/p&gt;
&lt;p&gt;^ Symbol not a function in '.call user32!NtUserShowWindow(0x303e2, 6)'&lt;/p&gt;
&lt;p&gt;Raymond mentioned that you can do this if you have some other function with the same signature as the API that you're trying to call, but that's unlikely when you're debugging Notepad.&lt;/p&gt;
&lt;p&gt;Raymond wrote:&lt;/p&gt;
&lt;p&gt;Yaniv Pessach wrote a program that takes a function name and a parameter list on the command line.&lt;/p&gt;
&lt;p&gt;Personally I use a version of the Callfunc executable from Undocumented Windows 3.1 that I modified to work as a Win32 console application. Sadly I don't have the exact source of the current version I use available - I tried and failed to add pagination to the dump command (I couldn't work out how to wait for a keypress...)&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3670478</link><pubDate>Tue, 03 Jul 2007 15:47:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3670478</guid><dc:creator>Harold Hunt</dc:creator><description>&lt;p&gt;I'm usually a lurker... but after seeing this (never thought of it before) I have to remark:&lt;/p&gt;
&lt;p&gt;That's awesome!&lt;/p&gt;
&lt;p&gt;Thanks Raymond&lt;/p&gt;
&lt;p&gt;Harold&lt;/p&gt;
</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3687515</link><pubDate>Wed, 04 Jul 2007 15:02:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3687515</guid><dc:creator>Neil</dc:creator><description>
&lt;p&gt;[And what would be a better design? -Raymond]&lt;/p&gt;

&lt;p&gt;Perhaps the debugger could use saved winposinfo for itself and pass on the startup info to the child process?&lt;/p&gt;
&lt;div class="post"&gt;[&lt;i&gt;And that's the design we have today. -Raymond&lt;/i&gt;]&lt;/div&gt;</description></item><item><title>re: Image File Execution Options just inserts the debugger in front of the command line</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3695163</link><pubDate>Thu, 05 Jul 2007 02:23:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3695163</guid><dc:creator>Dean Harding</dc:creator><description>&lt;p&gt;&amp;gt; Perhaps the debugger could use saved winposinfo for itself and&lt;/p&gt;
&lt;p&gt;&amp;gt; pass on the startup info to the child process?&lt;/p&gt;
&lt;p&gt;The debugger can choose to do whatever it likes. We're talking about the design of Image File Execution Options here.&lt;/p&gt;
</description></item><item><title>MITHUN SHANBHAG&amp;#8217;S BLOG  &amp;raquo; Blog Archive   &amp;raquo; Image File Execution Options (IFEO)</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#3945624</link><pubDate>Thu, 19 Jul 2007 03:21:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3945624</guid><dc:creator>MITHUN SHANBHAG’S BLOG  » Blog Archive   » Image File Execution Options (IFEO)</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.debugtricks.com/?p=15"&gt;http://www.debugtricks.com/?p=15&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Not a kernel guy  &amp;raquo; Blog Archive   &amp;raquo; ?????????????????????? ?????????? &amp;laquo;Image File Execution Options&amp;raquo;.</title><link>http://blogs.msdn.com/oldnewthing/archive/2007/07/02/3652873.aspx#7051697</link><pubDate>Thu, 10 Jan 2008 10:36:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7051697</guid><dc:creator>Not a kernel guy  » Blog Archive   » ?????????????????????? ?????????? «Image File Execution Options».</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.not-a-kernel-guy.com/2008/01/09/277"&gt;http://blog.not-a-kernel-guy.com/2008/01/09/277&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>