Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

(De)-Serializing from/to VB

by belg4mit (Prior)
on Jan 18, 2016 at 21:55 UTC ( [id://1153037] : perlquestion . print w/replies, xml ) Need Help??

belg4mit has asked for the wisdom of the Perl Monks concerning the following question:

Does anybody have any experience with or know of any tools to handle data serialized by Visual Basic? As far as I can tell, the tool I'm trying to communicate with has used My.Computer.FileSystem.WriteAllBytes in VB6. I've searched these hallow halls, CPAN and my friendly local search engine to no avail.

In Bob We Trust, All Others Bring Data.

Replies are listed 'Best First'.
Re: (De)-Serializing from/to VB
by SuicideJunkie (Vicar) on Jan 18, 2016 at 22:05 UTC

    That looks more like .net than VB6 to me, but the most important thing is: what bytes do you have as input, and what do you want to get out?

    Unpack with parameters matching the structure written to disk is likely what you want, but it may be simpler than that. Sample data is key to knowing what you need.

      Yeah, I was expecting to use pack/unpack, but speaking with the developer lead me to believe that VB might do something beyond the obvious for its serialization a la Storable. However as I continue to hunt and gather evidence, it does look like it's your typical data structure puked out as binary. Hopefully I can convince him to share his Structure definitions so that I do not have to try to reverse engineer things.

      In Bob We Trust, All Others Bring Data.

        Can you put some known data into one of these blobs and then dump it in binary?

        In the absence of definitions; that's the best approach.

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re: (De)-Serializing from/to VB (generic bytes)
by Anonymous Monk on Jan 18, 2016 at 22:18 UTC
      Aye, see Re^2: (De)-Serializing from/to VB.

      I already know what type of file it is … a Jet database. But for some unknowable reason, rather than inserting features of an object as records in another table, features of an object are stored as a serialized BLOB in the object table.

      In Bob We Trust, All Others Bring Data.

        If it's really a Jet database and you're on Windows, you might prefer to access it via DBI and DBD::ADO or ODBC?
        Don't know how to do this from Linux or other, however...
        Maybe I'm wrong but if you know the encoding and let's say that the data are not crypted, normally when translating the bytes in characters you should get the text serialized with the tags... if the structure is fixed, it will be easy but if tags are removed from time to time (optional fields), this could be more difficult to get the full structure.