<?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[C anweisung in C++ ?]]></title><description><![CDATA[<p>ich habe diese zeile aus einem C-programm was sonst funktioniert und komme einfach nicht weiter das in C++ zu tranferieren:</p>
<pre><code class="language-cpp">func=(void*) &amp;data; /*adresse des Arrays zuweisen - nun kann man es ausführen*/
</code></pre>
<p>wie weise ich bitte func die adresse von data zu!? (ist ein array (data.h) das einen shellcode enthält)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/260080/c-anweisung-in-c</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 12:55:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/260080.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Jan 2010 18:54:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 18:54:24 GMT]]></title><description><![CDATA[<p>ich habe diese zeile aus einem C-programm was sonst funktioniert und komme einfach nicht weiter das in C++ zu tranferieren:</p>
<pre><code class="language-cpp">func=(void*) &amp;data; /*adresse des Arrays zuweisen - nun kann man es ausführen*/
</code></pre>
<p>wie weise ich bitte func die adresse von data zu!? (ist ein array (data.h) das einen shellcode enthält)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848206</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848206</guid><dc:creator><![CDATA[WhiteLion]]></dc:creator><pubDate>Sun, 31 Jan 2010 18:54:24 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 19:01:34 GMT]]></title><description><![CDATA[<p>Ich glaube, ich würde es so probieren.</p>
<pre><code class="language-cpp">typedef void functype();
func=reinterpret_cast&lt;functype*&gt;(&amp;data);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1848207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848207</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 31 Jan 2010 19:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 19:50:04 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Ich glaube, ich würde es so probieren.</p>
<pre><code class="language-cpp">typedef void functype();
func=reinterpret_cast&lt;functype*&gt;(&amp;data);
</code></pre>
</blockquote>
<p>der compiler gibt zwar keinen fehler, aber wenn ichs ausführe stürzt es ab <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848244</guid><dc:creator><![CDATA[WhiteLion]]></dc:creator><pubDate>Sun, 31 Jan 2010 19:50:04 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 19:53:55 GMT]]></title><description><![CDATA[<p>Die Frage ist:<br />
Was zur Hölle willst du überhaupt machen? Was ist <code>data</code> ? Was ist <code>func</code> ? Was machst du danach mit <code>func</code> ?<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-200753.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-200753.html</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848246</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848246</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 31 Jan 2010 19:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 20:59:52 GMT]]></title><description><![CDATA[<p>Dravere schrieb:</p>
<blockquote>
<p>Die Frage ist:<br />
Was zur Hölle willst du überhaupt machen? Was ist <code>data</code> ? Was ist <code>func</code> ? Was machst du danach mit <code>func</code> ?<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-200753.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-200753.html</a></p>
<p>Grüssli</p>
</blockquote>
<p>Hat er ausreichend gesagt, finde ich. Er hat Maschinencode in einem char[] und will den ausführen.</p>
<pre><code class="language-cpp">//main.c
char main[] = {
0xE8, 13, 0, 0, 0, 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r',
'l', 'd', '!', '\n' , 0x59, 0xB8, 4, 0, 0, 0, 0xBB, 1, 0, 0, 0,
0xBA, 13, 0, 0, 0, 0xCD, 0x80, 0xB8, 1, 0, 0, 0, 0xBB, 0, 0, 0,
0, 0xCD, 0x80 };
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1848277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848277</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 31 Jan 2010 20:59:52 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 21:07:00 GMT]]></title><description><![CDATA[<p>volkard schrieb:</p>
<blockquote>
<p>Hat er ausreichend gesagt, finde ich. Er hat Maschinencode in einem char[] und will den ausführen.</p>
</blockquote>
<p>Jein. Shellcode schön und gut, nur was für Shellcode? Als was hat er <code>func</code> deklariert? Womöglich will er noch irgendwelche Parameter übergeben oder das ganze noch über eine Memberfunktion laufen lassen oder irgendwelche solche seltsamen Ideen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Nur mit den Informationen, welche er uns gegeben hat, kann man ihm nicht sehr weit helfen.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848284</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 31 Jan 2010 21:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 22:28:07 GMT]]></title><description><![CDATA[<p>Ich seh das so wie Dravere. Im ersten Post steht einfach zu wenig. Zb fehlte die Info, wie sich das Problem äußert.</p>
<p>WhiteLion schrieb:</p>
<blockquote>
<p>der compiler gibt zwar keinen fehler, aber wenn ichs ausführe stürzt es ab</p>
</blockquote>
<p>Aha!</p>
<p>Naja, mal davon abgesehen, dass das Vorhaben höchst fragwürdig ist ... Du solltest es vielleicht mit einem extern &quot;C&quot; Funktionszeiger probieren. Ich meine, wenn's der C Compiler schon gefressen hatte und funktionierte, muss es auch in C++ klappen und das mit dem extern &quot;C&quot; ist der einzige Unterschied, der mir dazu einfällt.</p>
<pre><code class="language-cpp">extern &quot;C&quot; {
typedef void c_func_type();
}

:

void hack() {
  c_func_type* fptr = reinterpret_cast&lt;c_func_type*&gt;(data);
}
</code></pre>
<p>(Angabe ohne Gewähr)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848310</guid><dc:creator><![CDATA[kruemelkacker]]></dc:creator><pubDate>Sun, 31 Jan 2010 22:28:07 GMT</pubDate></item><item><title><![CDATA[Reply to C anweisung in C++ ? on Sun, 31 Jan 2010 22:30:16 GMT]]></title><description><![CDATA[<p>Aber es fehlt wirklich noch die Info, was es für ein Funktionszeiger sein soll. Bisher haben wir ja nur geraten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1848311</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1848311</guid><dc:creator><![CDATA[kruemelkacker]]></dc:creator><pubDate>Sun, 31 Jan 2010 22:30:16 GMT</pubDate></item></channel></rss>