From 0692a10253f0a11b6dcee5cbc893260f7c5cab23 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Wed, 11 Dec 2024 22:58:56 +0000 Subject: [PATCH] Add support for JankStringyBytes in LLSD --- hippolyzer/lib/base/llsd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hippolyzer/lib/base/llsd.py b/hippolyzer/lib/base/llsd.py index e68a40f..4faeaa1 100644 --- a/hippolyzer/lib/base/llsd.py +++ b/hippolyzer/lib/base/llsd.py @@ -16,10 +16,12 @@ from hippolyzer.lib.base.datatypes import * class HippoLLSDBaseFormatter(base_llsd.base.LLSDBaseFormatter): UUID: callable ARRAY: callable + BINARY: callable def __init__(self): super().__init__() self.type_map[UUID] = self.UUID + self.type_map[JankStringyBytes] = self.BINARY self.type_map[Vector2] = self.TUPLECOORD self.type_map[Vector3] = self.TUPLECOORD self.type_map[Vector4] = self.TUPLECOORD @@ -101,7 +103,7 @@ def _format_binary_recurse(something) -> bytes: raise LLSDSerializationError(str(exc), something) elif isinstance(something, uuid.UUID): return b'u' + something.bytes - elif isinstance(something, binary): + elif isinstance(something, (binary, JankStringyBytes)): return b'b' + struct.pack('!i', len(something)) + something elif is_string(something): if is_unicode(something):