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 


Problem by finding Base Address

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

Joined: 02 Dec 2013
Posts: 2

PostPosted: Mon Dec 02, 2013 3:51 pm    Post subject: Problem by finding Base Address Reply with quote

Hello,

i want to find the base address by using c++. Maybe there is any mistake, but there is allways the wrong address:
I get this address 0x01340000 but the right address is 0x66ADB000.

Code:
#include "stdafx.h"
#include <iostream>
#include <windows.h>
#include <TlHelp32.h>
#pragma comment(lib, "user32.lib")
#pragma comment( lib, "psapi" )

using namespace std;

DWORD dwGetModuleBaseAddress(DWORD dwProcessIdentifier, TCHAR *lpszModuleName)
{
   HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessIdentifier);
   DWORD dwModuleBaseAddress = 0;
   if(hSnapshot != INVALID_HANDLE_VALUE)
   {
      MODULEENTRY32 ModuleEntry32 = {0};
      ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
      if(Module32First(hSnapshot, &ModuleEntry32))
      {
         do
         {
            if(_tcscmp(ModuleEntry32.szModule, lpszModuleName) == 0)
            {
               dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;
               break;
            }
         }
         while(Module32Next(hSnapshot, &ModuleEntry32));
      }
      CloseHandle(hSnapshot);
   }
   return dwModuleBaseAddress;
}


Thank you for your help!

Greetings from germany[/code]
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25785
Location: The netherlands

PostPosted: Mon Dec 02, 2013 4:53 pm    Post subject: Reply with quote

0x66ADB000 is an impossible address for a module base. (wrong alignment for a module)
I recommend rechecking what you actually are looking for

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
zm0d
Master Cheater
Reputation: 7

Joined: 06 Nov 2013
Posts: 423

PostPosted: Mon Dec 02, 2013 4:59 pm    Post subject: Reply with quote

Hmmm I'm very tired and my eyes are burning Very Happy but perhaps your flag in CreateToolhelp32Snapshot is wrong (TH32CS_SNAPMODULE).
Are you sure that your error comes from this piece of code? Are you doing any calculation on the the "base address"? Well, I guess you mean your PEB-base-address? How did you find out, that the address is 0x01340000?
If you're using an injected DLL use GetModuleHandle(0) to find your PEB base address. If you're outside the games process, try to debug your application step by step.
Back to top
View user's profile Send private message
rhino-du
How do I cheat?
Reputation: 0

Joined: 02 Dec 2013
Posts: 2

PostPosted: Mon Dec 02, 2013 5:13 pm    Post subject: Reply with quote

I have found 30 addresses in cheat engine that i have to rewrite in unregular periodes in combination with midi signals, but everytime i start the programm they get other addresses.
I don't know how i can get these, like in cheat engine but i have to do this in c++.
Back to top
View user's profile Send private message
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