View previous topic :: View next topic |
Author |
Message |
SparkleArts How do I cheat? Reputation: 0
Joined: 11 Dec 2020 Posts: 7 Location: Germany
|
Posted: Tue Apr 23, 2024 12:16 pm Post subject: Get Path of a Exe File? |
|
|
I want to check in my Cheat Table for XCOM 2 WOTC on start up if you installed Steam and get the Path Location of it.
From there I want to get the Path of the XCOM 2 WOTC Exe file.
Why you ask?
Because Vanilla XCOM 2 and XCOM 2 WOTC (the dlc) uses the exact same Process Name.
Could someone help me with that?
_________________
Call me KitsuneHD because I'm a cute Kitsune, lol. |
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4317
|
Posted: Tue Apr 23, 2024 12:47 pm Post subject: |
|
|
celua.txt:
Quote: | enumModules(processid OPTIONAL):
Returns a table containing information about each module in the current process, or the specified processid
Each entry is a table with fields
Name : String containing the modulename
Address: Integer representing the address the module is loaded
Is64Bit: Boolean set to true if it's a 64-bit module
PathToFile: String to the location this module is loaded
| Probably what you're looking for
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 33
Joined: 16 Feb 2017 Posts: 1289
|
Posted: Wed Apr 24, 2024 3:59 am Post subject: |
|
|
Once the process is selected, run this code:
Code: | processFullPath = enumModules()[1].PathToFile -- path + process.exe
processPath = extractFilePath(processFullPath) -- path
print("Full path: \n"..processFullPath)
print("Path: \n"..processPath) |
or ..
Code: | -- select process auto (process; max memory)
function open_process(pname,pmem)
local p = io.popen('tasklist.exe /fi "IMAGENAME eq '..pname..'.exe" /fi "MEMUSAGE gt '..pmem..'" /nh', 'r');
local procInfo = p:read('*a');
local pid = procInfo:match(' (%d+) ');
pid = tonumber(pid);
if(pid == nil)then
messageDialog("You Must Start The Game First!", mtWarning, mbOK)
--closeCE()
else
openProcess(pid)
--print(pid)
end
end
pname = "cheatengine-x86_64"
pmem = 30000 -- When you open the application, it appears in the application's memory in the task manager.
open_process(pname,pmem) |
_________________
|
|
Back to top |
|
|
SparkleArts How do I cheat? Reputation: 0
Joined: 11 Dec 2020 Posts: 7 Location: Germany
|
Posted: Wed Apr 24, 2024 10:48 am Post subject: |
|
|
How is it working with the Path Locations?
I mean do I need to specify for example the Hard Disk Letter like "C:" or it will automatically detect it?
Also is there a way to find automatically a process on the entire hard disk where Cheat Engine is installed? I don't want to open Steam Process anyway so. Is there a way without it?
_________________
Call me KitsuneHD because I'm a cute Kitsune, lol. |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 33
Joined: 16 Feb 2017 Posts: 1289
|
Posted: Wed Apr 24, 2024 2:35 pm Post subject: |
|
|
Code: | function executablePath(appName,ops)
local res = ""
if ops==1 then
aa = io.popen([[where ]]..appName)
res = aa:read('*a');
elseif ops==2 then
aa = io.popen([[where *]]..appName)
res = aa:read('*a');
elseif ops==3 then
aa = extractFileExt(appName)
aa1 = io.popen([[where *]]..aa)
aa2 = aa1:read('*a');
sl = createStringList()
sl.Text=aa2
for i=0, sl.count -1 do
aa3 = extractFileName(sl[i])
if aa3==appName then
res = sl[i]
end
end
sl.Destroy()
end
return res
end |
Use:
Ops 1 ) If you know the executable file name, use it. (Limited options!)
Code: | pname1 = "cheatengine-x86_64"
aa22 = executablePath(pname1,1)
aa23 = aa22:sub(1,2) -- C:
print("system disc:\n"..aa23.."\nexecutablePath:\n"..aa22) |
Ops 2 ) (Extra feature, for those who want it) Just give the file extension and get an associated list. (.xml, .jpg, .txt, .exe etc.)
Code: | pname1 = ".exe"
aa22 = executablePath(pname1,2)
--aa23 = aa22:sub(1,2) -- C:
print("Path:\n"..aa22) |
Ops 3 ) Give the associated file name with its extension and scan all system files and view the result. (Wide range of options!)
Code: | pname1 = "Skype.exe"
aa22 = executablePath(pname1,3)
aa23 = aa22:sub(1,2) -- C:
print("system disc:\n"..aa23.."\nexecutablePath:\n"..aa22) |
_________________
|
|
Back to top |
|
|
|