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 


GetModuleBaseName fails on 64-bit processes

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

Joined: 01 Mar 2008
Posts: 363

PostPosted: Tue Jun 15, 2010 8:11 am    Post subject: GetModuleBaseName fails on 64-bit processes Reply with quote

I want to print all processes on a list view but when I call GetModuleBaseName from a 32-bit app it fails to get the base name of 64-bit processes. I know EnumProcesses finds all processes because it reports that 66 processes have been found but there are only about 20 processes that are printed on the list view and all those are 32-bit processes. Anyone know how to make it work on 64-bit processes as well?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Jun 15, 2010 3:43 pm    Post subject: Reply with quote

it's easier to use CreateToolhelp32Snapshot and process32first/process32next and/or module32first/next

also, often a 64-bit process module is located at 100000000
meaning that the 32-bit hmodule value you'll get from EnumProcessModules is 00000000

Alternatively, just compile your app as a 64-bit application itself and it'll work too

_________________
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
TraxMate
Master Cheater
Reputation: 0

Joined: 01 Mar 2008
Posts: 363

PostPosted: Tue Jun 15, 2010 6:40 pm    Post subject: Reply with quote

Do CreateToolhelp32Snapshot with 64-bit processes? I mean if you look at the name of the functions one would think that it just works with 32-bit processes.

And how do I compile it as 64-bit? I'm using VC++ 2010 Express.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Jun 16, 2010 5:52 am    Post subject: Reply with quote

yes, CreateToolhelp32Snapshot works fine in 32-bit apps to get 64-bit processes and modules

------
as for porting to 64-bit(You don't have to, unless you also want to read/write the process memory): Make sure you have the 64-bit build stuff installed, then in the configuration manager create a new platform and select x64

and then spend some time porting the rest of your code to 64-bit as well (e.g ptruint instead of dword's etc...)

_________________
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
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Wed Jun 16, 2010 8:38 am    Post subject: Reply with quote

Here's a good article covering some tips when converting code to x64:
http://www.viva64.com/content/articles/64-bit-development/?f=20_issues_of_porting_C++_code_on_the_64-bit_platform.html&lang=en&content=64-bit-development

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