In C a static function is scoped to a source file so you can have multiple static functions with the same name as long as they are in different files.

Does IDA have a way to express this or do I have to add a prefix to names myself? I know I can mark functions as being static and associate a sourcefile with a range (using add_sourcefile) but this doesn't seem to resolve naming conflicts.

  • Are you working with an executable with debug information ?
    – w s
    Feb 20, 2018 at 16:55
  • @ws yes but the debug information is limited and in a weird format so I had to write a script to extract the info.
    – ChrisD
    Feb 20, 2018 at 17:15

1 Answer 1


If I am understanding you correctly, what you're looking for is this IDA plugin...

for api_row in api_matrix:
    l = api_row[0]
    print l
    apis = api_row[1:]
    for api in apis:
        ref_addrs = CodeRefsTo(LocByName(api),0)
        for ref in ref_addrs:
            func_addr = LocByName(GetFunctionName(ref))
            func_name = GetFunctionName(ref)
            if l not in func_name:
                MakeNameEx(func_addr , l + '_' + func_name , SN_NOWARN)

print "complete"

Credits goes to: http://hooked-on-mnemonics.blogspot.fr/2012/06/automated-generic-function-naming-in.html

I recommend reading that article to learn how to use it. ^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.