N00b hax: OpenProcess access denied
So basically I've written a Combat Arms hack DLL. I'm having trouble injecting it. If I use the injector I wrote, I get "error 5" which is Access Denied after calling OpenProcess. Yes, I have enabled the SeDebug privilege for my process. If I use FInject, CA closes right after I start it (hackshield detected it maybe)?
Anyway here is my code although it probably doesn't matter since the problem is in injection:
Any ideas?
Tekk
Offtopic: This community really needs to reinstate its IRC channel.
Anyway here is my code although it probably doesn't matter since the problem is in injection:
Code:
#include <windows.h>
void PushToConsole(const char* szCommand)
{
MessageBox(NULL, "PTC", "", MB_ICONINFORMATION);
HMODULE hMod = GetModuleHandleA("CShell.dll");
if(hMod != NULL) {
DWORD *LTClient = (DWORD *)(0x377E7810);
void* CONoff = (void *) *(DWORD *)(*LTClient + 0x208);
asm("pushl %0" :: "r"(szCommand));
asm("call *%0" :: "r"(CONoff));
asm("addl $4, %esp");
}
}
DWORD WINAPI HaxThreadProc(LPVOID lpParam)
{
while(1) {
if(GetAsyncKeyState(VK_F12) & 1)
PushToConsole("ShowFps 1");
Sleep(100);
}
return 0;
}
BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
{
if(dwReason == DLL_PROCESS_ATTACH) {
MessageBox(NULL, "DLL injected and running", "Success", MB_ICONINFORMATION);
CreateThread(NULL, 0, HaxThreadProc, NULL, 0, NULL);
}
return TRUE;
}
Tekk
Offtopic: This community really needs to reinstate its IRC channel.

