Xbox 360 GPD

From EurAsiaWiki

Jump to: navigation, search

Source: http://free60.org/GPD


GPD (Gamer Profile Data) files are used by the Xbox 360 to store information inside a profile. They are based on the XDBF format. Profiles are composed of many of these files, each named under their respective executable's title id (e.g. 4D5307E6.gpd for Halo 3). The dashboard GPD (FFFE07D1.gpd) contains information and sync information about the titles.

Contents

Entry Table

An ID of 0x100000000 indicates that the entry is a Sync List, an ID of 0x200000000 means its a Sync Data entry.

The Settings, Achievement and Title namespaces each have their own Sync List and Sync Data entries.

An ID of 0x8000 usually indicates that entry is information to do with the title (image/name).

Entry Namespaces

Value Description
1 Achievement
2 Image
3 Setting
4 Title
5 String
6 Achievement Security (created by GFWL for offline unlocked achievements?)
6 Avatar Award (360 only, this is only stored with in the PEC version of the GPD)

Entry IDs

Title Entrys have the ID of there corresponding TitleID.
Avatar Awards ID's seem to be the TitleID then something to (identify the xbox.com image)?

Description Value
Sync List 0x100000000
Sync Data 0x200000000
Option Controller Vibration 0x10040003
Title Specific1 0x63E83FFF
Title Specific2 0x63E83FFE
Title Specific3 0x63E83FFD
Gamer Yaxis Inversion 0x10040002
Gamercard Zone 0x10040004
Gamercard Region 0x10040005
Gamercard Cred 0x10040006
Gamercard Rep 0x50040011
Option Voice Muted 0x10040012
Option Voice Thru Speakers 0x10040013
Option Voice Thru Speakers Raw 0x10040063
Option Voice Volume 0x10040014
Gamercard Titles Played 0x10040018
Gamercard Achievements Earned 0x10040019
Gamer Difficulty 0x10040021
Gamer Control Sensitivity 0x10040024
Gamer Preferred Color First 0x10040029
Gamer Preferred Color Second 0x10040030
Gamer Action Auto Aim 0x10040034
Gamer Action Auto Center 0x10040035
Gamer Action Movement Control 0x10040036
Gamer Race Transmission 0x10040038
Gamer Race Camera Location 0x10040039
Gamer Race Brake Control 0x10040040
Gamer Race Accelerator Control 0x10040041
Gamercard Title Cred Earned 0x10040056
Gamercard Title Achievements Earned 0x10040057
Avatar Metadata 0x63E80068
Gamercard Picture Key 0x4064000F
Gamercard Motto 0x402C0011
Title Information 0x8000
Gamer Name 0x41040040
Gamer Location 0x40520041
Avatar Information 0x63e80044
Avatar Image 0x8007

http://pastebin.com/mW3fmvpG

Entry Structures

Achievement Entries

Offset Length Type Information
0x0 0x4 unsigned int Struct size (0x1C)
0x4 0x4 unsigned int Achievement ID
0x8 0x4 unsigned int Image ID
0xC 0x4 signed int Gamerscore
0x10 0x4 unsigned int Flags (see below)
0x14 0x8 System.DateTime(signed long) Unlock Time
0x18 null terminated unicode string Name
0x18 + Name length null terminated unicode string Locked Description
0x18 + Name length + Locked Description length null terminated unicode string Unlocked Description

Flags

       public enum AchievementTypes : byte
       {
           Completion = 1,//<AchievementType value="1">Completion</AchievementType>
           Leveling = 2,//<AchievementType value="2">Leveling</AchievementType>
           Unlock = 3,//<AchievementType value="3">Unlock</AchievementType>
           Event = 4,//<AchievementType value="4">Event</AchievementType>
           Tournament = 5,//<AchievementType value="5">Tournament</AchievementType>
           Checkpoint = 6,//<AchievementType value="6">Checkpoint</AchievementType>
           Other = 7,//<AchievementType value="7">Other</AchievementType>
       }
       public System.UInt32 Flags;
       public AchievementTypes AchievementType
       {
           get
           {
               return (AchievementTypes)(Flags & 7);
           }
           set
           {
               Flags ^= (System.UInt32)value ^ (Flags & 7);
           }
       }
       public System.Boolean AchievementShowUnachieved//!Sectet
       {
           get
           {
               return (Flags & 8) == 8;
           }
           set
           {
               Flags ^= 8;
           }
       }
       public System.Boolean AchievementEarnedOnline
       {
           get
           {
               return (Flags & 65536) == 65536;
           }
           set
           {
               Flags ^= 65536;
           }
       }
       public System.Boolean AchievementEarned
       {
           get
           {
               return (Flags & 131072) == 131072;
           }
           set
           {
               Flags ^= 131072;
           }
       }

