1

I have a binary with debug information and I want to mark STL library functions with "Library function" tag as quick as possible, just by highlighting a range of functions and clicking some button instead of marking every function "Library function" by hand. list of functions

Is there is a way to do that quick?

1 Answer 1

2

Here's how you can automate the labelling process:

import idc, idautils

FUNC_LIB = 4

# Here go your selected functions
# This labels everything unless you specify the start/end args
funcs = idautils.Functions()

for ea in funcs:
    flags = idc.get_func_flags(ea) | FUNC_LIB
    idc.set_func_flags(ea, flags)

To label a library function we set FUNC_LIB flag.

You will likely need to write a plugin for UI integration to get the selected functions. If they are in a contiguous address space you can just pass its range in idautils.Functions(start_ea, end_ea).

3
  • How do I write UI integration plugin? Can you share where to read about that?
    – void_17
    Jul 19 at 16:34
  • 1
    Honestly I struggle(d) to find any official docs on IDAPython plugin development, personally I started with Sark's SamplePlugin. I can also recommend their way of plugin loading, it's pretty convenient
    – mimak
    Jul 19 at 17:04
  • 1
    @void_17 For more examples see IDAPython's GitHub
    – mimak
    Jul 19 at 17:11

Your Answer

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

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