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 


[SOLVED!]address changes on different machines

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Fri May 09, 2008 12:16 am    Post subject: [SOLVED!]address changes on different machines Reply with quote

i tried to make a loader for a molebox protected application but the problem is the address that im trying to patch is changing when i run it on other type of machines but on same type machines it works fine. if the address in my machine is 0x00B80E77 and if i tried it on other it becomes 0x00B40E77. it's like 0x00B80E77 -= 40000.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev


Last edited by ShurikeN on Sat May 10, 2008 5:22 pm; edited 3 times in total
Back to top
View user's profile Send private message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Fri May 09, 2008 1:52 am    Post subject: Reply with quote

find the base address?

and have it + with the offset?
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: Fri May 09, 2008 1:29 pm    Post subject: Reply with quote

Sounds like code shifting. You said the address is 0x00B80E77 on your machine, locate the DLL memory space that address is inside of and use the base of it to create an offset.

To locate the base addresses of the DLLs inside the program, open Cheat Engine, open the memory viewer, select View from the menu, and choose 'Enumerate DLLs and Symbols'

Look for something that has an address close to that it should be smaller then that address as well. Something like:

0x00B80000

Then create your offset based on that address by doing:
Address - Base = Offset

Or in this example:

0x00B80E77 - 0x00B80000 = 0xE77

Then for your loader, start by locating the base address first which you can get using:
- CreateToolhelp32Snapshot
- Process32First/Process32Next
- Module32First/Module32Last

Then you would do:

Base + Offset = Address

To obtain the new address on what ever machine you are on.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Fri May 09, 2008 4:30 pm    Post subject: Reply with quote

i love you wiccaan. you've been a big help to me since i started learning. Razz

anyways, is this how i get the base?
Code:

MODULEENTRY32 moddy;
    HANDLE hSnappy = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, pe32.th32ProcessID );
    if( Module32First( hSnappy, &moddy ))
        {
            do{
                if( moddy.modBaseAddr == 0x00B80000 )
                    {
                        CloseHandle( hSnappy );
                        return true;
                    }
              }while( Module32Next( hSnappy, &moddy ));
             
            CloseHandle( hSnappy );
            return false;
        }

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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: Fri May 09, 2008 6:33 pm    Post subject: Reply with quote

Naw. You need to use the name of the module the address is found in. I was only using the address above as an example. Locate the name of the module your address resides in based on its base address and size, then scan using that code for that modules name.

Code:

// .. other code here

// This should be inside the do{ } loop...
if( !_tcscmp( _T("your_dll_name.dll"), me32.szModule ) )
{
   // Found, store the base in me32.modBaseAddr somewhere...
}

// .. other code here

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sat May 10, 2008 4:29 am    Post subject: Reply with quote

aw! i thought i made it work *LOL.

here's the screeny of the enumerated dll's and i found the base but it doesn't look like a name of dll to me, Module32first/Module32next can't detect it.
http://www.geocities.com/cursebox87/SCREENAH.PNG
the value in the middle of MBX@F6C@8227B0 which is F6C is changing everytime the game is restarted.

i think im dealing with a more complicated one.

_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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: Sat May 10, 2008 1:06 pm    Post subject: Reply with quote

That DLL is most likely going to be the one you need. That being said you will need to handle it changing names at random like that. You can compare part of the string using strstr, like this:

Code:
   if( strstr( tszString, "MBX@" ) != 0 )
   {
      // .. String Part Was Found ...
   }


Beings that none of the other DLLs in that list have that in it, it's safe to say that that code will work until they either update the game to a different name or add more DLLs with the same name. Then you could go into deeper things to get the correct DLL.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
ShurikeN
Advanced Cheater
Reputation: 0

Joined: 09 Jan 2008
Posts: 84

PostPosted: Sat May 10, 2008 5:22 pm    Post subject: Reply with quote

cool!! now it's 100% working. thanks thanks.
_________________
Code:
XXXXXX      XXXXXX
   XXXXX  XXXXX
     XXXXXXXX
    D I R E C T
     XXXXXXXX
   XXXXX  XXXXX
XXXXXX      XXXXXX
      GameDev
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