mefistotelis / pylabview

Python reader of LabVIEW RSRC files (VI, CTL, LLB). File format description on the Wiki.
MIT License
91 stars 25 forks source link

Fixing version parsing when build number exceeds 99 #12

Closed marcpage closed 1 year ago

marcpage commented 1 year ago

I found some discrepancies between the version string and the version parsed.

For instance, I found a file that had the following binary version:

b'\x14\x00a(\x00\x00\x0814.0b128\x00'

It was parsed and reported as 14.0.0b28 but the version string reports it to be 14.0b128. I think the "flags" field is really just another BCD digit for the build (at least the lower 4 bits).

Update: Added suggested code that looks at the low bit in phase as 1,000's place for the build, and I found a version that supported it: 22.3.0d1207

marcpage commented 1 year ago

I cannot make changes to the Version Bits wiki. The changes relevant from this PR are:

Offset | Length | Value --------|--------+------- 28 | 4 | Major (tens) 24 | 4 | Major (ones) 20 | 4 | Minor 16 | 4 | Bugfix 13 | 3 | Stage 8 | 4 | Build (hundreds) 4 | 4 | Build (tens) 0 | 4 | Build (ones)

mefistotelis commented 1 year ago

Good change, but this way we're forgetting one bit.

Can we put that one bit (vcode >> 12) into flags? (I have a feeling this bit may turn out to be another BCD digit though)

mefistotelis commented 1 year ago

Generating wiki from code - yeah, that's a good idea as well. https://github.com/mefistotelis/tigerbox/blob/master/.github/workflows/generate-wiki.yaml

marcpage commented 1 year ago

Good change, but this way we're forgetting one bit.

Can we put that one bit (vcode >> 12) into flags? (I have a feeling this bit may turn out to be another BCD digit though)

Good catch. That explains another anomaly I was seeing. I believe the bit just below the phase is the 1000's (well 1,000 or not bit). I'll put up an update.

Offset | Length | Value --------|--------+------- 28 | 4 | Major (tens) 24 | 4 | Major (ones) 20 | 4 | Minor 16 | 4 | Bugfix 13 | 3 | Stage 12 | 1 | Build (thousands) 8 | 4 | Build (hundreds) 4 | 4 | Build (tens) 0 | 4 | Build (ones)

marcpage commented 1 year ago

I've pushed the changes and even found a VI that was saved in 22.3.0d1207 which correctly shows (now) the full build number.

marcpage commented 1 year ago

Generating wiki from code - yeah, that's a good idea as well. https://github.com/mefistotelis/tigerbox/blob/master/.github/workflows/generate-wiki.yaml

So the wiki is generated from source? I'd be happy to update the wiki source and put up a PR.

marcpage commented 1 year ago

Ok, code and docs updated

mefistotelis commented 1 year ago

Removing EOLN spaces in markdown might not be such a good idea. https://www.dotcms.com/docs/latest/markdown-syntax#BlankLines

marcpage commented 1 year ago

My editor automatically strips whitespace at the end of lines. However, I did not intend to put Blocks.md in the PR. Removing it.

mefistotelis commented 1 year ago

I can't say I understand the list of patches now included in this PR... anyway I merged the changes manually. Thank you.