Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VB3 Records with Arbitrary-length Strings?

Tags:

file

file-io

I have a binary file written from a VB3 program. It writes records which contain arbitrary-length strings.

I'm now trying to read and convert these files, but I don't know how to determine where one string stops and another starts. Is there a delimiter, or is the length specified at the beginning somewhere?

like image 873
sstephens Avatar asked Feb 06 '26 09:02

sstephens


2 Answers

After poking around with a hex editor, I've discovered the following:

  • Arbitrary-length strings start with a length byte, followed by a null byte, followed by the string.
  • Arrays of any type contain the full length of the array--e.g. an array length 6 of longs (4 bytes) is a total of 24 bytes. Empty strings are 2 bytes (length of 0 and null byte) for this.
like image 194
sstephens Avatar answered Feb 08 '26 23:02

sstephens


They are either delimited or there's some fixed length pattern. Now way we can tell from here. Open up the file with a hex editor (loads about on google) , have a look.

like image 23
Tony Hopkinson Avatar answered Feb 08 '26 22:02

Tony Hopkinson