Skip to content

Instantly share code, notes, and snippets.

@lazanet
Last active April 8, 2020 12:12
Show Gist options
  • Save lazanet/e0a4b0d40de6f2b9553d4091b5e7f279 to your computer and use it in GitHub Desktop.
Save lazanet/e0a4b0d40de6f2b9553d4091b5e7f279 to your computer and use it in GitHub Desktop.
Kaitai Struct parser for PES20 player.bin (WIP)
meta:
id: pes20_player_bin
file-extension: bin
endian: le
encoding: UTF-8
seq:
#- size: 8
- id: body
type: body
# size: _io.size - 8
# process: zlib
types:
body:
seq:
- size: 8
- id: players
type: player
size: 312
repeat: expr
repeat-expr: (_io.size - 8) / 312
player:
seq:
- id: player_id
type: u4
doc: Player ID
- size: 16 - _io.pos
- id: height_packed
type: u4
- size: 21 - _io.pos
- id: weight_packed
type: u4
- size: 36 - _io.pos
- id: aa_kckp_packed
type: u4
- size: 43 - _io.pos
- id: aa_finish_age_packed
type: u4
- size: 48 - _io.pos
- id: wf_packed
type: u4
- size: 121 - _io.pos
- id: player_kit_name
type: str
size: 18
- size: 243 - _io.pos
- id: player_name
type: str
size: 60
instances:
height:
value: (height_packed << 1 >> 25) + 100
weight:
value: (weight_packed << 1 >> 25) + 30
age:
value: (aa_finish_age_packed << 2 >> 26 ) +15
doc: 6 bits from 2nd + 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment