View previous topic :: View next topic |
Author |
Message |
Game Hacking Dojo Master Cheater
Reputation: 1
Joined: 17 Sep 2023 Posts: 250
|
Posted: Wed Oct 04, 2023 5:23 pm Post subject: Imporve Enumerate DLL's and Symbols window PLZ |
|
|
Enumerate DLLs and Symbols is a great feature. But finding a call in it is a huge pain. The search function is very limited and I know how hard it is to implement a better search engine but can we at least have the ability to export the entire output and/or the ability to only export calls of a single binary as text?
I don't know of any other software to give this information. Is it possible to use x64dbg (I use it already but IDK if it has such a feature) to see the calls the way Cheat Engine represents them (to show the original calls' names)? |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Wed Oct 04, 2023 7:58 pm Post subject: |
|
|
export main symbols:
Code: | local savedialog = createSaveDialog()
savedialog.Title = 'Save Symbols'
savedialog.DefaultExt = '.txt'
savedialog.Filter = 'textfiles (*.txt)|*.txt'
savedialog.Options = '[ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]'
function exportMainSymbols()
local sd_result = savedialog.Execute()
if not sd_result then return end
local filename = savedialog.FileName
if not filename or filename == '' then return end
local t = {}
for k,v in pairs(getMainSymbolList().getSymbolList()) do
t[#t+1] = { address = v, name = k }
end
table.sort(t, function(lhs, rhs) return lhs.address < rhs.address end)
local sl = createStringList()
for _,sym in ipairs(t) do
sl.add(('%08X: %s'):format(sym.address, sym.name))
end
local saveResult = sl.saveToFile(filename)
sl.destroy()
if not saveResult then
showMessage('Could not save to file '..filename)
end
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Game Hacking Dojo Master Cheater
Reputation: 1
Joined: 17 Sep 2023 Posts: 250
|
Posted: Thu Oct 05, 2023 8:35 am Post subject: |
|
|
How do I find the file?
Although I have zero knowledge of Lua, I think I should expect either an error message or a window to save the file. However, neither of them happened using the Lua engine.
Or do I have to fill anything in?
I'm sorry but I'm really noobie when it comes to using Lua. So if you give me a little bit more detail, that would be great.
Thanks in advance |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Thu Oct 05, 2023 10:03 am Post subject: |
|
|
All you do is call the function.
This is how a function is defined:
Code: | function exportMainSymbols()
...
end |
And this is how a function is called:
Code: | exportMainSymbols() |
If you just need this for one specific game, put the code in my first post into the table's Lua script, execute it once, and call the function manually from the Lua engine. Otherwise, try putting it in a new .lua file in the autorun folder (it might be required to lazily initialize `savedialog`). Also maybe do some GUI shenanigans to add it as a menu item to the relevant form. _________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Game Hacking Dojo Master Cheater
Reputation: 1
Joined: 17 Sep 2023 Posts: 250
|
Posted: Fri Oct 06, 2023 1:21 am Post subject: |
|
|
Thank you that was very helpful. I made a Lua extension for it now.
Sorry, I couldn't include my code here because the website thinks I'm including URLs in my code.
But anytime I close the popup window without specifying a location it opens Cheat Engine's dir. Can we fix that?
And in case I want to put this option under the "Table" tab what should I do? I tried using "miTable" instead of "Edit3" but it didn't work.
How can I make my own tab and put this extension in it? |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Fri Oct 06, 2023 12:08 pm Post subject: |
|
|
You shouldn't copy and paste code from the internet without at least trying to understand what it does.
Don't execute the code in a separate thread. Accessing the GUI from anything other than the main thread is bad.
No need for pcall. My code shouldn't throw errors, and if it does, CE uses lua_pcall and ignores them.
Why shellExecute? There's absolutely no reason for it. My function doesn't even return anything to execute.
Modifying menu items under the "Table" menu is a bad idea as it's managed by CE.
Append this to the code in my first post:
Code: | local miExtensions = MainForm.findComponentByName'miLuaExtensions'
if not miExtensions then
miExtensions = createMenuItem(MainForm)
miExtensions.Name = 'miLuaExtensions'
miExtensions.Caption = 'Lua Extensions'
MainForm.Menu.Items.insert(MainForm.Menu.Items.Count - 1, miExtensions)
end
local mi = createMenuItem(MainForm)
mi.Name = 'miExportSymbols'
mi.Caption = 'Export Symbols'
mi.OnClick = exportMainSymbols
miExtensions.add(mi) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
Game Hacking Dojo Master Cheater
Reputation: 1
Joined: 17 Sep 2023 Posts: 250
|
Posted: Fri Oct 06, 2023 1:28 pm Post subject: |
|
|
Thank you so much it worked like a charm.
Since, I have zero idea about Cheat Engine extensions and Lua. I had to find something similar that I could modify to make my script work.
I don't know, but I feel like asking these questions is annoying to you guys. So I try to improvise and research a bit before asking. I would love to learn more about it if there is any documentation on Cheat Engine Lua Engine. There are many things that Cheat Engine could imporve upon and with the ability to make extensions, I could improve it without the need to wait for updates. I just wish Cheat Engine was made in C++. Anyway, thanks again. |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Fri Oct 06, 2023 2:53 pm Post subject: |
|
|
If it's annoying, I just won't bother answering in the first place. You're fine.
The CE wiki has some basic information available. The file `celua.txt` contains sporadic documentation on most of CE's Lua API. For specific details, I'll read CE's source code.
CE uses Lua 5.3; documentation is available here:
http://www.lua.org/manual/5.3/contents.html#contents _________________
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: 37
Joined: 16 Feb 2017 Posts: 1522
|
Posted: Fri Oct 06, 2023 7:41 pm Post subject: |
|
|
I added two edits to the existing code.
1) You can write the file name you want to open for recording in the section I specified in the code. When the code runs, the folder you added will open.
2) If the registration is cancelled, the CE folder will not be opened.
If you want the CE folder to be opened in case of cancellation, the previous code is valid and used.
EDIT (V2)
3) CE >> Added to table menu!
4) Hotkey added. (You can edit it according to your choice.)
Code: |
local savedialog = createSaveDialog()
savedialog.Title = 'Save Symbols'
savedialog.InitialDir = [[C:\Users\YourFolderName]]
savedialog.DefaultExt = '.txt'
savedialog.Filter = 'textfiles (*.txt)|*.txt'
savedialog.Options = '[ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]'
function exportMainSymbols()
local sd_result , err = savedialog.Execute(), "Not save"
if not sd_result then
return err
else
local filename = savedialog.FileName
if filename==nil or filename == '' then return false end
local t = {}
for k,v in pairs(getMainSymbolList().getSymbolList()) do
t[#t+1] = { address = v, name = k }
end
table.sort(t, function(lhs, rhs) return lhs.address < rhs.address end)
local sl = createStringList()
for _,sym in ipairs(t) do
sl.add(('%08X: %s'):format(sym.address, sym.name))
end
local saveResult = sl.saveToFile(filename)
sl.destroy()
if not saveResult then
showMessage('Could not save to file '..filename)
end
end
end
local ExtractSymbolsName = 'miExtractSymbols'
local ExtractSymbolsCaption = '&Extract Symbols'
if not newItem then
newItem = createMenuItem(MainForm)
newItem.Caption = translate('Extract Symbols') --caption
newItem.OnClick = exportMainSymbols --onClick
newItem.Shortcut = 'CTRL+S'
MainForm.miTable.insert(5,newItem)
else
newItem.Caption = translate('Extract Symbols') --caption
newItem.OnClick = exportMainSymbols --onClick
newItem.Shortcut = 'CTRL+S'
end |
_________________
|
|
Back to top |
|
 |
Game Hacking Dojo Master Cheater
Reputation: 1
Joined: 17 Sep 2023 Posts: 250
|
Posted: Thu Oct 12, 2023 6:28 am Post subject: |
|
|
I'm working on a different game and had an issue with the script. Although, the game's interesting functions are in the main PE file. When I use the script it exports some of the libraries randomly and consistently (Always with the same results).
When I execute the script I make sure the symbols window has populated all the entries beforehand.
Mr ParkourPenguin could you please help me fix the script and make it export every single element? So I could use it for games that are not main-centric.
Thanks |
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4702
|
Posted: Thu Oct 12, 2023 9:59 am Post subject: |
|
|
I don't know which symbols you're missing, but there's no easy way to get them right now. This is the only function I can find that iterates over symbols:
Quote: | getMainSymbolList(): Returns the symhandler internal symbol list (Note: This does not contain .net, modulelist, or other info) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
|