Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


C++ Speedhack help
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
blackmorpheus
Expert Cheater
Reputation: 0

Joined: 05 Apr 2008
Posts: 159

PostPosted: Tue Aug 11, 2009 11:27 am    Post subject: Reply with quote

You defined all the functions, but you didnt actually detour them.
I don't see DllMain too...
Can you show it ?Very Happy
Back to top
View user's profile Send private message
Destrod16
Newbie cheater
Reputation: 0

Joined: 03 Aug 2009
Posts: 21

PostPosted: Tue Aug 11, 2009 4:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
www182
How do I cheat?
Reputation: 0

Joined: 20 Jan 2011
Posts: 1

PostPosted: Thu Jan 20, 2011 3:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8588
Location: 127.0.0.1

PostPosted: Thu Jan 20, 2011 4:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites