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++] Using pointers from Cheat engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Fire218
How do I cheat?
Reputation: 0

Joined: 24 Jan 2013
Posts: 1
Location: Deutschland

PostPosted: Thu Jan 24, 2013 10:08 am    Post subject: [C++] Using pointers from Cheat engine Reply with quote

Hello,

i try to get a Value of a Memory -> Pointer

thats what I do in Cheat Engine:



How do I get this Work in my C++ Function:

Code:
Code:

void _sendchat(char* text)
{
        int ProcessID = 0, Len = strlen(text) + 1;
        for (ProcessID = 0; !ProcessID; ProcessID = GetProcessID("gta_sa.exe"))
                ;
        HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessID);
 
        if (hProcess)
        {
                PVOID cmd = VirtualAllocEx(hProcess, 0, Len, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
                WriteProcessMemory(hProcess, cmd, text, Len, 0);
 
                DWORD func = (DWORD)GetModuleHandleExtern("samp.dll", ProcessID) + 0x4A10;
 
                HANDLE hThread = CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)func, cmd, 0, 0);
 
                DWORD dwExitCode = 0;
                if (hThread)
                {
                        WaitForSingleObject(hThread, INFINITE);
                        GetExitCodeThread(hThread, &dwExitCode);
                }
 
                VirtualFreeEx(hProcess, cmd, Len, MEM_RELEASE);
                CloseHandle(hThread);
        }
        CloseHandle(hProcess);
}


It dont work in this Function, please help...


Thanks
Dennis
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Jan 25, 2013 8:56 pm    Post subject: Reply with quote

Just saying "it doesn't work" isn't going to get you much help here.

Have you tried debugging and finding what is wrong yourself rather then copy paste code and just click run?

_________________
- 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
Page 1 of 1

 
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