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 


Loading DWARF debug information?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Smellyhobo101
Newbie cheater
Reputation: 0

Joined: 21 Sep 2014
Posts: 23

PostPosted: Wed Feb 21, 2018 8:57 pm    Post subject: Loading DWARF debug information? Reply with quote

I've been working on modding this game called "Remnants of Naezith". Cheat Engine doesn't find any debug symbols for the game, but when I open up the exe in IDA it detects and loads "DWARF debug information". That provides all the function names and lots of variable names. Is there any way I can get CE to load this information? I can use IDA to generate a .map file that contains all the symbols, but CE doesn't load it when I set the symbol search path. The .map file contains all the symbols in a big list like this:

Code:
 
 00000001:0000000000118070       Player::flipAnimation(Animation &,int)
 00000001:00000000001181D0       Player::spawnPlayer(void)
 00000001:00000000001182B0       Player::addMSx(float)
 00000001:00000000001183D0       Player::addMS(sf::Vector2<float>)
 00000001:0000000000118400       Player::moveRight(void)
 00000001:0000000000118600       Player::moveLeft(void)
 00000001:0000000000118830       Player::applyFriction(void)
 00000001:00000000001188B0       Player::addMSy(float)
 00000001:00000000001188D0       Player::setMS(sf::Vector2<float>)
 00000001:0000000000118930       Player::setMSx(float)


I'm considering writing a LUA script that will parse this file and register all the symbols automatically, but before I do that I figured I would ask here if CE supports some way of loading these symbols already?

Thanks.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Feb 22, 2018 12:16 am    Post subject: Reply with quote

no, ce doesn't support DWARF at the moment (i havn't seen it used in windows often)

but if you use lua i suggest looking into the "SymbolList" class (createSymbolList()) and just fill it with the map info

_________________
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
Smellyhobo101
Newbie cheater
Reputation: 0

Joined: 21 Sep 2014
Posts: 23

PostPosted: Thu Feb 22, 2018 5:01 am    Post subject: Reply with quote

That worked great, thanks.

For anyone else that is working with DWARF debug data, you can use this auto assembler script to import it:

Code:

[ENABLE]

{$lua}

-- see if the file exists
local function file_exists(file)
  local f = io.open(file, "rb")
  if f then f:close() end
  return f ~= nil
end

-- get all lines from a file, returns an empty
-- list/table if the file does not exist
local function lines_from(file)
  if not file_exists(file) then return {} end
  lines = {}
  for line in io.lines(file) do
    lines[#lines + 1] = line
  end
  return lines
end

-- this pattern captures the name, location, and size from each line.
-- Example line: AIManager::AIManager(void)\t.text\t0000000000401D60\t00000E6A\t(bunch of other junk)
-- psuedo pattern: (everything_not_tab) + "\teverything_not_tab\t" + (hex_number) + "\t" + (hex_number)
local pattern = "([^\t]+)" .. "\t[^\t]+\t" .. "(%x+)" .. "\t" .. "(%x+)"

-- Get table containing lines of text from "IDA_functions.txt"
local file = TrainerOrigin.."IDA_functions.txt"
local lines = lines_from(file)

sl = createSymbolList()

-- Iterate through the lines in the map file
for k,v in pairs(lines) do

  -- Capture the section, offset, and symbol name
  local name, location, size = string.match(v, pattern)

  local location = tonumber("0x" .. location)
  local size = tonumber("0x" .. size)

  sl.addSymbol(process, name, location, size)

end

sl.register()

{$asm}

[DISABLE]

{$lua}

sl.unregister()
sl = nil

{$asm}


Just copy/paste all the functions from the functions window in IDA into a file named IDA_functions.txt in your cheat table directory.[/quote]
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