Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java deserialization in C++

I'm working on a C++ application that has to process a variety of message types. One of the types is serialized Java objects (for which no source is available).
I'm wondering if anyone is aware of a C++ library along the lines of jdeserialize?
For those who aren't familiar with it, jdeserialize basically parses serialized objects and builds a graph.
It does a good job and I've been experimenting with it - using JNI to manage the interactions with the main program.
This works correctly, but is cumbersome. I'm concerned that it will be a maintenance headache.

like image 668
user888379 Avatar asked Jun 19 '13 23:06

user888379


People also ask

What is Java deserialization?

A Java deserialize vulnerability is a security vulnerability that occurs when a malicious user tries to insert a modified serialized object into the system in order to compromise the system or its data. Think of an arbitrary code execution vulnerability that can be triggered when deserializing a serialized object.

What is serialize and deserialize in C?

Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

Which class is used for deserialization?

ObjectInputStream. This Java class is responsible for the deserialization of the serialized objects and the primitive data. This class helps to read the object from the graph of objects stored while using FileInputStream. It has a main method readObject () that is used to deserialize the object.

What is serializing a binary tree?

Serialize and Deserialize Binary Tree. Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.


1 Answers

Java ABI is not compatible with C++ one, so you can't do that. Objects are represented in memory in the different ways (and it is definitely not the only important difference but it should be enough).

like image 94
sasha.sochka Avatar answered Oct 24 '22 23:10

sasha.sochka