Advertisement
Guest User

revenant-images-dat-file-format-WIP.ksy

a guest
Feb 8th, 2024
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.63 KB | None | 0 0
  1. meta:
  2.   id: images
  3.   endian: le
  4.   file-extension: dat
  5.  
  6. seq:
  7.   - id: magic
  8.     contents: [0x43, 0x47, 0x53, 0x52]
  9.    
  10.   - id: file_toc
  11.     type: file_toc_block
  12.  
  13.   # - id: skip
  14.   #   size: 2088 -4
  15.    
  16.   # - id: images
  17.   #   type: image_block
  18.   #   repeat: eos
  19.     # repeat: expr
  20.     # repeat-expr: file_toc.num_images
  21.     # repeat-expr: 2
  22.    
  23. types:
  24.   file_toc_block:
  25.     seq:
  26.     - id: num_images1
  27.       type: u2
  28.      
  29.     - id: unknown_constant1
  30.       type: u1
  31.     - id: unknown_constant2
  32.       type: u1
  33.      
  34.     - id: unknown_constant3
  35.       type: u4
  36.     - id: unknown_constant4
  37.       type: u4
  38.      
  39.     - id: empty_space1
  40.       type: u4
  41.      
  42.     - id: some_data_that_depends_on_num_images1
  43.       type: u4
  44.       repeat: expr
  45.       repeat-expr: num_images1
  46.      
  47.     - id: num_images2
  48.       type: u4
  49.      
  50.     # - id: some_data_that_depends_on_num_images2
  51.     #   type: u4
  52.     #   repeat: expr
  53.     #   repeat-expr: num_images2
  54.      
  55.     # - id: skip2
  56.     #   size: 1008
  57.      
  58.  
  59.   image_block:
  60.     seq:
  61.     - id: image_header
  62.       type: img_header
  63.      
  64.     - id: image_data
  65.       size: image_header.img_size
  66.      
  67.   img_header:
  68.     seq:
  69.    # - id: unknown3
  70.     #   size: 32
  71.     - id: img_name
  72.       type: str
  73.       terminator: 0
  74.       encoding: utf-8
  75.      
  76.     - id: str_padding
  77.       size: (4 - _io.pos) % 4 # see https://github.com/kaitai-io/kaitai_struct/issues/12#issuecomment-277757932
  78.      
  79.     - id: img_width
  80.       type: u4
  81.      
  82.     - id: img_height
  83.       type: u4
  84.      
  85.     - id: unknown2
  86.       size: 60
  87.      
  88.     - id: img_size
  89.       type: u4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement