 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
b6ooy Grandmaster Cheater
Reputation: 0
Joined: 21 Sep 2006 Posts: 653
|
Posted: Tue Jul 22, 2008 1:41 pm Post subject: [Q-C++]Including dll in exe . |
|
|
I made a dll and an injector , after injecting the dll dialog appear and allows to scan memory etc..
Its obvious that i am using a dll , Is there a way to include the dll[or its source] inside the injector , so it looks like i am using an exe ?
and make it hard for crackers?
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Tue Jul 22, 2008 1:49 pm Post subject: |
|
|
You can add the DLL as a resource and extract it at runtime.
API Needed:
- FindResource
- LoadResource
- LockResource
- SizeofResource
- CreateFile
- WriteFile
- CloseHandle
It's not too hard to figure out. And there are various examples on the net.
_________________
- Retired. |
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Tue Jul 22, 2008 9:11 pm Post subject: |
|
|
You can get a hex editor and copy the entire DLL into your source.
| Code: |
static BYTE incDLL[] =
{
0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x0E, 0x1F, 0xBA, 0x0E, 0x00, 0xB4,
0x09, 0xCD, 0x21, 0xB8, 0x01, 0x4C, 0xCD, 0x21, 0x54, 0x68, 0x69, 0x73, 0x20,
bla bla bla, it will be bloody long
}
|
and then do
| Code: |
f.open( DLLPath, ios::binary | ios::in | ios::out );
f.write((PCHAR)incDLL, sizeof(incDLL));
f.close();
|
EDIT: After thinking about it, I think you don't have to do the second part. You can just directly link to incDLL in your inject function.
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Wed Jul 23, 2008 7:34 am Post subject: |
|
|
| Zand wrote: |
EDIT: After thinking about it, I think you don't have to do the second part. You can just directly link to incDLL in your inject function. |
How?
|
|
| Back to top |
|
 |
Bizarro I post too much
Reputation: 0
Joined: 01 May 2007 Posts: 2648
|
Posted: Wed Jul 23, 2008 9:14 am Post subject: |
|
|
Or u can use xbundle & any public exe/dll/resource bundler
_________________
w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils |
|
| Back to top |
|
 |
b6ooy Grandmaster Cheater
Reputation: 0
Joined: 21 Sep 2006 Posts: 653
|
Posted: Wed Jul 23, 2008 11:45 am Post subject: |
|
|
I had problems extracting the dll from the resource ..
so i did the same method that Zand wrote , but using static DWORD ..
and in my dllinject func. wpm incDLL , the injector writes the dll in the allocated region but nothing happen ?? [ dll doesn't load ]
Then i used creat/writefile to extract the dll then write it in the allocated memory and it worked ..
I just don't know why writing it directly didn't work ? thats what i wan't .
extracting it in the same folder is useless
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Wed Jul 23, 2008 12:08 pm Post subject: |
|
|
| Zand wrote: | You can get a hex editor and copy the entire DLL into your source.
| Code: |
static BYTE incDLL[] =
{
0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x0E, 0x1F, 0xBA, 0x0E, 0x00, 0xB4,
0x09, 0xCD, 0x21, 0xB8, 0x01, 0x4C, 0xCD, 0x21, 0x54, 0x68, 0x69, 0x73, 0x20,
bla bla bla, it will be bloody long
}
|
and then do
| Code: |
f.open( DLLPath, ios::binary | ios::in | ios::out );
f.write((PCHAR)incDLL, sizeof(incDLL));
f.close();
|
EDIT: After thinking about it, I think you don't have to do the second part. You can just directly link to incDLL in your inject function. |
No real point in making a huge header to hold this. You can just include the DLL inside a resource file and extract it during runtime. A lot easier. Either way, the DLL is going to be created on the disk, so worrying about people getting their hands on it is nothing to even consider. (Just saying that in reference not saying that you said that.)
No need for extra programs to do it either. You can do it yourself. And if you need to compress, use a packer. There are tons of em that are free and will compress resources.
_________________
- Retired. |
|
| Back to top |
|
 |
Zand Master Cheater
Reputation: 0
Joined: 21 Jul 2006 Posts: 424
|
Posted: Wed Jul 23, 2008 9:53 pm Post subject: |
|
|
| Wiccaan wrote: | | Zand wrote: | You can get a hex editor and copy the entire DLL into your source.
| Code: |
static BYTE incDLL[] =
{
0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x0E, 0x1F, 0xBA, 0x0E, 0x00, 0xB4,
0x09, 0xCD, 0x21, 0xB8, 0x01, 0x4C, 0xCD, 0x21, 0x54, 0x68, 0x69, 0x73, 0x20,
bla bla bla, it will be bloody long
}
|
and then do
| Code: |
f.open( DLLPath, ios::binary | ios::in | ios::out );
f.write((PCHAR)incDLL, sizeof(incDLL));
f.close();
|
EDIT: After thinking about it, I think you don't have to do the second part. You can just directly link to incDLL in your inject function. |
No real point in making a huge header to hold this. You can just include the DLL inside a resource file and extract it during runtime. A lot easier. Either way, the DLL is going to be created on the disk, so worrying about people getting their hands on it is nothing to even consider. (Just saying that in reference not saying that you said that.)
No need for extra programs to do it either. You can do it yourself. And if you need to compress, use a packer. There are tons of em that are free and will compress resources. |
At first I thought the DLL had to be created on the disc before injecting. But after thinking again, can't you just directly copy the DLL from the injector's memory into the target program's memory. You would have to change your injecting method though...
They could still take a dump of the memory to get your DLL
Take a look at ManualMap by Darawk and alter it slightly
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jul 24, 2008 11:13 pm Post subject: |
|
|
| Quote: | At first I thought the DLL had to be created on the disc before injecting. But after thinking again, can't you just directly copy the DLL from the injector's memory into the target program's memory. You would have to change your injecting method though...
They could still take a dump of the memory to get your DLL
Take a look at ManualMap by Darawk and alter it slightly |
Yes, you can. All depends on how you want to do it really, I find it easier to just create it to the disk.
_________________
- Retired. |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Fri Jul 25, 2008 9:11 am Post subject: |
|
|
You could always just do a huge WriteProcessMemory() call and CreateRemoteThread on it, right?
_________________
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Fri Jul 25, 2008 11:17 am Post subject: |
|
|
| Can't you code the DLL in the EXE project and then use WriteProcessMemory to inject the whole module?
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Tue Jul 29, 2008 2:38 pm Post subject: |
|
|
| Yea keep the dll in your program as hex then wpm it into your own memory like injecting it into a process.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|