kaitai-io / kaitai_struct_formats

Kaitai Struct: library of binary file formats (.ksy)
http://formats.kaitai.io
712 stars 203 forks source link

add grammar for WinHelp #597

Open armijnhemel opened 2 years ago

armijnhemel commented 2 years ago

This commit adds an incomplete description of the WinHelp format. Currently this only validates for Windows 3.1 help format files as I don't have any others to test with. There are also some type fields that are commented as the description does not seem to correctly match what I am seeing in .hlp files.

generalmimon commented 2 years ago

@armijnhemel:

Currently this only validates for Windows 3.1 help format files as I don't have any others to test with.

Files at https://telparia.com/fileFormatSamples/document/hlp/ (linked from http://fileformats.archiveteam.org/wiki/HLP_(WinHelp)#Sample_files) have some ::windows_30, ::windows_95 and ::media_view as well.

$ for f in *; do if [ ! -f "$f" ]; then continue; fi; echo "$f"; ksdump -f json "$f" ..\\winhelp.ksy > out/"$f".json; done
AFORCE.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
ALM30.HL
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
BANGBANG.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
BLACKOUT.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
CANASTA.HLP
CLICK.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
DIGITIZE.HLP
FONTMGR.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_95 (Kaitai::Struct::ValidationNotAnyOfError)
FONTMGR_7.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_95 (Kaitai::Struct::ValidationNotAnyOfError)
ICONEDIT.HL
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
KEYUS.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_95 (Kaitai::Struct::ValidationNotAnyOfError)
KFREE.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
PARITY.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
RETIREA.HLP
UPGRADE.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
WINZIP.HLP
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_windows_30 (Kaitai::Struct::ValidationNotAnyOfError)
gws.hlp
open.mvb
/types/system/seq/1: at pos 4: validation failed: not any of the list, got :format_version_media_view (Kaitai::Struct::ValidationNotAnyOfError)