Exemple #1
0
def by_name(name):
    '''Return the identifier for the enumeration with the given `name`.'''
    res = idaapi.get_enum(utils.string.to(name))
    if res == idaapi.BADADDR:
        raise E.EnumerationNotFoundError(
            u"{:s}.by_name({!r}) : Unable to locate enumeration by the name \"{:s}\"."
            .format(__name__, name, utils.string.escape(name, '"')))
    return res
Exemple #2
0
def by_index(index):
    '''Return the identifier for the enumeration at the specified `index`.'''
    res = idaapi.getn_enum(index)
    if res == idaapi.BADADDR:
        raise E.EnumerationNotFoundError(
            u"{:s}.by_index({:#x}) : Unable to locate enumeration by the index {:d}."
            .format(__name__, index, index))
    return res
Exemple #3
0
def by_name(name):
    '''Return the identifier for the enumeration with the given `name`.'''
    res = idaapi.get_enum(name)
    if res == idaapi.BADADDR:
        raise E.EnumerationNotFoundError(
            "{:s}.by_name({!r}) : Unable to locate enumeration by the name {!r}."
            .format(__name__, name, name))
    return res