Skip to content

cannot read opcode 0x0, but next byte is a string opcode #60

Description

@svaningelgem

Attached you'll find a charles proxy dump of a session which is basically a Session object serialized.
I'm trying to load this in so I can read it in a python-way.

However, I think the reader is wrong somewhere because when your library wants to read alpnProtocol, it fails with RuntimeError("Unknown OpCode in the stream: 0x0 (at offset 0x967)"). But when going to check the actual binary data, I can see the next byte is 0x74 (string-opcode).

So my best guess is that the reader peeked somewhere and didn't advance the file pointer?
Or that a certain object has a 0x0 "closing opcode" or so?

I hope you could have a look at this and fix the issue at hand.

github.zip


EDIT1: when checking the code, I saw that `"actualPort"` was a very weird number, so I advanced the file pointer. And lo-and-behold, the `actualPort=443`. So the filepointer is already wrong there.
EDIT2: I think I found the place:
Reading field: Ljava/util/List; - children
                  OpCode: 0x70 -- TC_NULL (at offset 0x8EB)
                * L children: None

Inside the binary it looks like: 0x70 (null) 0x78 (endblock)
I don't know what object needs to read that endblock, but that one is skewing the further reading of the file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions