<?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[Mithilfe von .dll andere .dll in Prozess injecten]]></title><description><![CDATA[<p>Hallo liebe C++ Freunde!</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich würde gerne eine DLL1.dll in den mspaint.exe Prozess injecten und sobald die DLL1.dll injected ist, soll sie die DLL2.dll in den notepad.exe Prozess injecten.</p>
<p>Mein Code sieht bis jetzt so aus.</p>
<p>Loader</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;tlhelp32.h&gt;
#include &lt;direct.h&gt;
#include &lt;wininet.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;tchar.h&gt;

void EnableDebugPrivileges()
{
	HANDLE hToken;
	LUID sedebugnameValue;
	TOKEN_PRIVILEGES tkp;
	if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &amp;hToken))return;
	if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &amp;sedebugnameValue))
	{
		CloseHandle(hToken);
		return;
	}
	tkp.PrivilegeCount = 1;
	tkp.Privileges[0].Luid = sedebugnameValue;
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
	if(!AdjustTokenPrivileges(hToken, FALSE, &amp;tkp, sizeof tkp, NULL, NULL))CloseHandle(hToken);
}

void WINAPI Inject(void)
{
	char DLL[MAX_PATH];
	GetCurrentDirectory(sizeof(DLL),DLL);
	strcat(DLL,&quot;\\DLL1.dll&quot;);

	HANDLE hSnapshot, hProcess, hModule;
	PROCESSENTRY32 pe32;

	while(true)
	{
		hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
		pe32.dwSize = sizeof(PROCESSENTRY32);
		Process32First(hSnapshot, &amp;pe32);

		while(Process32Next(hSnapshot, &amp;pe32))
		{
			if(!lstrcmp(pe32.szExeFile, &quot;mspaint.exe&quot;))
			{
				hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pe32.th32ProcessID);
				hModule = VirtualAllocEx(hProcess, 0, 8096, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
				WriteProcessMemory(hProcess, hModule, DLL, 8096, NULL );
				CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(&quot;kernel32&quot;),&quot;LoadLibraryA&quot;), hModule, 0, NULL);
				CloseHandle(hProcess);
				CloseHandle(hModule);
				return;
			}
			Sleep(5);
   		}
		CloseHandle(hSnapshot);
		Sleep(5);
	}
}

int main()
{
EnableDebugPrivileges();
Inject( );
return 0;
}
</code></pre>
<p>DLL1</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;tlhelp32.h&gt;

void EnableDebugPrivileges()
{
	HANDLE hToken;
	LUID sedebugnameValue;
	TOKEN_PRIVILEGES tkp;
	if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &amp;hToken))return;
	if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &amp;sedebugnameValue))
	{
		CloseHandle(hToken);
		return;
	}
	tkp.PrivilegeCount = 1;
	tkp.Privileges[0].Luid = sedebugnameValue;
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
	if(!AdjustTokenPrivileges(hToken, FALSE, &amp;tkp, sizeof tkp, NULL, NULL))CloseHandle(hToken);
}

DWORD WINAPI Inject(LPVOID lpParam)
{
	char DLL[MAX_PATH];
	GetCurrentDirectory(sizeof(DLL),DLL);
	strcat(DLL,&quot;\\DLL2.dll&quot;);

	HANDLE hSnapshot, hProcess, hModule;
	PROCESSENTRY32 pe32;

	while(true)
	{
		hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
		pe32.dwSize = sizeof(PROCESSENTRY32);
		Process32First(hSnapshot, &amp;pe32);

		while(Process32Next(hSnapshot, &amp;pe32))
		{
			if(!lstrcmp(pe32.szExeFile, &quot;notepad.exe&quot;))
			{
				hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pe32.th32ProcessID);
				hModule = VirtualAllocEx(hProcess, 0, 8096, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
				WriteProcessMemory(hProcess, hModule, DLL, 8096, NULL );
				CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(&quot;kernel32&quot;),&quot;LoadLibraryA&quot;), hModule, 0, NULL);
				CloseHandle(hProcess);
				CloseHandle(hModule);
			}
			Sleep(5);
   		}
		CloseHandle(hSnapshot);
		Sleep(5);
	}
return 0;
}

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
	EnableDebugPrivileges();
	CreateThread(NULL, 0, Inject, NULL, 0, NULL);
	MessageBox(NULL, &quot;DLL wurde injected!&quot;, &quot;DLL1&quot;, MB_OK);
	}
	return TRUE;
}
</code></pre>
<p>DLL2</p>
<pre><code>#include &lt;windows.h&gt;

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		MessageBox(NULL, &quot;DLL wurde injected!&quot;, &quot;DLL2&quot;, MB_OK);
	}
	return TRUE;
}
</code></pre>
<p>Also die Loader.exe injected die DLL1.dll und die soll die DLL2.dll injecten.<br />
Die Loader.exe injected die DLL1.dll auch ohne Probleme in den &quot;mspaint&quot; Prozess, aber von da aus injected die DLL1.dll nicht die DLL2.dll.</p>
<p>Hoffe mir kann einer helfen!<br />
(Und hoffe, das man das soweit versteht, was ich vorhabe)</p>
<p>Mit freundlichen Grüßen,<br />
strange</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/239688/mithilfe-von-dll-andere-dll-in-prozess-injecten</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 10:13:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/239688.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 26 Apr 2009 18:03:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 18:03:51 GMT]]></title><description><![CDATA[<p>Hallo liebe C++ Freunde!</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich würde gerne eine DLL1.dll in den mspaint.exe Prozess injecten und sobald die DLL1.dll injected ist, soll sie die DLL2.dll in den notepad.exe Prozess injecten.</p>
<p>Mein Code sieht bis jetzt so aus.</p>
<p>Loader</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;tlhelp32.h&gt;
#include &lt;direct.h&gt;
#include &lt;wininet.h&gt;
#include &lt;fstream&gt;
#include &lt;string&gt;
#include &lt;tchar.h&gt;

void EnableDebugPrivileges()
{
	HANDLE hToken;
	LUID sedebugnameValue;
	TOKEN_PRIVILEGES tkp;
	if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &amp;hToken))return;
	if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &amp;sedebugnameValue))
	{
		CloseHandle(hToken);
		return;
	}
	tkp.PrivilegeCount = 1;
	tkp.Privileges[0].Luid = sedebugnameValue;
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
	if(!AdjustTokenPrivileges(hToken, FALSE, &amp;tkp, sizeof tkp, NULL, NULL))CloseHandle(hToken);
}

void WINAPI Inject(void)
{
	char DLL[MAX_PATH];
	GetCurrentDirectory(sizeof(DLL),DLL);
	strcat(DLL,&quot;\\DLL1.dll&quot;);

	HANDLE hSnapshot, hProcess, hModule;
	PROCESSENTRY32 pe32;

	while(true)
	{
		hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
		pe32.dwSize = sizeof(PROCESSENTRY32);
		Process32First(hSnapshot, &amp;pe32);

		while(Process32Next(hSnapshot, &amp;pe32))
		{
			if(!lstrcmp(pe32.szExeFile, &quot;mspaint.exe&quot;))
			{
				hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pe32.th32ProcessID);
				hModule = VirtualAllocEx(hProcess, 0, 8096, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
				WriteProcessMemory(hProcess, hModule, DLL, 8096, NULL );
				CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(&quot;kernel32&quot;),&quot;LoadLibraryA&quot;), hModule, 0, NULL);
				CloseHandle(hProcess);
				CloseHandle(hModule);
				return;
			}
			Sleep(5);
   		}
		CloseHandle(hSnapshot);
		Sleep(5);
	}
}

int main()
{
EnableDebugPrivileges();
Inject( );
return 0;
}
</code></pre>
<p>DLL1</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;tlhelp32.h&gt;

void EnableDebugPrivileges()
{
	HANDLE hToken;
	LUID sedebugnameValue;
	TOKEN_PRIVILEGES tkp;
	if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &amp;hToken))return;
	if(!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &amp;sedebugnameValue))
	{
		CloseHandle(hToken);
		return;
	}
	tkp.PrivilegeCount = 1;
	tkp.Privileges[0].Luid = sedebugnameValue;
	tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
	if(!AdjustTokenPrivileges(hToken, FALSE, &amp;tkp, sizeof tkp, NULL, NULL))CloseHandle(hToken);
}

DWORD WINAPI Inject(LPVOID lpParam)
{
	char DLL[MAX_PATH];
	GetCurrentDirectory(sizeof(DLL),DLL);
	strcat(DLL,&quot;\\DLL2.dll&quot;);

	HANDLE hSnapshot, hProcess, hModule;
	PROCESSENTRY32 pe32;

	while(true)
	{
		hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
		pe32.dwSize = sizeof(PROCESSENTRY32);
		Process32First(hSnapshot, &amp;pe32);

		while(Process32Next(hSnapshot, &amp;pe32))
		{
			if(!lstrcmp(pe32.szExeFile, &quot;notepad.exe&quot;))
			{
				hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pe32.th32ProcessID);
				hModule = VirtualAllocEx(hProcess, 0, 8096, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
				WriteProcessMemory(hProcess, hModule, DLL, 8096, NULL );
				CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle(&quot;kernel32&quot;),&quot;LoadLibraryA&quot;), hModule, 0, NULL);
				CloseHandle(hProcess);
				CloseHandle(hModule);
			}
			Sleep(5);
   		}
		CloseHandle(hSnapshot);
		Sleep(5);
	}
return 0;
}

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
	EnableDebugPrivileges();
	CreateThread(NULL, 0, Inject, NULL, 0, NULL);
	MessageBox(NULL, &quot;DLL wurde injected!&quot;, &quot;DLL1&quot;, MB_OK);
	}
	return TRUE;
}
</code></pre>
<p>DLL2</p>
<pre><code>#include &lt;windows.h&gt;

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
		MessageBox(NULL, &quot;DLL wurde injected!&quot;, &quot;DLL2&quot;, MB_OK);
	}
	return TRUE;
}
</code></pre>
<p>Also die Loader.exe injected die DLL1.dll und die soll die DLL2.dll injecten.<br />
Die Loader.exe injected die DLL1.dll auch ohne Probleme in den &quot;mspaint&quot; Prozess, aber von da aus injected die DLL1.dll nicht die DLL2.dll.</p>
<p>Hoffe mir kann einer helfen!<br />
(Und hoffe, das man das soweit versteht, was ich vorhabe)</p>
<p>Mit freundlichen Grüßen,<br />
strange</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701625</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Sun, 26 Apr 2009 18:03:51 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 18:17:52 GMT]]></title><description><![CDATA[<p>Eventuell kann es beim 2. injecten Probleme mit dem Pfad zur DLL geben. Wenn du<br />
GetCurrentDirectory in der injezierten DLL aufrufst, wird das Verzeichniss von paint zurückgegeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701634</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701634</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 26 Apr 2009 18:17:52 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 20:33:22 GMT]]></title><description><![CDATA[<p>Melan schrieb:</p>
<blockquote>
<p>Eventuell kann es beim 2. injecten Probleme mit dem Pfad zur DLL geben. Wenn du<br />
GetCurrentDirectory in der injezierten DLL aufrufst, wird das Verzeichniss von paint zurückgegeben.</p>
</blockquote>
<p>Achso echt, das kann passieren? Werde es mal einfach über &quot;C:\\DLL2.dll&quot; versuchen, danke schonmal für die Antwort!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701703</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Sun, 26 Apr 2009 20:33:22 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 20:50:22 GMT]]></title><description><![CDATA[<p>Okay, scheint wohl nicht daran zu liegen. Injected trotzdem die DLL2.dll nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title="=\"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701709</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701709</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Sun, 26 Apr 2009 20:50:22 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 20:53:46 GMT]]></title><description><![CDATA[<p>frage wenn du die eine .dll schon in MSPAINT hast könntest du die andere dll auch normal einfach mit LoadLibrary laden<br />
oder möchtest du sie umbedingt injecten ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701710</guid><dc:creator><![CDATA[fragezeichen123]]></dc:creator><pubDate>Sun, 26 Apr 2009 20:53:46 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sun, 26 Apr 2009 21:36:02 GMT]]></title><description><![CDATA[<p>mspaint und notepad sind zwei verschiedene programme <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>möglich sollte das schon sein, allerdings halte ich es für riskant, innerhalb<br />
von der DllMain, die ja von windows aus geschützt ist, irgentwelche prozess-<br />
übergreifenden aktionen zu starten.</p>
<p>warum injectest du nicht einfach beide dlls vom loader aus? das paint irgentwelche<br />
zugriffsrechte hat wäre mir neu <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701729</guid><dc:creator><![CDATA[ausrufezeichen321]]></dc:creator><pubDate>Sun, 26 Apr 2009 21:36:02 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 00:19:25 GMT]]></title><description><![CDATA[<p>Ganz einfach, ich möchte das solange Paint auf ist, eine DLL in Notepad injected, wenn der aufgeht. Also wenn ich den Notepad dann wieder schliessen würde und ihn dann wieder öffnen würde, würde sich die DLL wieder automatisch injecten (weil mspaint ja immernoch auf ist).</p>
<p>Der Sinn war also quasi eine &quot;Auto Injection&quot; in den Notepad, solange mspaint offen ist. Und darum möchte ich auch nicht beides vom Loader aus injecten...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701765</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701765</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Mon, 27 Apr 2009 00:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 04:52:58 GMT]]></title><description><![CDATA[<p>Überprüfe einfach mal die Rückgabewerte und ruf GetLastError() auf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701770</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 27 Apr 2009 04:52:58 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 06:29:54 GMT]]></title><description><![CDATA[<p>Man sollte CreateThread nicht innerhalb von DllMain ausführen!<br />
Man darf grundsätzlich nicht alle beliebigen Windows Funktionen in der DllMain ausführen, da diese nicht reentrant ist.</p>
<p>Suche mal im Netz &quot;DllMain CreateThread&quot;!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701788</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701788</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 27 Apr 2009 06:29:54 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 11:23:25 GMT]]></title><description><![CDATA[<p>hab herausgefunden dass man auch keine kernel oder user Funktionen aufrufen sollte. was soll der mist? wie soll man das dann in injecteten dlls machen? Ö_Ö</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701933</guid><dc:creator><![CDATA[reetant]]></dc:creator><pubDate>Mon, 27 Apr 2009 11:23:25 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 11:53:24 GMT]]></title><description><![CDATA[<p>reetant schrieb:</p>
<blockquote>
<p>hab herausgefunden dass man auch keine kernel oder user Funktionen aufrufen sollte. was soll der mist? wie soll man das dann in injecteten dlls machen? Ö_Ö</p>
</blockquote>
<p>Du sollst das nur nicht in DllMain tun!<br />
Du kanst also jederzeit eine Dll laden, in dieser Dl eine Funktion aufrufen die Deinen Injektions-Code durchführt.</p>
<p>Außerdem 1.: Ich wage zu bezweifeln das &quot;Injection&quot; wirklich notwendig ist... <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="😉"
    /><br />
Außerdem 2.: Verstoße ich mal wieder gegen meine Regeln an Threads teilzunehmen bei denen es um DLL-Injection geht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701952</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 27 Apr 2009 11:53:24 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 12:18:57 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Man sollte CreateThread nicht innerhalb von DllMain ausführen!<br />
Man darf grundsätzlich nicht alle beliebigen Windows Funktionen in der DllMain ausführen, da diese nicht reentrant ist.</p>
<p>Suche mal im Netz &quot;DllMain CreateThread&quot;!</p>
</blockquote>
<p>Wo zum Teufel soll es denn sonst ausführen/laden lassen?<br />
Anders geht es ja wohl nicht? Oder irre ich mich? O.o<br />
Oder soll ich vllt. sowas in der Art machen</p>
<pre><code>void function()
{
CreateThread(NULL, 0, Inject, NULL, 0, NULL);
}
</code></pre>
<p>und dann in DLLMain</p>
<pre><code>BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, LPVOID lpvReserved)
{
    if (fdwReason == DLL_PROCESS_ATTACH)
    {
    EnableDebugPrivileges();
    function();
    MessageBox(NULL, &quot;DLL wurde injected!&quot;, &quot;DLL1&quot;, MB_OK);
    }
    return TRUE;
}
</code></pre>
<p>Oder wie genau?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701969</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701969</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Mon, 27 Apr 2009 12:18:57 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 12:25:48 GMT]]></title><description><![CDATA[<p>strange schrieb:</p>
<blockquote>
<p>Wo zum Teufel soll es denn sonst ausführen/laden lassen?</p>
</blockquote>
<p>Mäßige Dich im Ton und lerne erstmal was über DLLs.</p>
<p>strange schrieb:</p>
<blockquote>
<p>Anders geht es ja wohl nicht? Oder irre ich mich? O.o</p>
</blockquote>
<p>Ja Du irrst Dich!</p>
<p>strange schrieb:</p>
<blockquote>
<p>Oder soll ich vllt. sowas in der Art machen<br />
...</p>
</blockquote>
<p>Nein!<br />
Es ist immer noch im Kontext von DllMain.</p>
<p>Tipp: Ist Dir bewusst das man<br />
1. eine DLL Laden<br />
2. Mit GetProcAddr einen Einsprungpunkt bestimmen kann. (nach dem laden)<br />
3. Diese Funktion dann ausführen kann<br />
?</p>
<p>Dann liegt Dein Code in der DLL wird aber eben nicht im Kontext von DllMain ausgeführt.</p>
<p>BTW: Auch der Aufruf vom MessageBox in DllMain gehört sich nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1701972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1701972</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 27 Apr 2009 12:25:48 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 16:40:17 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Mäßige Dich im Ton und lerne erstmal was über DLLs.</p>
</blockquote>
<p>Das war eher ein ratloses Fragen, wollte dich jetzt nicht damit anmachen ^^<br />
Und ich versuche ja gerade was über DLL's zu lernen <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>Werde mal nachschauen wegen GetProcAddr, danke für deine Antwort!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1702139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1702139</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Mon, 27 Apr 2009 16:40:17 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 17:42:44 GMT]]></title><description><![CDATA[<p>mein gott versteht ihr es nicht oder so?<br />
Was Martin meint ist sowas hier: <a href="http://wiki.hackerboard.de/index.php/DLL-Injection" rel="nofollow">http://wiki.hackerboard.de/index.php/DLL-Injection</a><br />
hier wird dllmain nicht verwendet, sondern eine Funktion in der dll die als<br />
extern &quot;C&quot; void __declspec(dllexport) deklariert ist.<br />
Mir ist es selber ein rätsel warum überall wenn man nach &quot;dll injection&quot; sucht jeder alles in DllMain macht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1702194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1702194</guid><dc:creator><![CDATA[martinversteher]]></dc:creator><pubDate>Mon, 27 Apr 2009 17:42:44 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 18:39:17 GMT]]></title><description><![CDATA[<p>martinversteher schrieb:</p>
<blockquote>
<p>mein gott versteht ihr es nicht oder so?</p>
</blockquote>
<p>Endlich versteht mich jemand. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
<p>Ich verstehe auch weiterhin in keiner Weise warum alle Anfängersich immer auf die schwierigsten Themen stürzen müssen.<br />
Ansonsten ist dieser Thread für mich beendet...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1702220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1702220</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 27 Apr 2009 18:39:17 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Mon, 27 Apr 2009 23:22:53 GMT]]></title><description><![CDATA[<p>martinversteher schrieb:</p>
<blockquote>
<p>mein gott versteht ihr es nicht oder so?<br />
Was Martin meint ist sowas hier: <a href="http://wiki.hackerboard.de/index.php/DLL-Injection" rel="nofollow">http://wiki.hackerboard.de/index.php/DLL-Injection</a><br />
hier wird dllmain nicht verwendet, sondern eine Funktion in der dll die als<br />
extern &quot;C&quot; void __declspec(dllexport) deklariert ist.<br />
Mir ist es selber ein rätsel warum überall wenn man nach &quot;dll injection&quot; sucht jeder alles in DllMain macht!</p>
</blockquote>
<p>Danke, werds mir mal anschauen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1702356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1702356</guid><dc:creator><![CDATA[strange]]></dc:creator><pubDate>Mon, 27 Apr 2009 23:22:53 GMT</pubDate></item><item><title><![CDATA[Reply to Mithilfe von .dll andere .dll in Prozess injecten on Sat, 02 May 2009 21:27:22 GMT]]></title><description><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Thread-Specific_Storage" rel="nofollow">http://en.wikipedia.org/wiki/Thread-Specific_Storage</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1704611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1704611</guid><dc:creator><![CDATA[chezzmatazz]]></dc:creator><pubDate>Sat, 02 May 2009 21:27:22 GMT</pubDate></item></channel></rss>