| View previous topic :: View next topic |
| Author |
Message |
Pantaleon Newbie cheater
Reputation: 0
Joined: 08 Mar 2009 Posts: 17 Location: New York
|
Posted: Thu Mar 26, 2009 3:40 pm Post subject: ¿How create Dlls to inject In Visual C++ 2008 Or Delphi 7? |
|
|
Hello I in search of a code to create dlls to inject with a injector
Forward Create more than such ves with his help already I searched quite info and no meeting almost nothing to rioja than desire clear I using
Visual C++ 2008 and I believe that there is no code I've seen so far, thank you very much to who can tell me as well as create them in Visual C + + or Delphi, then use the 2 languages.
|
|
| Back to top |
|
 |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Thu Mar 26, 2009 4:05 pm Post subject: |
|
|
A dll to do what?
In visual Studio 2008, u can select a Win32 program with C++, then make it empty DLL.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 473
Joined: 09 May 2003 Posts: 25907 Location: The netherlands
|
Posted: Thu Mar 26, 2009 4:06 pm Post subject: |
|
|
with delphi(7):
file->new->other->Dll Wizard
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Pantaleon Newbie cheater
Reputation: 0
Joined: 08 Mar 2009 Posts: 17 Location: New York
|
Posted: Thu Mar 26, 2009 5:58 pm Post subject: Thank you very much. |
|
|
Perfect, as I succeeded in Delphi, thanks Dark Byte.
This is the code that I got in google:
| Code: | library CreationDll;
uses
Windows;
Var
j:Integer;
x:cardinal;
const
Address1:dword=$00400000;
ArrayValue:Array[1..12] of Byte = ($4D,$5A,$90,$0,$3,$0,$0,$0,$4,$0,$0,$0);
Procedure EditMEmory;
Begin VirtualProtectEx(GetCurrentProcess,ptr(Address1),12,PAGE_EXECUTE_READWRITE,nil);
for j := 0 To Length(ArrayValue) do
PByte(Address1 + j)^:=ArrayValue[j];
end;
Begin
CreateThread(nil,0,@EditMEmory,nil,0,x);
end. |
That was the code that will find and fix, but the question is: it works, I have no editor to check it out ... if it could tell?
Rioja than no I find went a code to Visual C++ 2008 may tell as do?
I do not talk about how to create the project, I speak of creating the code of the dll.
As already I create the project more no I idea of as create the code of the dll me can say how? thanks by his generous help until later.
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Thu Mar 26, 2009 6:22 pm Post subject: |
|
|
| Code: |
#include <windows.h>
int j;
DWORD x;
DWORD Address1 = 0x400000;
BYTE ArrayValue[12] = (0x4D,0x5A,0x90,0x0,0x3,0x0,0x0,0x0,0x4,0x0,0x0,0x0);
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved )
{
switch( fdwReason )
{
case DLL_PROCESS_ATTACH:
CreateThread(0,0,(LPTHREAD_START_ROUTINE)EditMEmory,0,0,x);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
BOOL EditMEmory()
{
if(VirtualProtectEx(GetCurrentProcess(),&Address1,12,PAGE_EXECUTE_READWRITE,NULL))
{
memcpy((void*)Address1,(void*)ArrayValue,sizeof(ArrayValue));
return TRUE;
}
else
{
return FALSE;
}
}
|
_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.
Last edited by BanMe on Thu Mar 26, 2009 6:53 pm; edited 1 time in total |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 473
Joined: 09 May 2003 Posts: 25907 Location: The netherlands
|
Posted: Thu Mar 26, 2009 6:33 pm Post subject: |
|
|
I might be retarded, but I am just wondering why you'd make a new thread if you could just do it at dllentry
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Thu Mar 26, 2009 6:55 pm Post subject: |
|
|
@Dark Byte: I was merely showing C++ code relation to the delphi code provided..
@nwongfeiying...lol deleted..
_________________
don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you. |
|
| Back to top |
|
 |
Pantaleon Newbie cheater
Reputation: 0
Joined: 08 Mar 2009 Posts: 17 Location: New York
|
Posted: Thu Mar 26, 2009 8:35 pm Post subject: Perfect!!! |
|
|
Oh thank you very much for answering BanMe.
The code had several errors, but I solved;).
Actually thank you very much.
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
|
| Back to top |
|
 |
Pantaleon Newbie cheater
Reputation: 0
Joined: 08 Mar 2009 Posts: 17 Location: New York
|
Posted: Thu Mar 26, 2009 11:13 pm Post subject: Yeah I understand.!! |
|
|
| BanMe wrote: | no problem
of course it had errors it was a rough interpretation of delphi on the fly
you are most welcome..
but Dark Byte is correct in that you do not need a thread to do the action of EditMEmory(). you can simple call it after Begin or in DLL_PROCESS_ATTACH..
| Code: |
Begin
EditMEmory()
end
|
or the C++ way
| Code: |
case DLL_PROCESS_ATTACH:
EditMEmory();
break
|
In both languages you could also create a TLS Callback that would execute this code even before DLL_PROCESS_ATTACH .. the caveat being you have to add controller code that recognizes if its been executed or not..as TLS callbacks execute before execution and after..
kind regards BanMe |
oh if I understand, thanks for the clarification on the 2 ... very good forum .
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Fri Mar 27, 2009 3:49 am Post subject: |
|
|
| In delphi Dll Wizard, you don't have to use DllMain just like in C, but i would recommend using it, and as db mentioned you don't need to create a thread, you could just edit it as soon as it's injected (same for DllMain) but i guess people love creating a thread druing process attach, so whatever.
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Fri Mar 27, 2009 12:08 pm Post subject: |
|
|
Sometimes you have to create a thread because:
- Not all api's work from dllmain. They might hang for example (I experienced that with InternetOpenUrl)
- Msdn states something about not doing certain things from dll main. I'm not sure what exactly.
- LoadLibrary won't return untill dllmain has finished, so sometimes the calling thread needs to continue after LoadLibrary, but that depends on the injector used (if it uses CreateRemoteThread or 'hijacks' an existing thread)
|
|
| Back to top |
|
 |
|