idc.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:DecLLVM 作者: F8LEFT 项目源码 文件源码
def GetStrucNextOff(sid, offset):
    """
    Get next offset in a structure

    @param sid:     structure type ID
    @param offset: current offset

    @return: -1 if bad structure type ID is passed,
             idaapi.BADADDR if no (more) offsets in the structure,
             otherwise returns next offset in a structure.

    @note: IDA allows 'holes' between members of a
           structure. It treats these 'holes'
           as unnamed arrays of bytes.
           This function returns a member offset or a hole offset.
           It will return size of the structure if input
           'offset' belongs to the last member of the structure.

    @note: Union members are, in IDA's internals, located
           at subsequent byte offsets: member 0 -> offset 0x0,
           member 1 -> offset 0x1, etc...
    """
    s = idaapi.get_struc(sid)
    return -1 if not s else idaapi.get_struc_next_offset(s, offset)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号