当前位置: 首页>>代码示例>>Python>>正文


Python idaapi.get_segm_by_name方法代码示例

本文整理汇总了Python中idaapi.get_segm_by_name方法的典型用法代码示例。如果您正苦于以下问题:Python idaapi.get_segm_by_name方法的具体用法?Python idaapi.get_segm_by_name怎么用?Python idaapi.get_segm_by_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在idaapi的用法示例。


在下文中一共展示了idaapi.get_segm_by_name方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pablo

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def pablo(mode, address, end, search):

    while address < end:
        address = idaapi.find_binary(address, end, search, 0x10, SEARCH_DOWN)
        
        if address > idaapi.get_segm_by_name('CODE').end_ea:
            offset = address - 0x3
            
            if idaapi.isUnknown(idaapi.getFlags(offset)):
                if idaapi.get_qword(offset) <= end:
                    idaapi.create_data(offset, FF_QWORD, 0x8, BADNODE)
            
            address = offset + 0x4
        
        else:
            address += mode
            idaapi.do_unknown(address, 0)
            idaapi.create_insn(address)
            idaapi.add_func(address, BADADDR)
            address += 0x1

# Load Input Binary... 
开发者ID:SocraticBliss,项目名称:ps4_module_loader,代码行数:24,代码来源:ps4_module.py

示例2: find_malloc_par

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def find_malloc_par():
    mp_ = idc.get_name_ea_simple("mp_")
    if mp_ != idc.BADADDR:
        return mp_

    segm = idaapi.get_segm_by_name("[heap]")
    if segm is None:
        return None

    offset = get_struct_offsets(malloc_par()).get('sbrk_base')
    sbrk_base = segm.start_ea
    ea = idc.get_segm_start(get_name_ea_simple("_IO_2_1_stdin_"))
    end_ea = idc.get_segm_end(ea)

    while ea < end_ea:
        ptr = config.get_ptr(ea)
        if idaapi.is_loaded(ptr) and ptr == sbrk_base:
            return (ea-offset)
        ea += config.ptr_size

    return None

# -------------------------------------------------------------------------- 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:25,代码来源:ptmalloc.py

示例3: get_thread_tib

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def get_thread_tib(tid):
    tib_segm_name = "TIB[%08X]" % tid
    tib_segm = idaapi.get_segm_by_name(tib_segm_name)
    tib = None

    if not tib_segm:
        return tib

    ea  = tib_segm.start_ea
    tid_offset = m.ptr_size * 9
    while ea < tib_segm.end_ea:
        thread_id = m.get_ptr(ea+tid_offset)
        if thread_id == tid:
            tib = ea
            break
        ea += 0x1000
    return tib 
开发者ID:danigargu,项目名称:deREferencing,代码行数:19,代码来源:dbg.py

示例4: seg_by_name

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def seg_by_name(self, name):
        ida_seg = idaapi.get_segm_by_name(name)
        if ida_seg is None:
            return None
        perms = 0
        perms |= SEG_PROT_R if ida_seg.perm & idaapi.SEGPERM_READ else 0
        perms |= SEG_PROT_W if ida_seg.perm & idaapi.SEGPERM_WRITE else 0
        perms |= SEG_PROT_X if ida_seg.perm & idaapi.SEGPERM_EXEC else 0
        return self.angrdbg_mod.Segment(name, ida_seg.start_ea, ida_seg.end_ea, perms) 
开发者ID:andreafioraldi,项目名称:IDAngr,代码行数:11,代码来源:ida_debugger.py

示例5: get_got

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def get_got(self): #return tuple(start_addr, end_addr)
        ida_seg = idaapi.get_segm_by_name(".got.plt")
        return (ida_seg.start_ea, ida_seg.end_ea) 
开发者ID:andreafioraldi,项目名称:IDAngr,代码行数:5,代码来源:ida_debugger.py

示例6: get_plt

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def get_plt(self): #return tuple(start_addr, end_addr)
        ida_seg = idaapi.get_segm_by_name(".plt")
        return (ida_seg.start_ea, ida_seg.end_ea) 
开发者ID:andreafioraldi,项目名称:IDAngr,代码行数:5,代码来源:ida_debugger.py

示例7: get_idata

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def get_idata(self): #return tuple(start_addr, end_addr)
        ida_seg = idaapi.get_segm_by_name(".idata")
        if ida_seg is None:
            addr = None
            def cb(ea, name, i):
                addr = ea
            idaapi.enum_import_names(0, cb)
            ida_seg = idaapi.seg_by_addr(addr)
        return (ida_seg.start_ea, ida_seg.end_ea)
    
    #------------------------------------- 
开发者ID:andreafioraldi,项目名称:IDAngr,代码行数:13,代码来源:ida_debugger.py

示例8: get_heap_base

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def get_heap_base(self, address=None):
        if not address:
            segm = idaapi.get_segm_by_name("[heap]") # same as mp_->sbrk_base
            if segm:
                return segm.start_ea
        else:
            heap_addr = self.heap_for_ptr(address)
            heap_addr = heap_addr + sizeof(self.heap_info_s) + sizeof(self.malloc_state_s)
            return round_up(heap_addr, self.malloc_alignment)
        return None 
开发者ID:danigargu,项目名称:heap-viewer,代码行数:12,代码来源:ptmalloc.py

示例9: __init__

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def __init__(self, ea=UseCurrentAddress, name=None, index=None, segment_t=None):
        """Wrapper around IDA segments.

        There are 3 ways to get a segment - by name, ea or index. Only use one.

        Args:
            ea - address in the segment
            name - name of the segment
            index - index of the segment
        """
        if sum((ea not in (self.UseCurrentAddress, None), name is not None, index is not None,
                segment_t is not None,)) > 1:
            raise ValueError((
                                 "Expected only one (ea, name, index or segment_t)."
                                 " Got (ea={!r}, name={!r}, index={!r}, segment_t={!r})"
                             ).format(ea,
                                      name,
                                      index,
                                      segment_t))


        elif segment_t is not None:
            seg = segment_t

        elif name is not None:
            seg = idaapi.get_segm_by_name(name)

        elif index is not None:
            seg = idaapi.getnseg(index)

        elif ea == self.UseCurrentAddress:
            seg = idaapi.getseg(idc.here())

        elif ea is None:
            raise ValueError("`None` is not a valid address. To use the current screen ea, "
                             "use `Function(ea=Function.UseCurrentAddress)` or supply no `ea`.")

        else:
            seg = idaapi.getseg(ea)

        self._segment = seg 
开发者ID:tmr232,项目名称:Sark,代码行数:43,代码来源:segment.py

示例10: by_name

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def by_name(name):
    '''Return the segment with the given `name`.'''
    res = utils.string.to(name)
    seg = idaapi.get_segm_by_name(res)
    if seg is None:
        raise E.SegmentNotFoundError(u"{:s}.by_name({!r}) : Unable to locate the segment with the specified name.".format(__name__, name))
    return seg 
开发者ID:arizvisa,项目名称:ida-minsc,代码行数:9,代码来源:segment.py

示例11: resolve_expr

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import get_segm_by_name [as 别名]
def resolve_expr(self, expr):
        res = None
        try:
            expr = re.sub(r'[(|)]', '', expr)
            res = int(expr, 16)
        except ValueError:
            segm = idaapi.get_segm_by_name(expr)
            if segm:
                res = segm.start_ea
            else:
                ea = idaapi.str2ea(expr)
                if ea != idc.BADADDR:
                    res = ea
        return res 
开发者ID:danigargu,项目名称:deREferencing,代码行数:16,代码来源:custom.py


注:本文中的idaapi.get_segm_by_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。