Nick,

Thanks to your pointers, I did notice that there is a common delimiter [0A
00] that follows the ASCII text.  And, yes, one of the hex pairs preceding
the ASCII text always translates to a larger decimal value when the text is
longer.  (Typically, the hex value equals the number of text characters +2)


In my previous example I didn't include the full ASCII text which
is CHECKED APPVD.
That's 14 characters.  The byte preceding the ASCII text, and just outside
the double-zero bookend is valued [1B] which translates to 16 in decimal.
That's the same number of characters in "CHECKED APPVD."+2

You can see more hex examples that confirm this pattern here.
[http://i.imgur.com/17go6.png]

Interesting.
Anyone have any experience parsing patterns such as these?

Troy

On Thu, Jun 16, 2011 at 1:20 PM, Nick Burch <[email protected]> wrote:

> On Thu, 16 Jun 2011, Troy Witthoeft wrote:
>
>> I'm no file decoder, but I did review about a dozen prts created with
>> different versions of the program, and different companies. The closest
>> thing I can find to a common header or sequence of bytes is the occurrence
>> of sextuple 3's and nine 0's just before text fields. Viewing the file in
>> Visual studio, a sample hex code header would be [33 33 33 33 33 33 E3 3F 00
>> 00 00 00 00 00 00 00 00 01 1F 1B 00] which is immediately followed by the
>> hex code of the text, for instance [43 48 45 43 4B 45 44] is the text
>> "CHECKED"
>>
>> The header always stays the same except for variation in the three hexes
>> just before the text. That would be [1F 1B 00] from my example above.
>> So, there does seem to be a pattern here to work with.
>>
>
> What follows the text, anything that would obviously let you spot that it
> has finished? And do the three bytes which vary have any relation to the
> length of the text?
>
>
>  I'm just not sure which tools will help me manipulate this pattern.
>> Got any ideas?
>>
>
> If the files aren't too big, and the text is only every us-ascii, then you
> could do it with a regexp...
>
> More usually you'd just nibble through one byte at a time, with a
> resettable state, and wait until you find the whole header then output the
> text
>
> Nick
>

Reply via email to