Exemplo n.º 1
0
def main():
        eip = idaapi.get_screen_ea();
        function = idaapi.func_item_iterator_t();
        function.set(idaapi.get_func(eip));
        	
        b_ok = function.first();
        while b_ok:
                pc = function.current();
                inslen = idaapi.decode_insn(function.current());
                if inslen == 0:
                        b_ok = function.next_code();
                        continue;	
                if inst_is_call(pc):
			color = get_blue();
			if is_indirect(pc):
				color = get_green();
			idc.SetColor(pc, CIC_ITEM, color);
		elif inst_is_ret(pc):			                      
                        color = get_red();
			idc.SetColor(pc, CIC_ITEM, color);	
                elif inst_is_jcc(pc):                                      
                        color = get_yellow();
			if is_indirect(pc):
				color = get_green();
			idc.SetColor(pc, CIC_ITEM, color);
                b_ok = function.next_code();		
Exemplo n.º 2
0
def main():
    eip = idaapi.get_screen_ea()
    function = idaapi.func_item_iterator_t()
    function.set(idaapi.get_func(eip))

    b_ok = function.first()
    while b_ok:
        pc = function.current()
        inslen = idaapi.decode_insn(function.current())
        if inslen == 0:
            b_ok = function.next_code()
            continue
        if inst_is_call(pc):
            color = get_blue()
            if is_indirect(pc):
                color = get_green()
            idc.SetColor(pc, CIC_ITEM, color)
        elif inst_is_ret(pc):
            color = get_red()
            idc.SetColor(pc, CIC_ITEM, color)
        elif inst_is_jcc(pc):
            color = get_yellow()
            if is_indirect(pc):
                color = get_green()
            idc.SetColor(pc, CIC_ITEM, color)
        b_ok = function.next_code()
Exemplo n.º 3
0
 def func_items(self):
     func = idaapi.get_func(self.start_ea)
     if not func:
         return
     fii = idaapi.func_item_iterator_t()
     ok = fii.set(func)
     while ok:
         yield fii.current()
         ok = fii.next_code()
Exemplo n.º 4
0
def FuncItems(start):
    """
    Get a list of function items

    @param start: address of the function

    @return: ea of each item in the function
    """
    func = idaapi.get_func(start)
    if not func:
        return
    fii = idaapi.func_item_iterator_t()
    ok = fii.set(func)
    while ok:
        yield fii.current()
        ok = fii.next_code()
Exemplo n.º 5
0
def FuncItems(start):
    """
    Get a list of function items

    @param start: address of the function

    @return: ea of each item in the function
    """
    func = idaapi.get_func(start)
    if not func:
        return
    fii = idaapi.func_item_iterator_t()
    ok = fii.set(func)
    while ok:
        yield fii.current()
        ok = fii.next_code()