zoukankan      html  css  js  c++  java
  • 节区相关操作函数

    idc 

    http://www.cnblogs.com/fply/p/8505416.html

    AskSelector(sel)

    FindSelector(val)

    SetSelector(sel, value)

    获取第一个节区地址

    FirstSeg()

    下个节区地址

    NextSeg(ea)

    获取节区起始位置

    SegStart(ea)

    SegEnd(ea)

    SegName(ea)

    #创建一个节区
    AddSegEx(startea, endea, base, use32, align, comb, flags):
    """ Create a new segment @param startea: linear address of the start of the segment @param endea: linear address of the end of the segment this address will not belong to the segment 'endea' should be higher than 'startea' @param base: base paragraph or selector of the segment. a paragraph is 16byte memory chunk. If a selector value is specified, the selector should be already defined. @param use32: 0: 16bit segment, 1: 32bit segment, 2: 64bit segment @param align: segment alignment. see below for alignment values @param comb: segment combination. see below for combination values. @param flags: combination of ADDSEG_... bits @return: 0-failed, 1-ok """

     AddSeg(startea, endea, base, use32, align, comb)

     DelSeg(ea, flags)

    SetSegBounds(ea, startea, endea, flags)

     RenameSeg(ea, name)

    SetSegClass(ea, segclass)

    SegAlign(ea, alignment):
        """
        Change alignment of the segment
    
        @param ea: any address in the segment
        @param alignment: new alignment of the segment (one of the sa... constants)
    
        @return: success (boolean)
        """
        return SetSegmentAttr(ea, SEGATTR_ALIGN, alignment)
    
    
    saAbs        = idaapi.saAbs        # Absolute segment.
    saRelByte    = idaapi.saRelByte    # Relocatable, byte aligned.
    saRelWord    = idaapi.saRelWord    # Relocatable, word (2-byte, 16-bit) aligned.
    saRelPara    = idaapi.saRelPara    # Relocatable, paragraph (16-byte) aligned.
    saRelPage    = idaapi.saRelPage    # Relocatable, aligned on 256-byte boundary
                                        # (a "page" in the original Intel specification).
    saRelDble    = idaapi.saRelDble    # Relocatable, aligned on a double word
                                        # (4-byte) boundary. This value is used by
                                        # the PharLap OMF for the same alignment.
    saRel4K      = idaapi.saRel4K      # This value is used by the PharLap OMF for
                                        # page (4K) alignment. It is not supported
                                        # by LINK.
    saGroup      = idaapi.saGroup      # Segment group
    saRel32Bytes = idaapi.saRel32Bytes # 32 bytes
    saRel64Bytes = idaapi.saRel64Bytes # 64 bytes
    saRelQword   = idaapi.saRelQword   # 8 bytes

    #通过名称获取selector,返回一个数据,段中DS

    SegByName(segname)

    SetSegDefReg(ea, reg, value)

    SetSegmentType(segea, segtype)
        """
        Set segment type
    
        @param segea: any address within segment
        @param segtype: new segment type:
    
        @return: !=0 - ok
        """
        seg = idaapi.getseg(segea)
    
        if not seg:
            return False
    
        seg.type = segtype
        return seg.update()
    
    
    SEG_NORM   = idaapi.SEG_NORM
    SEG_XTRN   = idaapi.SEG_XTRN   # * segment with 'extern' definitions
                                    #   no instructions are allowed
    SEG_CODE   = idaapi.SEG_CODE   # pure code segment
    SEG_DATA   = idaapi.SEG_DATA   # pure data segment
    SEG_IMP    = idaapi.SEG_IMP    # implementation segment
    SEG_GRP    = idaapi.SEG_GRP    # * group of segments
                                    #   no instructions are allowed
    SEG_NULL   = idaapi.SEG_NULL   # zero-length segment
    SEG_UNDF   = idaapi.SEG_UNDF   # undefined segment type
    SEG_BSS    = idaapi.SEG_BSS    # uninitialized segment
    SEG_ABSSYM = idaapi.SEG_ABSSYM # * segment with definitions of absolute symbols
                                    #   no instructions are allowed
    SEG_COMM   = idaapi.SEG_COMM   # * segment with communal definitions
                                    #   no instructions are allowed
    SEG_IMEM   = idaapi.SEG_IMEM   # internal processor memory & sfr (8051)

    GetSegmentAttr(segea, attr)

    SetSegmentAttr(segea, attr, value)

     MoveSegm(ea, to, flags)

    rebase_program(delta, flags)

  • 相关阅读:
    sharepoint更新
    生成Log日志文件.NET
    sharepoint绑定
    sharepoint多表查询
    数据库导入
    sharepoint插入数据
    协方差矩阵求解算法分析
    .NET提供的加密算法概述
    掩耳盗铃之使用WebBrowser封装网页
    C#委托BeginInvoke返回值乱序问题
  • 原文地址:https://www.cnblogs.com/fply/p/8505416.html
Copyright © 2011-2022 走看看