<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to FAQ</title><link>https://sourceforge.net/p/decompiler/wiki/FAQ/</link><description>Recent changes to FAQ</description><atom:link href="https://sourceforge.net/p/decompiler/wiki/FAQ/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 06 May 2015 21:38:49 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/decompiler/wiki/FAQ/feed" rel="self" type="application/rss+xml"/><item><title>FAQ modified by John Källén</title><link>https://sourceforge.net/p/decompiler/wiki/FAQ/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="frequently-asked-questions"&gt;Frequently Asked Questions&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;I have a binary that has been packed with a &lt;a class="alink" href="/p/decompiler/wiki/Packer"&gt;[Packer]&lt;/a&gt; and Decompiler is failing to open it.&lt;/strong&gt; Decompiler has an extensible architecture that supports adding unpacking scripts. If you need assistance with a specific unpacking script, create a Feature request and you will get assistance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How do I decompile MS-DOS or COM files, or other exectuables that don't have an executable file structure?&lt;/strong&gt;&lt;br /&gt;
The Decompiler will look for 'magic numbers' in the binary file you hand to it, to try to determine what kind of executable it is. However, some operating environments have simplistic binary formats. These usually involve reading the contents of the image file, which consists of machine code and data, but no metadata, into a particular well-known address in memory and then starting execution at that same address. Other times, all you have is a raw dump of executable code, with no metadata at all.&lt;/p&gt;
&lt;p&gt;Because there is no executable header in such a file, the Decompiler doesn't know what kind of machine code it is dealing with, not what operating environment the executable is expecting to be available. In these cases the operator needs to provide Decompiler with some assistance to get it started.&lt;/p&gt;
&lt;p&gt;If you are using the GUI client, go to main menu and select &lt;strong&gt;File&lt;/strong&gt; &amp;gt; &lt;strong&gt;Open As...&lt;/strong&gt;. This gives you a dialog box where you can select the executable file you wish to decompile, the processor architecture to use when decompiling it, and the operating environment to use for system calls. Finally, specify the address at which the file contents should be loaded.&lt;/p&gt;
&lt;p&gt;If you are using the command-line client, use the following incantation:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;decompile --arch &amp;lt;processor&amp;gt; --env &amp;lt;O/S&amp;gt; --base &amp;lt;address&amp;gt; --entry &amp;lt;address&amp;gt; &amp;lt;filename&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Examples: if your executable is an MS-DOS COM file, use&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;decompile --arch x86-real-16 --env ms-dos --base 0C00:0100 foo.com
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Notice that if you leave out the &lt;code&gt;--entry&lt;/code&gt; switch, Decompiler will use the &lt;code&gt;--base&lt;/code&gt; address as a starting point.&lt;/p&gt;
&lt;p&gt;If your executable is a CP/M COM file, you would use&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;decomile --arch z80 --env cpm --base 0100 foo.com
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;(assuming there were a CP/M environment available -- unfortunately not at the time of writing)&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">John Källén</dc:creator><pubDate>Wed, 06 May 2015 21:38:49 -0000</pubDate><guid>https://sourceforge.net90d62c7bfb9a5da9e07d49b633ede0d9d3abf14d</guid></item></channel></rss>