def is_in_executable_segment(ea): if idaapi.getseg(ea) is None: return False return idaapi.getseg(ea).perm & idaapi.SEGPERM_EXEC