Question

I have a program which saves it result files in a binary file. It is also posible within the program to export the result files into XML format.

Since the progam itself is awfull at browsing its results, I wrote a program myself to read this result files, but obviously using the XML format.

The problem is, the XML files exported from binary files are huge! while a binary file which can be used by the orginal program is about 100 KB, The same file exported to XML is around 2~3 MB.

I want to know is there a way that I can find out how to read the orginal binary files!

Was it helpful?

Solution

To get the data out of a binary file you'll need to know the structure of it. If you don't know the structure, I think this will be a hopeless endeavour. The xml file is so much bigger, because it contains the structure in addition to the data. You can read and interpret it.

OTHER TIPS

You need to read the program source code, if it is not available - open this program in ILDASM or Reflector, and try to understand how binary file are created. Probably this is done using binary serialization.

You can define your own types which are exact copy of original types, including serialization attributes, and load them using binary serialization.

However, every change in third party file format may require you to change your program. I think it is better to use XML.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top