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


Here's how you can automate the labelling process:

import idc, idautils


# 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).

  • How do I write UI integration plugin? Can you share where to read about that?
    – void_17
    Commented Jul 19, 2023 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
    Commented Jul 19, 2023 at 17:04
  • 1
    @void_17 For more examples see IDAPython's GitHub
    – mimak
    Commented Jul 19, 2023 at 17:11

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.