Skip to content

Instantly share code, notes, and snippets.

@pixeldesu
Created May 16, 2020 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixeldesu/b9ea1517cc039251cb1253753cf52c83 to your computer and use it in GitHub Desktop.
Save pixeldesu/b9ea1517cc039251cb1253753cf52c83 to your computer and use it in GitHub Desktop.
Kaitai Struct YAML for Pangya GBIN files
meta:
id: gbin
file-extension: gbin
endian: le
seq:
- id: header
type: str
size: 4
encoding: ascii
- id: version
type: u4
- id: model_node_count
type: u4
- id: u2
type: u4
- id: u3
type: u4
- id: camera_node_count
type: u4
- id: point_node_count
type: u4
- id: area_node_count
type: u4
- id: texture_count
type: u4
- id: node_list_count
type: u4
- id: camera_nodes
type: camera_node
repeat: expr
repeat-expr: camera_node_count
- id: point_nodes
type: point_node
repeat: expr
repeat-expr: point_node_count
- id: area_nodes
type: area_node
repeat: expr
repeat-expr: area_node_count
- id: textures
type: strz
size: 32
encoding: euc-kr
repeat: expr
repeat-expr: texture_count
- id: node_lists
type: node_list
repeat: expr
repeat-expr: node_list_count
- id: ground_nodes
type: ground_node
- id: model_nodes
type: model_node
repeat: expr
repeat-expr: model_node_count + u3
- id: u5
type: u1
- id: u4
type: f4
repeat: expr
repeat-expr: 16
types:
camera_node:
seq:
- id: name
type: strz
size: 32
encoding: euc-kr
- id: pos
type: f4
repeat: expr
repeat-expr: 3
- id: dest
type: f4
repeat: expr
repeat-expr: 3
- id: fov
type: f4
- id: bank
type: f4
point_node:
seq:
- id: type
type: u1
- id: node
type:
switch-on: type
cases:
0: point_node_start
1: point_node_type1
2: point_node_sun
point_node_sun:
seq:
- id: name
type: strz
size: 32
encoding: euc-kr
- id: pos
type: f4
repeat: expr
repeat-expr: 3
- id: data
type: strz
size: 64
encoding: euc-kr
point_node_start:
seq:
- id: name
type: strz
size: 32
encoding: euc-kr
- id: pos
type: f4
repeat: expr
repeat-expr: 3
point_node_type1:
seq:
- id: name
type: strz
size: 32
encoding: euc-kr
- id: pos
type: f4
repeat: expr
repeat-expr: 3
- id: color
type: strz
size: 64
encoding: euc-kr
area_node:
seq:
- id: type
type: u1
- id: script
type: strz
size: 64
encoding: euc-kr
- id: minmax
type: f4
repeat: expr
repeat-expr: 6
node_list:
seq:
- id: name
type: strz
size: 16
encoding: euc-kr
- id: size
type: u4
- id: enabled
type: u4
- id: node_positions
type: node_list_positions
repeat: expr
repeat-expr: size
node_list_positions:
seq:
- id: x
type: f4
- id: y
type: f4
- id: z
type: f4
ground_node:
seq:
- id: type
type: u1
- id: node
type:
switch-on: type
cases:
0: ground_node_default
ground_node_default:
seq:
- id: show
type: u1
- id: u1
type: u2
- id: u2
type: u4
- id: file
type: strz
size: 16
encoding: euc-kr
- id: rot
type: f4
repeat: expr
repeat-expr: 3
- id: scale
type: f4
- id: minmax
type: f4
repeat: expr
repeat-expr: 6
- id: u3
type: f4
repeat: expr
repeat-expr: 27
- id: u4
size: u2 * 12
model_node:
seq:
- id: type
type: u1
- id: u1
size: 7
- id: file
type: strz
size: 32
encoding: euc-kr
- id: pos
type: f4
repeat: expr
repeat-expr: 3
- id: u2
type: f4
repeat: expr
repeat-expr: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment