Results 1 to 4 of 4

Thread: IDA function naming

  1. #1
    scknight
    Guest

    IDA function naming

    This seems like a dumb question but I cant seem to figure it out. I've tried looking through IDA help and searching on the web. I looking at an app written in C++. I've identified certain classes based on RTTI information and now I want to start naming methods of the classes. My problem is if I name a function 'AClass::Somemethod' IDA then displays it as AClass__Somemethod. However the standard MFC classes show up named with the colons in the name. Am I doing something wrong when naming these methods?
    I promise that I have read the FAQ and tried to use the Search to answer my question.

  2. #2
    Registered User
    Join Date
    Jul 2007
    Posts
    107
    Blog Entries
    6
    Have you tried setting the option Demangled names to names rather than commentary?

    It will change this:
    Code:
    call    ?GetDlgItemTextA@CWnd@@QBEHHPADH@Z ; CWnd::GetDlgItemTextA(int,char *,int)
    into this:
    Code:
    call    CWnd::GetDlgItemTextA(int,char *,int)
    From the IDA 5.1 help file:
    You can set how demangled C++ names must be represented:

    - as comments. this representation allows you to obtain
    recompilable source text
    - instead of mangled names. this representation makes the output
    more readable. the disadvantage is that you can't recompile the
    output
    - don't display demangled names.
    TiGa
    Programming today is a race between software engineers to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots.
    So far, the Universe is winning.

  3. #3
    Master Of Nebulah Frost Polaris's Avatar
    Join Date
    Jun 2002
    Location
    Invincible Cyclones Of FrostWinds
    Posts
    221
    Quote Originally Posted by scknight
    This seems like a dumb question but I cant seem to figure it out. I've tried looking through IDA help and searching on the web. I looking at an app written in C++. I've identified certain classes based on RTTI information and now I want to start naming methods of the classes. My problem is if I name a function 'AClass::Somemethod' IDA then displays it as AClass__Somemethod. However the standard MFC classes show up named with the colons in the name. Am I doing something wrong when naming these methods?

    Not a dumb question at all Basically IDA handles each item in its DB in its own way. This applies also to names you write, of course. By default, IDA prevents you to use some chars in some items probably to avoid confusion: if one of this characters is encountered, IDA replaces it with an underscore, like in your example.

    In order to fix this (just for user-names) open your ida.cfg file, and look for the declaration of NameChars: this string contains all the characters that will be displayed in the user defined names. Just add there what you need. To add the ':':

    NameChars =
    "$?@" // asm specific character
    "_0123456789"
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    "abcdefghijklmnopqrstuvwxyz:";
    Good luck!
    Stand In The Fog With So Cold A Heart... Watching The Death Of The Sun...

  4. #4
    This is an old thread, but it has useful information.

    I think the ideal way is to create a mangled name your self, then let IDA display it as it wants to do.
    This is what igorsk does in his RTTI scripts.
    Code:
    MakeName(a,"??_7"+name+"@@6B@");
    Then no need for messing with "NameChars", etc. :-)

Similar Threads

  1. bad function
    By blowfrank in forum The Newbie Forum
    Replies: 2
    Last Post: December 15th, 2010, 08:10
  2. KAV malware naming issue (funny)
    By cEnginEEr in forum Malware Analysis and Unpacking Forum
    Replies: 5
    Last Post: February 7th, 2010, 05:59
  3. breakpoint on non-API function
    By gromozeka in forum OllyDbg Support Forums
    Replies: 3
    Last Post: October 27th, 2005, 07:54
  4. Add a new function to a dll
    By lllaaa in forum The Newbie Forum
    Replies: 0
    Last Post: March 2nd, 2003, 06:36
  5. SI, VB and function in DLL
    By JohnnyBoy in forum Malware Analysis and Unpacking Forum
    Replies: 4
    Last Post: September 13th, 2001, 07:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •