Any utility to view a binary serialized object in easy-to-read format?

S

Samuel R. Neff

Are there any tools available to view a file containing a binary
serialized object in a friendly format? Something to list classes and
data and such?

Thanks,

Sam

B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
 
K

Kevin Yu [MSFT]

Hi Sam,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to tool do view all binary
serialized data. If there is any misunderstanding, please feel free to let
me know.

As far as I know, there isn't such tool available. Because to deserialize
an object we need to know the structure of it. Each member is mapped to
certain bytes in the binary list. So a tool might be able to see a known
object, but not all objects.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
S

Samuel R. Neff

Yes, what you describe is exactly what I'm after--easily viewing a
file that contains the binary serialization of a .NET object.

However, your description of why this is not possible doesn't appear
to match up with what is viewable via plain text in such a file. The
file clearly has class names, property names, and property types,
along with their data. This is more than just the data in a binary
list as would be the scenario with a C++ object dump.

Sam


Hi Sam,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to tool do view all binary
serialized data. If there is any misunderstanding, please feel free to let
me know.

As far as I know, there isn't such tool available. Because to deserialize
an object we need to know the structure of it. Each member is mapped to
certain bytes in the binary list. So a tool might be able to see a known
object, but not all objects.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
 
K

Kevin Yu [MSFT]

Hi Sam,

In most cases, when we serialize objects using a binary formatter, we get a
binary stream which contains the object data only. It doesn't contain
object structure information. So when deserializing it, we have to have the
definition of the object class, or deserializing will fail.

In you last post, you mentioned that you can see the class name and other
information in the file. So could you let me know how you get the file? Are
you getting it using a BinaryFormatter or using some dump tools?

Thanks.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
S

Samuel R. Neff

Pretty typical load/save routines using BinaryFormatter.

Load:

Public Overloads Shared Function Load(ByVal sm As Stream) As
PackageIndex
Dim ndx As PackageIndex

Dim serializer As New BinaryFormatter
ndx = DirectCast(serializer.Deserialize(sm), PackageIndex)

ndx._readDate = Date.Now

Return ndx
End Function

Save:

Private Sub Save(ByVal sm As Stream)
Dim serializer As New BinaryFormatter
serializer.Serialize(sm, Me)
End Sub




Hi Sam,

In most cases, when we serialize objects using a binary formatter, we get a
binary stream which contains the object data only. It doesn't contain
object structure information. So when deserializing it, we have to have the
definition of the object class, or deserializing will fail.

In you last post, you mentioned that you can see the class name and other
information in the file. So could you let me know how you get the file? Are
you getting it using a BinaryFormatter or using some dump tools?

Thanks.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

B-Line is now hiring one Washington D.C. area VB.NET
developer for WinForms + WebServices position.
Seaking mid to senior level developer. For
information or to apply e-mail resume to
sam_blinex_com.
 
K

Kevin Yu [MSFT]

Hi Sam,

We don't know whether the serialized data by BinaryFormatter contains
object structure information, because it's all .net framework internals. So
I don't think we can use a deserialize tool to read all objects without
knowing the structure.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top