xtmlfile/header: Encapsulate in XtmFile module.
This commit is contained in:
parent
60b2e6d9ff
commit
53bb3fe39a
1 changed files with 74 additions and 71 deletions
|
@ -3,22 +3,24 @@ require 'rubygems'
|
||||||
gem 'bindata', '~> 1.2.1'
|
gem 'bindata', '~> 1.2.1'
|
||||||
require 'bindata'
|
require 'bindata'
|
||||||
|
|
||||||
#
|
module XtmFile
|
||||||
# Offset | Information | Size (bytes)
|
|
||||||
# --------------------------------------------
|
#
|
||||||
# 0 | Software name length | 1
|
# Offset | Information | Size (bytes)
|
||||||
# 1 | Software name | 20
|
# --------------------------------------------
|
||||||
# 21 | Version length | 1
|
# 0 | Software name length | 1
|
||||||
# 22 | Version | 4
|
# 1 | Software name | 20
|
||||||
# 26 | Not used | 10
|
# 21 | Version length | 1
|
||||||
# 36 | Date | 4
|
# 22 | Version | 4
|
||||||
# 40 | Filename length | 1
|
# 26 | Not used | 10
|
||||||
# 41 | Filename | 50
|
# 36 | Date | 4
|
||||||
# 91 | MD5 Enable | 1
|
# 40 | Filename length | 1
|
||||||
# 92 | File parts count | 4
|
# 41 | Filename | 50
|
||||||
# 96 | Original file size | 8
|
# 91 | MD5 Enable | 1
|
||||||
#
|
# 92 | File parts count | 4
|
||||||
class Header < BinData::Record
|
# 96 | Original file size | 8
|
||||||
|
#
|
||||||
|
class Header < BinData::Record
|
||||||
endian :little
|
endian :little
|
||||||
|
|
||||||
uint8 :progname_len, :value => lambda { progname_str.length }
|
uint8 :progname_len, :value => lambda { progname_str.length }
|
||||||
|
@ -85,4 +87,5 @@ class Header < BinData::Record
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue