Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Coding Releases
You last visited: Today at 19:02

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C++ Source]Code Injector

Discussion on [C++ Source]Code Injector within the Coding Releases forum part of the Coders Den category.

Reply
 
Old   #1
 
Tyrar's Avatar
 
elite*gold: 0
Join Date: Oct 2008
Posts: 1,637
Received Thanks: 1,119
[C++ Source]Code Injector

hier habt ihr dann mal den source von meiner injection methode!
sie kann eine funktion in den mainthread eines prozesse injizieren, und ausführen (gut geeignet um eine dll zu laden).
hier habt ihr den code (geschnitten):
Code:
__declspec(naked) void injStub()
{
	__asm
	{
		push 0xDEADBEEF
		pushfd
		pushad
		call 0xDEADBEEF
		popad
		popfd
		ret
	}
}

bool InjectCode(HANDLE hProc, HANDLE hThread, LPVOID lpCode, SIZE_T szCodeLen)
{
	void* stub = VirtualAllocEx(hProc,NULL,sizeof(&injStub),MEM_COMMIT,PAGE_EXECUTE_READWRITE);
	void* code = VirtualAllocEx(hProc,NULL,szCodeLen,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
	memcpy(stub,&injStub,sizeof(&injStub));
	memcpy(code,lpCode,szCodeLen);
	SuspendThread(hThread);
	CONTEXT ctx;
	ctx.ContextFlags = CONTEXT_CONTROL;
	GetThreadContext(hThread,&ctx);
	ctx.ContextFlags = CONTEXT_CONTROL;
	DWORD oldEIP = ctx.Eip;
	ctx.Eip = (DWORD)stub;
	memcpy((void *)((DWORD)stub+1),&oldEIP,4);
	memcpy((void *)((DWORD)stub+8),code,4);
	SetThreadContext(hThread,&ctx);
	ResumeThread(hThread);
	CloseHandle(hThread);
	CloseHandle(hProc);
	return true;
}
have fun
Tyrar is offline  
Thanks
4 Users
Old 03/22/2010, 06:38   #2
 
flo8464's Avatar
 
elite*gold: 0
Join Date: Nov 2008
Posts: 161
Received Thanks: 38
Also...0 Fehlerbehandlung und hat mit C++ auch nicht sonderlich viel am Hut ..
flo8464 is offline  
Thanks
1 User
Old 03/22/2010, 08:15   #3
 
Tyrar's Avatar
 
elite*gold: 0
Join Date: Oct 2008
Posts: 1,637
Received Thanks: 1,119
Quote:
Originally Posted by flo8464 View Post
Also...0 Fehlerbehandlung und hat mit C++ auch nicht sonderlich viel am Hut ..
fehlerbehandlung hab ich eh selten drin, ich gehe davon, dass die grossen programmier fails erspart bleiben XD
und es ist eben aus meinen .cpp dateien gekommen XD
Tyrar is offline  
Thanks
1 User
Old 03/28/2010, 16:23   #4
 
elite*gold: 0
Join Date: Mar 2010
Posts: 2
Received Thanks: 1
Danke
SpawN_ is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
dll injector source code?
08/13/2011 - Soldier Front - 7 Replies
I'm just downloaded VB 2010 and I'm willing to make injector for special force.. Do you guys know where I can find .dll injector source code? :):)
Source code gesucht >Injector<
01/23/2010 - WarRock - 3 Replies
hi ich suche einen source code für einen warrock injector :D er sollte bei den folgenden betriebssystemen funzen: Vista 64 bit und 32 bit Win 7 64 bit und 32 bit XP 64 bit und 32 bit PLS Postet rein wenn ihr den code habt.



All times are GMT +1. The time now is 19:02.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.