Strcpy Xrefs in IDA Domain API

Hello!

Is this the only possible way to acquire callsites for pseudocode intrinsics in the IDADomain API?

from ida_domain import Database

# Get handle to database
db = Database()

# Enumerate all functions within database 
for func in db.functions:

    # Get pseudocode for each function
    pseudo = db.functions.get_pseudocode(func)
    
    # Find all strcpy calls within function pseudocode
    strcpy_calls = pseudo.find_calls(target_name="strcpy")

    # If any calls are found print out callsites
    if len(strcpy_calls) > 0:
        for strcpy in strcpy_calls:
            print(f"strcpy call found: 0x{strcpy.ea:2x}")

It appears strcpy is unavailable via db.functions.get_by_name or db.imports.get_import_by_name and just want to ensure there’s not a more efficient route than decompiling every function (which I suspect is required).

Hi! As you found out, your workaround is currently the way to go. We agree it’s a bit clunky, but improving this would require a new feature in IDA. We’ll keep an eye on it as a possible feature request. Thanks for bringing this up!