import os import struct def from_bin(file_path): """ Extracts binary files from a BIN file. Args: file_path (str): Path to the BIN file. """ CHUNK = 2048 pointers = [0] folder_name = file_path.rstrip(".BIN") + "/" if not os.path.isdir(folder_name): os.mkdir(folder_name) with open(file_path, 'rb') as f: data = f.read() i = 0 while True: pointer = struct.unpack(' 0: pointer += 154 pointers.append(pointer) i += 2 if data[i:i+2] == b'\x00\x00': break for p in range(1, len(pointers) - 1): file_start = pointers[p] file_end = file_start + struct.unpack('