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 


Why I get different address in CE and python scripts

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

Joined: 25 Feb 2022
Posts: 3

PostPosted: Fri Feb 25, 2022 1:23 pm    Post subject: Why I get different address in CE and python scripts Reply with quote

I'm trying to convert a pointer with offset in CE into python scripts, using pymem.

However the first base address of xxx.dll is different.
In ce, it looks like: xxx.dll + 0x 040DF480 = 0x 24FF2830A80
0x 24FF2830A80 + 0x 80 = 0x 24FF2830B00
[0x 24FF2830B00] = 100 (the right value)

IN python: I use pymem to locate the dll
pm = pymem.Pymem("abc.exe")
baseAddress = pymem.process.module_from_name(pm.process_handle, "xxx.dll").lpBaseOfDll

but it return baseaddress of xxx.dll is 0x7ffccac40000
They're totally different.

I lookup win's docs, it said the function return the load address of dll, not main function address? could It be the reason?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Feb 25, 2022 2:28 pm    Post subject: Reply with quote

it's the difference between an address and a value.

Looks like you're applying the math on the address and not the value of the address

_________________
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
ecc72
How do I cheat?
Reputation: 0

Joined: 25 Feb 2022
Posts: 3

PostPosted: Fri Feb 25, 2022 8:45 pm    Post subject: Reply with quote

Oh. Thanks.
Suddenly, I know the reason after reading your words.
It's exactly address and value.
I didn't realized that the first offset from dll is also a pointer before.
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