| View previous topic :: View next topic |
| Author |
Message |
aeree Cheater
Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
Posted: Mon Oct 07, 2013 9:31 am Post subject: DLL injection problem |
|
|
When I try to inject my code into a game nothing happens. I doesn't crash and I doesn't seem to run any of my code. What am I doing wrong?
| Code: |
#include <windows.h>
DWORD WINAPI Thread(LPVOID unused)
{
int *foo;
foo = (int *)0x30100;
MessageBoxA(0,"Something happened","yay",0);
while(true)
{
if(GetAsyncKeyState('X'))
{
foo+= 2;
Sleep(250);
}
Sleep(10);
}
}
void poo()
{
MessageBoxA(0,"Didn't work too well","nope",0);
}
BOOL WINAPI DllMain(HINSTANCE mod, DWORD DWORD_GRUND, LPVOID res)
{
switch(DWORD_GRUND)
{
case DLL_PROCESS_ATTACH:
CreateThread(0, 0, &Thread , 0, 0, 0);
break;
case DLL_PROCESS_DETACH:
poo();
break;
}
return true;
}
|
_________________
1 + 1 = |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Mon Oct 07, 2013 9:55 am Post subject: |
|
|
you need to give the address of Thread, not the address to the address of thread
so try:
| Code: |
CreateThread(0, 0, Thread , 0, 0, 0);
|
_________________
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 |
|
 |
aeree Cheater
Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Mon Oct 07, 2013 10:01 am Post subject: |
|
|
is the source filename .C or .CPP?
If .CPP I recommend changing it to .C or mess around with headers that tell not to obfuscate symbol names
_________________
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 |
|
 |
aeree Cheater
Reputation: 3
Joined: 23 Jan 2010 Posts: 42 Location: Germany
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
| Back to top |
|
 |
|