<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[try catch (ILLEGAL OPCODE)]]></title><description><![CDATA[<p>Hallo,<br />
Ich versuche folgenden Quellcode<br />
<a href="http://www.codeproject.com/KB/system/VmDetect.aspx?display=Print" rel="nofollow">http://www.codeproject.com/KB/system/VmDetect.aspx?display=Print</a><br />
fuer den GCC zu konvertieren<br />
Leider wird der fehlerhafte Opcode nicht abgefangen(crash) durch catch?</p>
<p>Gruss Tom<br />
Das Programm:</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream.h&gt;

//perameter: -masm=intel

using namespace std;

bool rc = false;
unsigned char vpccall[4] = { 0x0F, 0x3F, 0x07, 0x0B};

int main(int argc, char *argv[])
{

try{
     // Execute the magic code sequence
     asm volatile(&quot;push ebx&quot;);
     asm volatile(&quot;mov  ebx, 0&quot;); // It will stay ZERO if VPC is running
     asm volatile(&quot;mov  eax, 1&quot;); // VPC function number

      // call VPC 
     ((void (*)(void)) vpccall)();

      asm volatile(&quot;test ebx, ebx&quot;);
      asm volatile(&quot;setz [_rc]&quot;);
      asm volatile(&quot;pop ebx&quot;);
} 
catch(...)
{
  cout &lt;&lt; &quot;gefangen\n&quot;;
}

system(&quot;PAUSE&quot;);
return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/233898/try-catch-illegal-opcode</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 14:37:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/233898.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Feb 2009 16:44:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to try catch (ILLEGAL OPCODE) on Tue, 10 Feb 2009 16:44:34 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Ich versuche folgenden Quellcode<br />
<a href="http://www.codeproject.com/KB/system/VmDetect.aspx?display=Print" rel="nofollow">http://www.codeproject.com/KB/system/VmDetect.aspx?display=Print</a><br />
fuer den GCC zu konvertieren<br />
Leider wird der fehlerhafte Opcode nicht abgefangen(crash) durch catch?</p>
<p>Gruss Tom<br />
Das Programm:</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream.h&gt;

//perameter: -masm=intel

using namespace std;

bool rc = false;
unsigned char vpccall[4] = { 0x0F, 0x3F, 0x07, 0x0B};

int main(int argc, char *argv[])
{

try{
     // Execute the magic code sequence
     asm volatile(&quot;push ebx&quot;);
     asm volatile(&quot;mov  ebx, 0&quot;); // It will stay ZERO if VPC is running
     asm volatile(&quot;mov  eax, 1&quot;); // VPC function number

      // call VPC 
     ((void (*)(void)) vpccall)();

      asm volatile(&quot;test ebx, ebx&quot;);
      asm volatile(&quot;setz [_rc]&quot;);
      asm volatile(&quot;pop ebx&quot;);
} 
catch(...)
{
  cout &lt;&lt; &quot;gefangen\n&quot;;
}

system(&quot;PAUSE&quot;);
return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1661249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1661249</guid><dc:creator><![CDATA[tom_-]]></dc:creator><pubDate>Tue, 10 Feb 2009 16:44:34 GMT</pubDate></item><item><title><![CDATA[Reply to try catch (ILLEGAL OPCODE) on Tue, 10 Feb 2009 16:49:58 GMT]]></title><description><![CDATA[<p>seit wann schreibt man asm volatile??<br />
denke da reicht asm</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1661255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1661255</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Tue, 10 Feb 2009 16:49:58 GMT</pubDate></item><item><title><![CDATA[Reply to try catch (ILLEGAL OPCODE) on Tue, 10 Feb 2009 16:54:09 GMT]]></title><description><![CDATA[<p>Habe das nur aus Verzweiflung gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1661259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1661259</guid><dc:creator><![CDATA[tom_-]]></dc:creator><pubDate>Tue, 10 Feb 2009 16:54:09 GMT</pubDate></item><item><title><![CDATA[Reply to try catch (ILLEGAL OPCODE) on Tue, 10 Feb 2009 17:01:39 GMT]]></title><description><![CDATA[<p><code>catch</code> fängt generell nur C++-exceptions, also solche, die mit <code>throw</code> geworfen worden sind. Ob Hardware-Exceptions umgewandelt werden, ist nicht definiert, kannst du aber in deinem Kompilerhandbuch nachlesen.</p>
<p>Gruß<br />
Don06</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1661262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1661262</guid><dc:creator><![CDATA[Don06]]></dc:creator><pubDate>Tue, 10 Feb 2009 17:01:39 GMT</pubDate></item><item><title><![CDATA[Reply to try catch (ILLEGAL OPCODE) on Tue, 10 Feb 2009 17:11:43 GMT]]></title><description><![CDATA[<p>Danke fuer den Tipp Don06</p>
<p>__except kann ich in GCC nicht verwenden oder?<br />
Alternative?</p>
<p>Gruss Tom</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1661269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1661269</guid><dc:creator><![CDATA[tom_-]]></dc:creator><pubDate>Tue, 10 Feb 2009 17:11:43 GMT</pubDate></item></channel></rss>