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 


Export Code List (Advanced Options) Entries

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Sun Aug 18, 2024 1:42 pm    Post subject: Export Code List (Advanced Options) Entries Reply with quote

For a very long time, I have been using Cheat Engine as my main game-hacking tool. And never did I use anything like Ghidra/IDA (Decompiler). I am just an assembly enjoyer. Yes, sick I know, thank you. So to make my life easier using Cheat Engine and not need to go into the code list and check my over 200-entry list to find something manually, I made this script to make my life, and the lives of those like me, easier.

Usage:
code_list(): registers all entries as symbols
code_list(1): exports all entries to a txt file located in the current cheat table directory
code_list(2): registers all entries as symbols and exports them

Code:
local function code_list(type)
  if process == nil then messageDialog("Make sure you attach to the target process first", 2) return end
  local code_list
  local process_name = process:gsub("%.exe$","")
  local file_name = process_name.." - Code List.txt"
  local file_dir = getMainForm().OpenDialog1.InitialDir
  local file_path = file_dir..file_name
  local separator = "    -    "
  if file_dir == "" then messageDialog("Make sure you open a cheat table first", 2) return end
  for i = 0, getFormCount() do
    if (getForm(i) and getForm(i).name == "AdvancedOptions") then
       code_list = getForm(i);
    end
  end
  if code_list.lvCodelist.Items.Count == 0 then messageDialog("Code list unavailable", 0) return end
  if type == 1 or type == 2 then
    file = io.open(file_path, "w")
    local first_line = "Process: "..process..separator.."Time of creation: "..os.date()..separator.."Total entries: "..code_list.lvCodelist.Items.Count.."\n"
    file:write(first_line)
  end
  for i = 0, code_list.lvCodelist.Items.Count - 1 do
    local item = code_list.lvCodelist.Items[i]
    local index = item.index + 1
    local label = string.match(item.SubItems[0], "^[^:]+")
    local opcode = item.SubItems[0]
    local address = item.Caption
    if type ~= 1 or type == 2 then registerSymbol(label, address) end
    local line = index..separator..address..separator..opcode.."\n\n"
    if file then file:write(line) end
    if (item.name == 'Codelist2') then cl = item end
  end
  if file then file:close() file = nil messageDialog("The code list has been saved successfully\n"..file_path, 2) end
end
Back to top
View user's profile Send private message Visit poster's website
Seedlord
How do I cheat?
Reputation: 0

Joined: 14 Oct 2007
Posts: 1

PostPosted: Thu Aug 29, 2024 7:27 am    Post subject: Reply with quote

thanks. this comes handy.

what do you do if your executable gets updated and the instruction addresses shift by certain offsets?
no way you manually replace 200 entries xD
Back to top
View user's profile Send private message
xxhehe
Expert Cheater
Reputation: 0

Joined: 11 Mar 2015
Posts: 154

PostPosted: Mon Sep 02, 2024 5:00 am    Post subject: Reply with quote

Seedlord wrote:
thanks. this comes handy.

what do you do if your executable gets updated and the instruction addresses shift by certain offsets?
no way you manually replace 200 entries xD

AOB?
Back to top
View user's profile Send private message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Mon Sep 02, 2024 1:18 pm    Post subject: Reply with quote

I have something up my sleeve that I didn't include in the script but I basically, get an AOB signature for every entry when exporting, making it almost impossible to miss
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 -> Cheat Engine Lua Scripting 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