Skip to content

File saving in Windows fix for pyrdp-convert #496

@Cap-Levi

Description

@Cap-Levi

I was using this tool for a CTF recently where i tried to use the tool to convert the pcap to pyrdp and I went through an issue of saving file at the end, when I looked through the problem i saw, it was using the ":" character when saving the file, which is invalid for Windows OS, so adding this line (The bold one) in the recorder.py file in the recording dir made the error go away and it worked perfectly across Linux and Windows:

def init(self, fileName: Union[str, Path]):
super().init()

    # Buffer data until we have enough bytes for a meaningful replay.
    self.pending = b''

    self.filename = fileName
    **self.filename = str(self.filename).replace(":", "_")**
    
    self.fd: BufferedIOBase = None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions