wiithon.formats.rarc module

class wiithon.formats.rarc.NodeAttribute(*values)[source]

Bases: IntFlag

FILE = 1
DIRECTORY = 2
COMPRESSED = 4
PRELOAD_TO_MRAM = 16
PRELOAD_TO_ARAM = 32
LOAD_FROM_DVD = 64
YAZO_COMPRESSED = 128
class wiithon.formats.rarc.RarcNode[source]

Bases: object

type: str
name_offset: int
name_hash: int
entry_count: int
first_entry_index: int
name: str
class wiithon.formats.rarc.RarcFileEntry[source]

Bases: object

file_id: int
name_hash: int
attributes: int
name_offset: int
data_offset_or_idx: int
data_size: int
padding: int
name: str
property data: bytes
class wiithon.formats.rarc.Rarc[source]

Bases: object

base_offset: int
magic_word: bytes
file_length: int
data_offset: int
data_length: int
number_nodes: int
offset_first_node: int
total_directory: int
offset_first_directory: int
string_table_length: int
string_table_offset: int
number_of_files: int
nodes: List[RarcNode]
entries: List[RarcFileEntry]
string_table: bytes
static compute_hash(name)[source]
Parameters:

name (str)

Return type:

int

classmethod create_empty()[source]
Return type:

Rarc

classmethod read(stream)[source]
Parameters:

stream (BinaryIO)

Return type:

Rarc

extract_to(output_dir)[source]
Parameters:

output_dir (str)

write(stream)[source]
Parameters:

stream (BinaryIO)

get_file(path)[source]
Parameters:

path (str)

Return type:

RarcFileEntry

replace_file(path, data, new_name='')[source]
Parameters:
Return type:

None

is_node_empty(path)[source]
Parameters:

path (str)

Return type:

bool

get_node(path)[source]
Parameters:

path (str)

Return type:

RarcNode

remove_node(path)[source]
Parameters:

path (str)

Return type:

None

add_node(path)[source]
Parameters:

path (str)

Return type:

RarcNode

add_file(path, data)[source]
Parameters:
Return type:

RarcFileEntry

remove_file(path)[source]
Parameters:

path (str)

Return type:

None

get_bytes()[source]
Return type:

bytes