<?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[Wer kann C++ Source in Delphi übersetzen]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wer kann mir diesen Source von C++ in den Source von Delphi übersetzen?<br />
Danke.</p>
<pre><code class="language-cpp">Headermaker EnlargeHeader(PE_INFO *pe)
{
    Headermaker             ret = LPE_HANDLEDERROR;
    HWND                    hErrDlg = GetActiveWindow();
    DWORD                   dwHSize, dwBuff, i;
    IMAGE_SECTION_HEADER    *pS;
    HANDLE                  hFile;
    void                    *pMem;
    DWORD                   dwMemSize;

    if ( GetRealSizeOfHeaders( pe-&gt;pMap ) &gt;= 0x1000 )
    {
        ShowError(hErrDlg, &quot;Error&quot;);
        goto Exit;
    }

    dwHSize = GetRealSizeOfHeaders(pe-&gt;pMap);
    dwMemSize = pe-&gt;dwFileSize - dwHSize;
    pMem = m(dwMemSize);
    if (!pMem)
    {
        ret = LPE_NOMEMORY;
        goto Exit;
    }
    memcpy(pMem, (void*)((DWORD)pe-&gt;pMap + dwHSize), dwMemSize);
    pe-&gt;pNTh-&gt;OptionalHeader.SizeOfHeaders = dwHSize + 0x200;
    pS = pe-&gt;pSech;
    for (i = 0; i &lt; pe-&gt;pNTh-&gt;FileHeader.NumberOfSections; i++)
    {
        if (pS-&gt;PointerToRawData)
            pS-&gt;PointerToRawData += 0x200;
        ++pS;
    }
    UnloadPEFile(pe);

    hFile = GetFileHandle(pe-&gt;cPath, GFH_OPENEXISTING_RW);
    SetFilePointer(hFile, dwHSize + 0x200, 0, FILE_BEGIN);
    WriteFile(
        hFile,
        pMem,
        dwMemSize,
        &amp;dwBuff,
        NULL);
    CloseHandle(hFile);
    f(pMem);
    if (LoadPEFile(pe) != LPEF_SUCCESS)
    {
        HandleRemapError(hErrDlg);
        goto Exit;
    }
    ShowPEBaseInfo(hPEEditor);

    ret = LPE_OK;

Exit:
    return ret;
}
</code></pre>
<p>[ Dieser Beitrag wurde am 04.03.2003 um 19:16 Uhr von <strong>Dimah</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/16509/wer-kann-c-source-in-delphi-übersetzen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 04:39:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/16509.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Mar 2003 18:12:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wer kann C++ Source in Delphi übersetzen on Tue, 04 Mar 2003 18:12:00 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wer kann mir diesen Source von C++ in den Source von Delphi übersetzen?<br />
Danke.</p>
<pre><code class="language-cpp">Headermaker EnlargeHeader(PE_INFO *pe)
{
    Headermaker             ret = LPE_HANDLEDERROR;
    HWND                    hErrDlg = GetActiveWindow();
    DWORD                   dwHSize, dwBuff, i;
    IMAGE_SECTION_HEADER    *pS;
    HANDLE                  hFile;
    void                    *pMem;
    DWORD                   dwMemSize;

    if ( GetRealSizeOfHeaders( pe-&gt;pMap ) &gt;= 0x1000 )
    {
        ShowError(hErrDlg, &quot;Error&quot;);
        goto Exit;
    }

    dwHSize = GetRealSizeOfHeaders(pe-&gt;pMap);
    dwMemSize = pe-&gt;dwFileSize - dwHSize;
    pMem = m(dwMemSize);
    if (!pMem)
    {
        ret = LPE_NOMEMORY;
        goto Exit;
    }
    memcpy(pMem, (void*)((DWORD)pe-&gt;pMap + dwHSize), dwMemSize);
    pe-&gt;pNTh-&gt;OptionalHeader.SizeOfHeaders = dwHSize + 0x200;
    pS = pe-&gt;pSech;
    for (i = 0; i &lt; pe-&gt;pNTh-&gt;FileHeader.NumberOfSections; i++)
    {
        if (pS-&gt;PointerToRawData)
            pS-&gt;PointerToRawData += 0x200;
        ++pS;
    }
    UnloadPEFile(pe);

    hFile = GetFileHandle(pe-&gt;cPath, GFH_OPENEXISTING_RW);
    SetFilePointer(hFile, dwHSize + 0x200, 0, FILE_BEGIN);
    WriteFile(
        hFile,
        pMem,
        dwMemSize,
        &amp;dwBuff,
        NULL);
    CloseHandle(hFile);
    f(pMem);
    if (LoadPEFile(pe) != LPEF_SUCCESS)
    {
        HandleRemapError(hErrDlg);
        goto Exit;
    }
    ShowPEBaseInfo(hPEEditor);

    ret = LPE_OK;

Exit:
    return ret;
}
</code></pre>
<p>[ Dieser Beitrag wurde am 04.03.2003 um 19:16 Uhr von <strong>Dimah</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/91384</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/91384</guid><dc:creator><![CDATA[Biarchiv]]></dc:creator><pubDate>Tue, 04 Mar 2003 18:12:00 GMT</pubDate></item><item><title><![CDATA[Reply to Wer kann C++ Source in Delphi übersetzen on Tue, 04 Mar 2003 18:16:00 GMT]]></title><description><![CDATA[<p>Das ist WinApi Code.<br />
Thread verschoben ins WinApi Forum. <a href="http://www.c-plusplus.net/forum/forum,4.html" rel="nofollow">WinAPI</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/91385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/91385</guid><dc:creator><![CDATA[Gerard]]></dc:creator><pubDate>Tue, 04 Mar 2003 18:16:00 GMT</pubDate></item><item><title><![CDATA[Reply to Wer kann C++ Source in Delphi übersetzen on Fri, 18 Jul 2008 12:05:25 GMT]]></title><description><![CDATA[<p>Das ist nur ein Teil eines Codes ohne zu Wiesen welcher Record PE_INFO ist und<br />
was die Funktion GetRealSizeOfHeaders macht ist es nur Teilweise möglich.<br />
zb.<br />
DWORD dwMemSize; Gleich dwMemSize: DWORD;<br />
IMAGE_SECTION_HEADER *pS; Gleich<br />
ps : PIMAGE_SECTION_HEADER; // oder TIMAGE_SECTION_HEADER;</p>
<p>if ( GetRealSizeOfHeaders( pe-&gt;pMap ) &gt;= 0x1000 )<br />
{<br />
ShowError(hErrDlg, &quot;Error&quot;);<br />
goto Exit;<br />
}<br />
Gleich<br />
If GetRealSizeOfHeaders(pe.pMap) &gt;= 0x1000 then<br />
begin<br />
ShowError(hErrDlg, 'Error');<br />
Exit; // oder Break;<br />
end;</p>
<p>for (i = 0; i &lt; pe-&gt;pNTh-&gt;FileHeader.NumberOfSections; i++)<br />
Gleich<br />
for i := 0 to pe.pNTh.FileHeader.NumberOfSections do<br />
begin<br />
// pS-&gt;PointerToRawData += 0x200;<br />
pS.PointerToRawData := pS.PointerToRawData + 0x200;<br />
end;</p>
<p>if (LoadPEFile(pe) != LPEF_SUCCESS)<br />
Gleich<br />
if LoadPEFile(pe) not(LPEF_SUCCESS) then<br />
begin</p>
<p>end;<br />
* Gleich ^<br />
== Gleich =<br />
! Gleich Not<br />
-&gt; Gleich .<br />
++ Gleich Inc(n)<br />
= Gleich :=<br />
Ok Ich hoffe das konte dir einwenig weiter Helfen.<br />
Tip:<br />
Mit Strg u. linker Maustaste auf Funktions-Name oder Record usw. Klicken<br />
erscheint der Delphi-Code!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1549349</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1549349</guid><dc:creator><![CDATA[TaiChiPit]]></dc:creator><pubDate>Fri, 18 Jul 2008 12:05:25 GMT</pubDate></item></channel></rss>