 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
blackmorpheus Expert Cheater
Reputation: 0
Joined: 05 Apr 2008 Posts: 159
|
Posted: Tue Aug 11, 2009 11:27 am Post subject: |
|
|
You defined all the functions, but you didnt actually detour them.
I don't see DllMain too...
Can you show it ?
|
|
| Back to top |
|
 |
Destrod16 Newbie cheater
Reputation: 0
Joined: 03 Aug 2009 Posts: 21
|
Posted: Tue Aug 11, 2009 4:32 pm Post subject: |
|
|
Well I might just give up on speedhack, seems as though I'm not ready for it. Also here is the DllMain:
NOTE: ActivateFunctions is the thread for hotkeys.
| Code: | BOOL APIENTRY DllMain(HINSTANCE hDll, DWORD callReason, LPVOID lpReserved)
{
if(callReason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&ActivateFunctions, 0, 0, 0);
//CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&NEWQueryPerformanceCounter, 0, 0, 0);
}
return 1;
} |
I commented the Second Thread since it just crashed the program.
|
|
| Back to top |
|
 |
www182 How do I cheat?
Reputation: 0
Joined: 20 Jan 2011 Posts: 1
|
Posted: Thu Jan 20, 2011 3:00 pm Post subject: |
|
|
please upload your full asm code again it isn't in pastebin anymore
and i want to write a speedhack too but in c++ i have an injector (copy paste) XD it works on notepad.exe but it didn't work in games and i don't know why
| Code: |
bool insertDll(DWORD procID, std::string dll)
{
//Find the address of the LoadLibrary api, luckily for us, it is loaded in the same address for every process
HMODULE hLocKernel32 = GetModuleHandle("Kernel32");
FARPROC hLocLoadLibrary = GetProcAddress(hLocKernel32, "LoadLibraryA");
//Adjust token privileges to open system processes
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
if(OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
{
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tkp.Privileges[0].Luid);
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, 0, &tkp, sizeof(tkp), NULL, NULL);
}
//Open the process with all access
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
//Allocate memory to hold the path to the Dll File in the process's memory
dll += '\0';
LPVOID hRemoteMem = VirtualAllocEx(hProc, NULL, dll.size(), MEM_COMMIT, PAGE_READWRITE);
//Write the path to the Dll File in the location just created
DWORD numBytesWritten;
WriteProcessMemory(hProc, hRemoteMem, dll.c_str(), dll.size(), &numBytesWritten);
//Create a remote thread that starts begins at the LoadLibrary function and is passed are memory pointer
HANDLE hRemoteThread = CreateRemoteThread(hProc, NULL, 0, (LPTHREAD_START_ROUTINE)hLocLoadLibrary, hRemoteMem, 0, NULL);
cout << hRemoteThread << endl;
//Wait for the thread to finish
bool res = false;
if (hRemoteThread)
res = (bool)WaitForSingleObject(hRemoteThread, MAXWAIT) != WAIT_TIMEOUT;
//Free the memory created on the other process
VirtualFreeEx(hProc, hRemoteMem, dll.size(), MEM_RELEASE);
//Release the handle to the other process
CloseHandle(hProc);
return res;
}
|
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8588 Location: 127.0.0.1
|
Posted: Thu Jan 20, 2011 4:14 pm Post subject: |
|
|
| www182 wrote: | please upload your full asm code again it isn't in pastebin anymore
and i want to write a speedhack too but in c++ i have an injector (copy paste) XD it works on notepad.exe but it didn't work in games and i don't know why |
Copy pasting is probably why it doesn't work. Try debugging it and finding out where it fails rather then just begging for source and not learning anything in the process.
_________________
- Retired. |
|
| 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
|
|