I've been looking on the save files in a hex editor but I can't quite seem to figure out the purpose of most positions.
What I have figured out so far is basically the ground rules:
1-4 = unknown
5-6 = zero
7-8 = unknown
9 = pokemon id
10 = zero
11 = unknown
12 = zero
13-19 = unknown
2...