def new_handler_9_parameter()

in tools/warmcookie/warmcookie_http.py [0:0]


def new_handler_9_parameter(script_content: bytes):
    class Handler9(ctypes.Structure):
        _pack_ = 1
        _fields_ = [
            ("field_0", ctypes.c_uint32),
            ("field_4", ctypes.c_uint32),
            ("field8", ctypes.c_uint32),
            ("offset", ctypes.c_uint32),
            ("script_content_size", ctypes.c_uint32),
            ("script_content", ctypes.c_ubyte * len(script_content)),
        ]

    script_content_array = (ctypes.c_ubyte * len(script_content))(*script_content)

    return Handler9(
        0xDEADBEEF,
        0xDEADBEEF,
        0xDEADBEEF,
        0x20,
        len(script_content),
        script_content_array,
    )