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 


Find the entry point of a DLL within an exe using ReadProces

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
SwaggaJackin'
Master Cheater
Reputation: 2

Joined: 06 Nov 2009
Posts: 312

PostPosted: Fri Dec 30, 2011 9:58 pm    Post subject: Find the entry point of a DLL within an exe using ReadProces Reply with quote

How does one find the address of the entry point of a DLL within a process using ReadProcessMemory API?

Obviously I need to do this because the entry point is dynamic and is needed for a pointer.

Similar to how cheat engine works with a pointer

"mydll.dll + 0x00000000"

How do I find the address of my.dll within the exe using ReadProcessMemory?

Application and DLL are x64 if that matters.

Thanks.
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sat Dec 31, 2011 5:52 am    Post subject: Reply with quote

you simply can't.


Instead use these (check msdn for info)

CreateToolhelp32Snapshot
Process32First / Process32Next
Module32First / Module32Next
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Dec 31, 2011 8:34 am    Post subject: Reply with quote

You could use EnumProcessModulesEx for the specific process and right after use GetModuleInformation for your module,
in which case you'll have all the info you need inside the MODULEINFO Structure.

_________________
Stylo
Back to top
View user's profile Send private message
SwaggaJackin'
Master Cheater
Reputation: 2

Joined: 06 Nov 2009
Posts: 312

PostPosted: Sat Dec 31, 2011 5:16 pm    Post subject: Reply with quote

NoMercy wrote:
you simply can't.


Instead use these (check msdn for info)

CreateToolhelp32Snapshot
Process32First / Process32Next
Module32First / Module32Next


I looked into those, but wasn't sure they'd work for 64-bit.

Stylo wrote:


You could use EnumProcessModulesEx for the specific process and right after use GetModuleInformation for your module,
in which case you'll have all the info you need inside the MODULEINFO Structure.



Thanks. I'll check that out.
Back to top
View user's profile Send private message
NoMercy
Master Cheater
Reputation: 1

Joined: 09 Feb 2009
Posts: 289

PostPosted: Sun Jan 01, 2012 6:32 pm    Post subject: Reply with quote

I don't see any reason why it should not work on 64 bit
Back to top
View user's profile Send private message
Pasukaru
How do I cheat?
Reputation: 0

Joined: 15 Dec 2011
Posts: 8

PostPosted: Sun Jan 01, 2012 10:05 pm    Post subject: Reply with quote

forum.cheatengine.org/viewtopic.php?p=5306732#5306732
:>

the module in your case is the DLL of course. Laughing
Back to top
View user's profile Send private message
SwaggaJackin'
Master Cheater
Reputation: 2

Joined: 06 Nov 2009
Posts: 312

PostPosted: Sun Jan 01, 2012 10:27 pm    Post subject: Reply with quote

NoMercy wrote:
I don't see any reason why it should not work on 64 bit


I'm not quite sure, but they all state 32 in their name, usually 64-bit version api's have 'Ex' appended to them.

Perhaps I'm wrong....*shrug*
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Sun Jan 01, 2012 10:34 pm    Post subject: Reply with quote

SwaggaJackin' wrote:
NoMercy wrote:
I don't see any reason why it should not work on 64 bit


I'm not quite sure, but they all state 32 in their name, usually 64-bit version api's have 'Ex' appended to them.

Perhaps I'm wrong....*shrug*


The 'Ex' part of APIs aren't specifically for 64bit. They are just extended versions of the API to allow more specific parameters to be used for extended (hence the 'Ex') usage.

Just be sure to read through the pages for each API regarding their 64bit usability, or anything extra you may need to do/call.

CreateToolhelp32Snapshot for example:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682489%28v=vs.85%29.aspx

Note that you can use the QueryFullProcessImageName function to retrieve the full name of an executable image for both 32- and 64-bit processes from a 32-bit process.

_________________
- 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