I am trying to make an IDC script which will enumerate through all the functions and strings in IDAFree. Currently, I have figured out the function enumeration, but have had a tough time finding a way to get all the strings from the IDA API. Because I am using IDAFree 7, I think that I am unable to use idautils or idaapi. So something like sc = idautils.Strings() is not going to work. Any ideas? Thanks

#include <idc.idc>
static enum_funcs()
    auto addr, end, args, locals, frame, firstArg, name, ret;
    addr = 0;
    for(addr = NextFunction(addr); addr != BADADDR; addr = NextFunction(addr))
        name = Name(addr);
        end = GetFunctionAttr(addr, FUNCATTR_END);
        locals = GetFunctionAttr(addr, FUNCATTR_FRSIZE);
        frame = GetFrame(addr);
        ret = GetMemberOffset(frame, " r");
        if (ret == -1) continue;
        firstArg = ret + 4;
        //args = GetStructSize(frame) - firstArg;
        Message("Function: %s, starts at %x, ends at %x\n", name, addr, end);

static enum_strings()


static main() 
    Message("FuncDump: Start\n");
    Message("FuncDump: Done\n");
    Message("StringDump: Start\n");
    Message("StringDump: Done\n");
New contributor
Garrett Haley is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Garrett Haley is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.