def new_handler_5_parameter()

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


def new_handler_5_parameter(filepath: bytes, file_content: bytes):
    class Handler5(ctypes.Structure):
        _pack_ = 1
        _fields_ = [
            ("field_0", ctypes.c_uint32),
            ("field_4", ctypes.c_uint32),
            ("field8", ctypes.c_uint32),
            ("offset", ctypes.c_uint32),
            ("file_content_size", ctypes.c_uint32),
            ("filepath", ctypes.c_char * len(filepath)),
            ("file_content", ctypes.c_char * len(file_content)),
        ]

    return Handler5(
        0xDEADBEEF,
        0xDEADBEEF,
        0xDEADBEEF,
        0x30,
        len(file_content),
        filepath,
        file_content,
    )