| View previous topic :: View next topic |
| Author |
Message |
RAKO Master Cheater
Reputation: 0
Joined: 26 Jun 2006 Posts: 454
|
Posted: Sat Aug 16, 2008 8:59 am Post subject: [help][c++] dll injector |
|
|
I was working on an injector for myself. just a a educational thing and maybe I can use it in the future.
the code I used I found everywhere http://www.dreamincode.net/code/snippet407.htm
anyway there are two problems. the main one is that everything seems to work but the gui doesn't pop up like when I usually inject this dll.
the other problem is I can't turn a string into a LPCTSTR but don't worry about it (ill just hard code the process name).
_________________
| Dark Byte wrote: | | Who knows, perhaps i'm a maple gm!!!! |
|
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Sat Aug 16, 2008 2:10 pm Post subject: |
|
|
nvm i found u solution might work
GetProcessID(process.c_str(),SetOfPID);
|
|
| Back to top |
|
 |
RAKO Master Cheater
Reputation: 0
Joined: 26 Jun 2006 Posts: 454
|
Posted: Sat Aug 16, 2008 7:52 pm Post subject: |
|
|
thanks for that. and I figured out my problem. (I just needed a good nights sleep) anyway I just need to use absolute path and make it run as admin on vista.
I already had it running as admin part but now I just need to figure out how to get the absolute path from a relative path. and how to force it to run as admin on any vista computer(instead of right clicking).
_________________
| Dark Byte wrote: | | Who knows, perhaps i'm a maple gm!!!! |
|
|
| Back to top |
|
 |
DeviantGeek Newbie cheater
Reputation: 0
Joined: 30 Apr 2006 Posts: 20 Location: 127.0.0.1
|
Posted: Thu Aug 21, 2008 8:19 pm Post subject: |
|
|
to get the absolute path, im pretty sure if you do:
| Code: | | GetModuleFileName(NULL, szFileName, sizeof(szFileName)); |
first parameter is NULL, meaning it will get the fully qualified path of the process your dll is attached to. just remove the processes name from the string by nulling out the last backslash in it:
| Code: | char szAbsolutePath[2046] = {0};
GetModuleFileName(NULL, szAbsolutePath, sizeof(szAbsolutePath));
*strrchr(szAbsolutePath, '\\') = '\0'; |
i havent coded anything for vista tho, so not sure if anything works differently or not.
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Thu Aug 21, 2008 8:28 pm Post subject: |
|
|
GetCurrentDirectory. No need to remove process name.
_________________
|
|
| Back to top |
|
 |
igoticecream Grandmaster Cheater Supreme
Reputation: 0
Joined: 23 Apr 2006 Posts: 1807 Location: 0x00400000
|
Posted: Thu Aug 21, 2008 8:35 pm Post subject: |
|
|
or getcwd()... i use this one because return char*
_________________
+~ |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sat Aug 23, 2008 6:20 am Post subject: |
|
|
| sponge wrote: | | GetCurrentDirectory. No need to remove process name. |
Can return false information if the process is currently loading information from another directory after setting the current directory with 'SetCurrentDirectory'. (Just a heads up cause I have run into this before.)
_________________
- Retired. |
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Aug 23, 2008 1:33 pm Post subject: |
|
|
| Wiccaan wrote: | | sponge wrote: | | GetCurrentDirectory. No need to remove process name. |
Can return false information if the process is currently loading information from another directory after setting the current directory with 'SetCurrentDirectory'. (Just a heads up cause I have run into this before.) | The thing is I see no use of using SetCurrentDirectory in a simple injector.
_________________
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Sat Aug 23, 2008 2:48 pm Post subject: |
|
|
| OpenFileDialogs changes the current directory. (not sure if all, but in some languages they do)
|
|
| Back to top |
|
 |
|