-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of a KSY file for comps.dat
- Loading branch information
Showing
1 changed file
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
meta: | ||
id: comps_dat | ||
title: Comps.dat file extracted from an RSLogix 5000 ACD | ||
file-extension: dat | ||
license: CC0-1.0 | ||
ks-version: 0.9 | ||
endian: le | ||
bit-endian: le | ||
doc: | | ||
Docs for Comps.dat of ACD File Format | ||
doc-ref: | ||
- URL Reference? | ||
seq: | ||
- id: magic_number_maybe | ||
type: u4 | ||
repeat: expr | ||
repeat-expr: 2 | ||
- id: header | ||
type: header | ||
- id: unknown_data_between_header_and_records | ||
type: u1 | ||
repeat: expr | ||
repeat-expr: header.region_pointer_offset - 28 | ||
- id: region_header | ||
type: region_header | ||
- id: unknown_betw_reghead_and_region | ||
type: u1 | ||
repeat: expr | ||
repeat-expr: region_header.pointer_records_region - header.region_pointer_offset - 22 | ||
- id: record_header | ||
type: record_header | ||
- id: unknown_between_head_and_rec | ||
type: u1 | ||
repeat: expr | ||
repeat-expr: 36 #self.pointer_records_region + self.record_header_length | ||
- id: records | ||
type: record | ||
repeat: expr | ||
#repeat-expr: 2 #self.header.no_records + self.header.no_records_table2 | ||
repeat-expr: header.num_records + header.num_records_table2 | ||
|
||
types: | ||
header: | ||
seq: | ||
- id: total_length | ||
type: u4 | ||
- id: region_pointer_offset | ||
type: u4 | ||
- id: header_unknown_1 | ||
type: u4 | ||
- id: num_records | ||
type: u4 | ||
- id: num_records_table2 | ||
type: u4 | ||
region_header: | ||
seq: | ||
- id: magic_num | ||
contents: [0xfe, 0xfe] | ||
- id: region_pointer_length | ||
type: u4 | ||
- id: rec_header_unknown_1 | ||
type: u4 | ||
- id: rec_header_unknown_2 | ||
type: u4 | ||
- id: pointer_metadata_region | ||
type: u4 | ||
- id: pointer_records_region | ||
type: u4 | ||
record_header: | ||
seq: | ||
- id: magic_num | ||
contents: [0xfe, 0xfe] | ||
- id: record_header_length | ||
type: u4 | ||
- id: unknown4 | ||
type: u4 | ||
- id: unknown5 | ||
type: u4 | ||
- id: record_format | ||
type: u4 | ||
enum: record_format | ||
enums: | ||
record_format: | ||
#there might be other types, but these are the 2 in the python file | ||
#and I haven't dug too deep yet in my sample files | ||
132: xfer_db | ||
512: tag_record_i_presume | ||
record: | ||
seq: | ||
#- id: header | ||
# type: record_header | ||
#- id: unknwon_between_head_and_ident | ||
# type: u1 | ||
# repeat: expr | ||
# repeat-expr: 36 #self.pointer_records_region + self.record_header_length | ||
- id: identifier | ||
type: u2 | ||
- id: length | ||
type: u4 | ||
- id: data | ||
type: | ||
switch-on: identifier | ||
cases: | ||
0xFAFA: dat_record | ||
0xFDFD: ptr_dat_record | ||
dat_record: | ||
seq: | ||
- id: length | ||
type: u4 | ||
- id: dat_rec_unknown_1 | ||
type: u4 | ||
- id: sequence_number | ||
type: u2 | ||
- id: record_type | ||
type: u2 | ||
#enum: ? | ||
- id: dat_rec_unknown_2 | ||
type: u4 | ||
- id: obj_id | ||
type: u4 | ||
- id: parent_id_offset | ||
type: u4 | ||
- id: rec_text | ||
type: str | ||
size: 124 | ||
encoding: UTF-16LE | ||
- id: unknown_remaining_rec_data | ||
type: u1 | ||
repeat: expr | ||
repeat-expr: length - 144 | ||
ptr_dat_record: | ||
seq: | ||
- id: temporary_2 | ||
type: u1 |