| View previous topic :: View next topic |
| Author |
Message |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Wed Jul 09, 2008 2:31 pm Post subject: |
|
|
| Quote: | | And I use MessageBoxA, cuz the others will not compile in a dll. I dont know about other people.... |
Huh..? The W version should compile fine in a DLL. Here's a quick example DLL:
| Code: | #include <windows.h>
DWORD ThreadProc( LPVOID lpThreadParameter )
{
MessageBoxW( 0, L"This is our message.", L"Caption", MB_OK );
return 0;
}
BOOL WINAPI DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReason )
{
switch( dwReason )
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hModule );
CreateThread( 0, 0, (LPTHREAD_START_ROUTINE)ThreadProc, 0, 0, 0 );
return TRUE;
}
return FALSE;
} |
Not using _T( .. ) macro to avoid adding another include just for example. Anyway, works perfectly fine for me. You might have forgotten to set the strings correctly as a string using just " " is not unicode friendly.
Unicode strings either need L in front of the quotes, or you can include TCHAR.h and use _T( .. ) macro or define it yourself. (Theres also the TEXT( ) macro as well.) _________________
- Retired. |
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Wed Jul 09, 2008 3:18 pm Post subject: |
|
|
| I didn't really try the unicode (no reason), but I did regular and works for .exe but not .dll for me. I am going to try to get rid of some of the errors... But today I want a break from programming and play some MS or Gears. |
|
| Back to top |
|
 |
homer_simpson Grandmaster Cheater
Reputation: 0
Joined: 25 Feb 2007 Posts: 596
|
Posted: Thu Jul 10, 2008 6:29 am Post subject: |
|
|
Edit: nvm
Last edited by homer_simpson on Thu Jul 10, 2008 7:54 am; edited 1 time in total |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jul 10, 2008 7:53 am Post subject: |
|
|
You would put them inside a thread. _________________
- Retired. |
|
| Back to top |
|
 |
Dark Gigabyte Advanced Cheater
Reputation: 0
Joined: 13 Feb 2008 Posts: 72
|
Posted: Thu Jul 10, 2008 11:58 am Post subject: |
|
|
Instead of this:
| Code: | switch (reason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hInst );
MessageBoxA (NULL, "Success!", "", MB_OK);
Func();
break;
case DLL_PROCESS_DETACH:
break;
/*case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;*/
} |
I believe you can just put a MessageBoxA underneath:
| Code: | | CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)MainLoop,0,NULL,&dwThreadID); |
if you put a loop or you can change the dllmain block to this:
| Code: | BOOL WINAPI DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
if(ul_reason_for_call==DLL_PROCESS_ATTACH) {
ATTACHED = true;
MessageBoxA(0, "Injection successfull", "My DLL", MB_ICONEXCLAMATION | MB_OK);
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)MainLoop,0,NULL,&dwThreadID);
}
return true;
} |
That should simply make an information box with an ok that will have the title My DLL and say injection successfull. |
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Thu Jul 10, 2008 1:20 pm Post subject: |
|
|
Yeah that works, but if it is below CreateThread, you also know if the thread was created correctly...
I am going to update my tut this after I rest from soccer.... It will include creat thread, and the last GUI part... Hopefully. |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu Jul 10, 2008 2:26 pm Post subject: Re: [TUT][v1] DLL's |
|
|
| Chaosis13 wrote: | With ASM you do this:
| Code: | | __asm mov dword ptr ds:[0x0046F08C],0x9090 |
Simple, yet powerful! I will not teach you ASM here, so deal! But you can be a leacher and use that code if you want.
Here is the deactivation:
| Code: | | __asm mov dword ptr ds:[0x0046F08C],0x1C74 |
Remember the bytes are reversed still. ^
That was the first part of the guide. I hope you learn something, but try to learn some more about pointers or ASM if that was confusing. |
You might want to try moving a word instead of a dword. 0x9090 is a word, not a dword. Each "number" represents not a byte, but a nibble. |
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 11, 2008 8:03 am Post subject: |
|
|
| Ik about all that but using dword doesn't make a difference, and if someone copyed my code there is less of a chance they will complain and message me abunch. I may explain that in there later... But they all should know hex and about bytes.... |
|
| Back to top |
|
 |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Sat Jul 12, 2008 12:49 pm Post subject: |
|
|
It said tomorow forever! :\ _________________
|
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Sat Jul 12, 2008 4:50 pm Post subject: |
|
|
| I am lazy. And I am working on that new program I showed you. I will most likely have it done today/tomarrow. (I was busyer than I thought today...) |
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Sun Jul 13, 2008 4:24 am Post subject: |
|
|
| Chaosis13 wrote: | | Ik about all that but using dword doesn't make a difference, and if someone copyed my code there is less of a chance they will complain and message me abunch. I may explain that in there later... But they all should know hex and about bytes.... |
I think you'll find there are going to be 2 bytes that are zeroed out unnecessarily possibly leading to future crashes. |
|
| Back to top |
|
 |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Tue Jul 22, 2008 1:07 pm Post subject: |
|
|
You have said tomorrow for about 2 weeks now :\ _________________
|
|
| Back to top |
|
 |
Chaosis13 Master Cheater
Reputation: 0
Joined: 14 Aug 2007 Posts: 372
|
Posted: Fri Jul 25, 2008 5:27 pm Post subject: |
|
|
Yeah.... I know. I am really busy with homework... And making my website, and C++ UCE.
But... I guess I will do it when I get back from vacation. 1 more week.
You can just look it up on MSDN... I think. |
|
| Back to top |
|
 |
TraxMate Master Cheater
Reputation: 0
Joined: 01 Mar 2008 Posts: 363
|
Posted: Thu Aug 07, 2008 2:15 pm Post subject: |
|
|
Aren't your vacation over now? . Anyways we still need a GGCRC to be able to use these trainers right? I have my own but i'm getting HAD when I'm injecting it to Maple. |
|
| Back to top |
|
 |
Hieroglyphics I post too much
Reputation: 0
Joined: 06 Dec 2007 Posts: 2007 Location: Your bedroom
|
Posted: Thu Aug 14, 2008 9:12 am Post subject: |
|
|
when is tommorow  _________________
|
|
| Back to top |
|
 |
|