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 


enumModules failed?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 159

PostPosted: Tue Oct 12, 2021 8:34 am    Post subject: enumModules failed? Reply with quote

Code:



local pid = getProcessIDFromProcessName('calc.exe')
modules = enumModules(pid)
print(modules)




When I execute the above lua script, there is no output, maybe my approach is wrong? Help :oops:
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Tue Oct 12, 2021 9:16 am    Post subject: Reply with quote

instead of
Code:

print(modules)

do
Code:

return modules


in lua engine

_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Tue Oct 12, 2021 9:17 am    Post subject: Reply with quote

You're passing the filename rather than the name of the process. This will return the process ID of the name if it matches 'Calculator':
Code:

local pid = getProcessIDFromProcessName('Calculator')
local modules = enumModules(pid)
print(pid)
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Tue Oct 12, 2021 3:57 pm    Post subject: Reply with quote

Dark Bytes suggestion will print part of the table but does cut itself off if there are more than a handful of entries. You can also iterate the returned tables and dump it manually, such as something like this:

Code:

for _, v in pairs(enumModules(getProcessIDFromProcessName('calc.exe'))) do
    for kk, vv in pairs(v) do
        print(string.format('%s - %s', kk, vv));
    end
    print('--');
end

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

Joined: 22 Jan 2019
Posts: 159

PostPosted: Tue Oct 12, 2021 7:12 pm    Post subject: Reply with quote

Thank you for your help, it is already working :)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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