def find_function(cls, funcs, sec, off): PdbFile.s_match.segment = sec PdbFile.s_match.address = off # XXX: binary search result = -1 i = 0 for i in range(0, len(funcs)): if PdbFunction.by_address(PdbFile.s_match, funcs[i]) == 0: result = i break return result