def data_node(ubifs, lnum, offset=0, node_len=0):
    """Get data node at given LEB number + offset.

    Arguments:
    Obj:ubifs   -- UBIFS object.
    Int:lnum    -- LEB number data node is in.
    Int:offset  -- Offset in LEB of data node.

    Returns:
    Obj:data_node    -- Data node found at lnum/offset.
    """
    ubifs.file.seek((ubifs.leb_size * lnum) + offset)
    datn = nodes.data_node(ubifs.file.read(UBIFS_DATA_NODE_SZ))
    datn.offset = (ubifs.leb_size * lnum) + offset + UBIFS_DATA_NODE_SZ
    datn.compr_len = node_len - UBIFS_COMMON_HDR_SZ - UBIFS_DATA_NODE_SZ
    return datn
def data_node(ubifs, lnum, offset=0, node_len=0):
    """Get data node at given LEB number + offset.

    Arguments:
    Obj:ubifs   -- UBIFS object.
    Int:lnum    -- LEB number data node is in.
    Int:offset  -- Offset in LEB of data node.

    Returns:
    Obj:data_node    -- Data node found at lnum/offset.
    """
    ubifs.file.seek((ubifs.leb_size * lnum) + offset)
    datn = nodes.data_node(ubifs.file.read(UBIFS_DATA_NODE_SZ))
    datn.offset = (ubifs.leb_size * lnum) + offset + UBIFS_DATA_NODE_SZ
    datn.compr_len = node_len - UBIFS_COMMON_HDR_SZ - UBIFS_DATA_NODE_SZ
    return datn
Example #3
0
def data_node(ubifs, lnum, offset = 0, node_len = 0):
    ubifs.file.seek(ubifs.leb_size * lnum + offset)
    datn = nodes.data_node(ubifs.file.read(UBIFS_DATA_NODE_SZ))
    datn.offset = ubifs.leb_size * lnum + offset + UBIFS_DATA_NODE_SZ
    datn.compr_len = node_len - UBIFS_COMMON_HDR_SZ - UBIFS_DATA_NODE_SZ
    return datn
def data_node(ubifs, lnum, offset=0, node_len=0):
    ubifs.file.seek(ubifs.leb_size * lnum + offset)
    datn = nodes.data_node(ubifs.file.read(UBIFS_DATA_NODE_SZ))
    datn.offset = ubifs.leb_size * lnum + offset + UBIFS_DATA_NODE_SZ
    datn.compr_len = node_len - UBIFS_COMMON_HDR_SZ - UBIFS_DATA_NODE_SZ
    return datn