View previous topic :: View next topic |
Author |
Message |
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Wed Aug 04, 2021 9:14 am Post subject: [Lua] Retrieve path of current attached process |
|
|
Any help would be appreciated. I've tried:
Code: |
extractFilePath(process)
extractFilePath('name_of_game')
|
Thanks in advance.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Wed Aug 04, 2021 10:29 am Post subject: |
|
|
Code: |
enumModules()[1].PathToFile
|
_________________
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 |
|
|
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Wed Aug 04, 2021 10:40 am Post subject: |
|
|
Dark Byte wrote: | Code: |
enumModules()[1].PathToFile
|
|
In addition (a bit dark, but it works)
Zanzer wrote: | Not sure I would trust someone trying to find my installation directory.
Have fun...
local path = io.popen("PowerShell Get-Process -Id "..getOpenedProcessID().." ^| Format-List Path"):read("*all"):gsub("^%s*Path : (.-)%s*","%1"); |
process("cheatengine-x86_64.exe")
result:
C:\Program Files\Cheat Engine 7.2\cheatengine-x86_64.exe
EDIT:
DB's suggestion is more stable and does not require additional options (cmd blackout etc).
Thanks DarkByte, I'll add this to my code list.
|
|
Back to top |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1055 Location: 0x90
|
Posted: Wed Aug 04, 2021 10:53 am Post subject: |
|
|
@DB,
Thanks! Something so small yet had me scratching my head for a while.
@ByTransient,
Nevertheless, it's always good to have multiple ways of achieving the same result.
I learned some new tricks today
|
|
Back to top |
|
|
|