View previous topic :: View next topic |
Author |
Message |
PsychicSymphony Newbie cheater
Reputation: 0
Joined: 17 May 2011 Posts: 13 Location: Ontario
|
Posted: Wed May 25, 2011 4:42 pm Post subject: [Help] Exporting addresses like "Exe.exe"+02583 in |
|
|
Ok so I have this auto assembly script in cheat engine.
Its a code injection script and its pretty simple I just have one problem. Im exporting it into inline asm in c++(__asm) and you cant use the "Whatever.exe"+04832: like in auto assembly. How do you use it in c++?
_________________
Psychic Symphony
////
// //
// //
//// |
|
Back to top |
|
 |
Innovation Grandmaster Cheater
Reputation: 12
Joined: 14 Aug 2008 Posts: 617
|
Posted: Wed May 25, 2011 6:24 pm Post subject: |
|
|
Get the module's base address, and add the offset to it.
Code: | #include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>
DWORD_PTR dwGetModuleBaseAddress(DWORD dwProcessIdentifier, TCHAR *szModuleName)
{
DWORD_PTR dwModuleBaseAddress = 0;
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, dwProcessIdentifier);
if (hSnapshot != INVALID_HANDLE_VALUE)
{
MODULEENTRY32 ModuleEntry32;
ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
if (Module32First(hSnapshot, &ModuleEntry32))
{
do
{
if (_tcsicmp(ModuleEntry32.szModule, szModuleName) == 0)
{
dwModuleBaseAddress = (DWORD_PTR)ModuleEntry32.modBaseAddr;
break;
}
}
while (Module32Next(hSnapshot, &ModuleEntry32));
}
CloseHandle(hSnapshot);
}
return dwModuleBaseAddress;
} |
Last edited by Innovation on Fri Mar 08, 2013 9:12 pm; edited 5 times in total |
|
Back to top |
|
 |
PsychicSymphony Newbie cheater
Reputation: 0
Joined: 17 May 2011 Posts: 13 Location: Ontario
|
Posted: Wed May 25, 2011 6:56 pm Post subject: |
|
|
How do you get the offset?
_________________
Psychic Symphony
////
// //
// //
//// |
|
Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Thu May 26, 2011 5:42 pm Post subject: |
|
|
The offset is what it is +
|
|
Back to top |
|
 |
steebchen How do I cheat?
Reputation: 0
Joined: 06 Dec 2013 Posts: 5
|
Posted: Fri Dec 06, 2013 3:28 pm Post subject: Code doesn't work |
|
|
Hi, when I use the code Innovation posted, I get an error in Visual Basic, that there is an ";" missing. When I add it, the message hides, but another two display:
"The identifier is not defined" (I translated this, so it may be not the exact error msg). 1. for dwProcessIdentifier, 2. for szModuleName.
I'm using Visual Studio Express 2013, and I also put the includes in my code.
Last edited by steebchen on Sun Dec 08, 2013 8:08 am; edited 1 time in total |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Dec 06, 2013 3:52 pm Post subject: Re: Code doesn't work |
|
|
steebchen wrote: | Hi, when I use the code Innovation posted, I get an error in Visual Basic, that there is an ";" missing. When I add it, the message hides, but another two display:
"The identifier is not defined" (I translated this, so it may be not the exact error msg). 1. for dwProcessIdentifier, 2. for szModuleName.
I'm using Visual Basic Express 2013, and I also put the includes in my code. |
That is because it is not Visual Basic code, it is C++.
_________________
- Retired. |
|
Back to top |
|
 |
steebchen How do I cheat?
Reputation: 0
Joined: 06 Dec 2013 Posts: 5
|
Posted: Fri Dec 06, 2013 4:35 pm Post subject: |
|
|
I use C++.
Edit:
Problem almost solved.
I put it in main(), instead of before main.
|
|
Back to top |
|
 |
steebchen How do I cheat?
Reputation: 0
Joined: 06 Dec 2013 Posts: 5
|
Posted: Sun Dec 08, 2013 8:08 am Post subject: |
|
|
And which values / variables I have to put in the function call?
Can you give me an example?
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Dec 08, 2013 1:15 pm Post subject: |
|
|
steebchen wrote: | And which values / variables I have to put in the function call?
Can you give me an example? |
Perhaps you need to stop and actually learn the language. Copy pasting things and then asking for help every time you get a compile error is not the way to go about making a cheat or learning a language.
_________________
- Retired. |
|
Back to top |
|
 |
omoe Grandmaster Cheater
Reputation: 8
Joined: 11 Jun 2013 Posts: 547
|
Posted: Sun Dec 08, 2013 2:23 pm Post subject: |
|
|
steebchen wrote: | And which values / variables I have to put in the function call?
Can you give me an example? |
I started learning c++ 5 days ago but i think this is how you use it .
dwGetModuleBaseAddress(DWORD dwProcessIdentifier, TCHAR *szModuleName) ;
replace - with
DWORD dwProcessIdentifier = Process id
TCHAR *szModuleName= the name of the module you want to get the base for . e.g. Whatever.exe
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
omoe Grandmaster Cheater
Reputation: 8
Joined: 11 Jun 2013 Posts: 547
|
Posted: Mon Dec 09, 2013 4:01 pm Post subject: |
|
|
Stylo wrote: | 5 days of learning C++ must be good enough for messing around with virtual memory..
I'd suggest you go back and make some effort before jumping around screwing whatever is executed  |
Was my answer wrong or something ? .
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
steebchen How do I cheat?
Reputation: 0
Joined: 06 Dec 2013 Posts: 5
|
Posted: Tue Dec 10, 2013 8:25 am Post subject: |
|
|
Got it now, thank you.
|
|
Back to top |
|
 |
|