From cdfc1765c5ab1248cbafaa6776867c69fb8a1f1a Mon Sep 17 00:00:00 2001 From: i-am-shodan <6901273+i-am-shodan@users.noreply.github.com> Date: Fri, 28 Jul 2023 15:30:58 +0100 Subject: [PATCH] Fixed bug with PDU handling in headless mode --- pyrdp/player/Replay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrdp/player/Replay.py b/pyrdp/player/Replay.py index 2050d5362..2586fca86 100644 --- a/pyrdp/player/Replay.py +++ b/pyrdp/player/Replay.py @@ -19,6 +19,7 @@ class Replay: """ def __init__(self, file: BinaryIO): + currentMsgIndex = 0 self.events: Dict[int, List[int]] = {} self.file = file @@ -36,7 +37,9 @@ def __init__(self, file: BinaryIO): # Register PDUs as they are parsed by the layer def registerEvent(pdu: PlayerPDU): nonlocal currentMessagePosition - events[pdu.timestamp].append(currentMessagePosition) + nonlocal currentMsgIndex + events[currentMsgIndex].append(currentMessagePosition) + currentMsgIndex = currentMsgIndex + 1 # Register the offset of every event in the file. player = PlayerLayer()