Setting Entries

Offset Length Type Information
0 4 Int32 SettingID(entry ID)
4 4 Int32 Null/unused
8 1 Byte DataType (see Below)
9 7 Byte[] Unknown
16 *depends on DataType* *depends on DataType* Data
Description Value
Context 0
Int32 1
Int64 2
Double 3
(UNI)String 4
Float 5
Binary 6
DateTime 7
Null 0xFF

UNICODE
Int32 Length
Int32 0
String Value

Binary
Int32 Length
Int32 0
Byte[] Value

Image Entries

Image entries are composed of a PNG image.
To Read and write this its probable best to use memory streams, I do it like

       public System.Byte[] Data
       {
           get
           {
               System.Byte[] TempData;
               System.IO.MemoryStream TempStream = new System.IO.MemoryStream();
               Img.Save(TempStream, System.Drawing.Imaging.ImageFormat.Png);
               TempData = TempStream.ToArray();
               TempStream.Close();
               return TempData;
           }
           set
           {
               System.IO.MemoryStream TempStream = new System.IO.MemoryStream(value);
               Img = System.Drawing.Image.FromStream(TempStream);
               TempStream.Close();
           }
       }

Title Entries

These entries are located in the FFFE07D1.gpd. To get to them, the id for the XDBF entry is the title ID of the game, and the XDBF entry type is String.

Offset Length Type Information
0x0 0x4 unsigned int Title ID
0x4 0x4 signed int Achievement Count
0x8 0x4 signed int Achievement Unlocked Count
0xC 0x4 signed int Gamerscore Total
0x10 0x4 signed int Gamerscore Unlocked
0x14 0x1 unsigned byte Unknown
0x15 0x1 unsigned byte Achievement Unlocked Online Count
0x16 0x01 byte Avatar Assets Earned
0x17 0x01 byte Avatar Assets Max
0x18 0x01 byte Male Avatar Assets Earned
0x19 0x01 byte Male Avatar Assets Max
0x1A 0x01 byte Female Avatar Assets Earned
0x1B 0x01 byte Female Avatar Assets Max
0x1C 0x4 unsigned int Flags (see below)
0x20 0x8 signed long Last Played Time
0x28 null terminated unicode string Title Name


These are not all the flags, it's just that I don't know the rest.

Value Description
0x1 Achievement Unlocked Offline, needs to be synced.
0x2 Achievement Unlocked, image needs to be downloaded.
0x10 Avatar Award Unlocked, needs to be downloaded.

Avatar Award Entries

The entries are only supported within the PEC version of the GPD. The images for the avatar awards, are stored in the game GPD for that game.

Offset Length Type Information
0 4 uint32 Struct size (0x2C)
4 4 UInt32 AssetID
8 2 UInt16 Unknown1
10 2 UInt16 GenderFlag
12 2 UInt16 Unknown2
14 2 UInt16 Unknown3
16 4 UInt32 TitleID
20 4 UInt32 ImageID
24 4 uInt32 Flags(Same as achievement)
28 8 Int64 Unlock Time
36 4 u/Int32 Unknown4
40 4 u/Int32 Unknown5
44 Till Null UniCode Name
44 + Name length Till Null UniCode Locked Description
44 + Name length + Locked Description length Till Null UniCode Unlocked Description

Image

The Image stored in the GPD is stored in the normal GPD however you can grab the image from the server, Using the GUID.

       public System.String GUID()
       {
           return AssetID.ToString("x8") + "-" + Unknown1.ToString("x4") + "-" + GenderFlag.ToString("x4") + "-" + Unknown2.ToString("x4") + "-" + Unknown3.ToString("x4") + TitleID.ToString("x8");
       }

Then simply using the GUID

       public System.String LittleImageURL()
       {
           return "http://avatar.xboxlive.com/global/t." + TitleID.ToString("x8") + "/avataritem/" + GUID() + "/64";
       }
       public System.String BigImageURL()
       {
           return "http://avatar.xboxlive.com/global/t." + TitleID.ToString("x8") + "/avataritem/" + GUID() + "/128";
       }

String Entries

String entries are simply a unicode string, to the length specified by the entry.

Sync Lists

This is a list of "Sync Items".

You can find the total sync items by,

((SyncList.Length / 16) - 1)

Sync Item

Offset Length Type Information
0 8 Int64 EntryID
8 8 Int64 SyncID

I don't know much about the second id, however I believe it to have something to do with the SyncData's "Next Sync ID".

Sync Data

Offset Length Type Information
0x0 0x8 unsigned long Next Sync ID
0x8 0x8 unsigned long Last Synced ID
0x10 0x8 signed long Last Synced Time
Personal tools