Q1: Why is there no tool that recreates a class definition from a binary serialized file / data?
I assume that very few people need it. To begin with, binary serialization is not as popular as XML, JSON, and other formats that are standardized and supported almost anywhere.
There is no documentation in binary format. To understand this, you need to delve into the sources of the .NET Framework. This is not fun.
Q2: Is there such a case when it is impossible to restore the class definition from serialized data?
It appears that the binary format contains enough data. If you absolutely need a tool to reverse-engineer the source classes and their fields from serialized files, you can start by reading sources System.Runtime.Serialization.Formatters.Binary.BinaryFormatter , System.Runtime.Serialization.Formatters.Binary.ObjectReader and other classes from mscorlib.
However, if the application that created the files is not confused, I suggest decompiling it first. Most likely, it will be much easier.
PS Remember to consult your lawyer.
source share