Category:Save Data: Difference between revisions

From COD Engine Research
Red-EyeX32 (talk | contribs)
Red-EyeX32 (talk | contribs)
Undo revision 1035 by Red-EyeX32 (talk)
Tag: Undo
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== GPAD0 Files (Modern Warfare 2, Modern Warfare 3, Ghosts, Advanced Warfare) ==
== GPADX.PRF Files ==
These files (GPAD0_MP.PRF, GPAD0_CM.PRF, GPAD0_SP.PRF) contain variables related to game settings.
These files (GPADX_MP.PRF, GPADX_CM.PRF, and GPADX_SP.PRF, "X" being the controller number) contain variables related to game settings.


<source lang="cpp">
=== Call of Duty 4: Modern Warfare, World at War ===
Call of Duty 4 stores the GPAD files in plaintext. The max size the file can be is 1000 bytes. It was then later patched by Infinity Ward because users started to edit the files to exploit the game.
 
World at War in the other hand, is encrypted using Sony's AES encryption algorithm. After decrypting that layer the GPAD's is going to be plaintext just like Call of Duty 4. Treyarch hasn't bothered in patching the files, which allows modifications on the game.
 
Both games use .cfg codes, which is easy to manipulate dvars (Developer Vars).
 
=== Black Ops & Black Ops II ===
Treyarch has added additional protection on the save data. It is first encrypted using Sony's AES algorithm, after decrypting that layer it is additionally encrypted using the TripleDES-CBC algorithm.
 
3DES key:
<syntaxhighlight lang="cpp">
unsigned char black_ops_3des_key[24] = "Md8ea20lPcftYwsl496q63x9"
</syntaxhighlight>
 
3DES IV (Initialization Vector)
<syntaxhighlight lang="cpp">
unsigned char black_ops_3des_iv[24] = "0Peyx825J4S2ndpr54rW312z"
</syntaxhighlight>
 
After decrypting this TripleDES layer it is then plaintext in Black Ops and you are able to edit the file to your liking, allowing you to edit dvars and .cfg code. On Black Ops II in the other hand, it has hard-coded dvars that has a structure stored in the DDL asset.
 
=== Modern Warfare 2, Modern Warfare 3, Ghosts, Advanced Warfare ===
Ever since Modern Warfare 2, Infinity Ward started compiling the saves because of people taking advantage of cfg code in Call of Duty 4. They are hard-coded dvars that can only mod in-game settings like sensivity, in-game volume, and button configurations etc...
 
For each entry, first a 32 bit integer is stored as an id. After that, the value is stored. The values are stored like so:
<syntaxhighlight lang="cpp">
enum GamerProfileDataType
enum GamerProfileDataType
{
{
Line 12: Line 38:
   TYPE_FLOAT = 0x5,
   TYPE_FLOAT = 0x5,
   TYPE_STRING = 0x6,
   TYPE_STRING = 0x6,
#if defined(IW5) || defined(IW6) || defined(S1) // If it is Modern Warfare 3, Ghosts, or Advanced Warfare...
   TYPE_BITFIELD = 0x7,
   TYPE_BITFIELD = 0x7,
#endif
};
};


Line 30: Line 58:
   GamerProfileDataUnion u;
   GamerProfileDataUnion u;
};
};
</source>
</syntaxhighlight>


[[GPAD0 COD(4,5,7)|COD4, COD5, COD7]]
The id's are listed below.
==== Ghosts ====
<!-- TODO: redo as table (each console may be different) -->
<!-- Actually both consoles are the same -->
===== Common =====
<!-- TODO: finish this later, after all id's have been found.
{| class="wikitable"
!rowspan="2"|Settings
!colspan="1"|MW2
!colspan="1"|MW3
!colspan="1"|Ghosts
!colspan="1"|AW
|-
!ID
!ID
!ID
!ID
|-
| invertPitch
| 0x0
| 0x0
| 0x0
| 0x0
|-
| autoAim
| 0x1
| 0x1
| 0x1
| 0x1
|-
| viewSensitivity
| 0x2
| 0x2
| 0x2
| 0x2
|-
| safeAreaHorz
| 0x3
| 0x3
| 0x3
| 0x3
|-
| safeAreaVert
| 0x4
| 0x4
| 0x4
| 0x4
|-
| blacklevel
| 0x5
| 0x5
| 0x5
| 0x5
|-
| volume
| 0x6
| 0x6
| 0x6
| 0x6
|-
| safeareaHorizontal
| 0x7
| 0x7
| 0x7
| 0x7
|-
| safeareaVertical
| 0x8
| 0x8
| 0x8
| 0x8
|-
| timeplayedsp
| 0x9
| 0x9
| 0x9
| 0x9
|-
| timeplayedmp
| 0xA
| 0xA
| 0xA
| 0xA
|-
| timeplayedso
| 0xB
| 0xB
| 0xB
| 0xB
|-
| percentcompletesp
| 0xC
| 0xC
| 0xC
| 0xC
|-
| percentcompletemp
| 0xD
| 0xD
| 0xD
| 0xD
|-
| percentcompleteso
| 0xE
| 0xE
| 0xE
| 0xE
|-
| hasEverPlayed_MainMenu
| 0xF
| 0xF
| 0xF
| 0xF
|-
| hasEverPlayed_SP
| 0x10
| 0x10
| 0x10
| 0x10
|-
| hasEverPlayed_SO
| 0x11
| 0x11
| 0x11
| 0x11
|-
| hasEverPlayed_MP
| 0x12
| 0x12
| 0x12
| 0x12
|-
| canSkipOffensiveMissions
| 0x13
| 0x13
| 0x13
| 0x13
|-
| rumble
| 0x14
| 0x14
| 0x14
| 0x14
|-
| gpadButtonsConfig
| 0x16
| 0x16
| 0x16
| 0x16
|-
| gpadSticksConfig
| 0x17
| 0x17
| 0x17
| 0x17
|-
| viewedPatchNotesVersion
| N/A
| 0x18
| 0x18
| 0x18
|-
|}
-->
<syntaxhighlight lang="cpp">
enum GamerProfileCommonSettings
{
  invertPitch = 0x0,
  autoAim = 0x1,
  viewSensitivity = 0x2,
  safeAreaHorz = 0x3,
  safeAreaVert = 0x4,
  blacklevel = 0x5,
  volume = 0x6,
  safeareaHorizontal = 0x7,
  safeareaVertical = 0x8,
  timeplayedsp = 0x9,
  timeplayedmp = 0xA,
  timeplayedso = 0xB,
  percentcompletesp = 0xC,
  percentcompletemp = 0xD,
  percentcompleteso = 0xE,
  hasEverPlayed_MainMenu = 0xF,
  hasEverPlayed_SP = 0x10,
  hasEverPlayed_SO = 0x11,
  hasEverPlayed_MP = 0x12,
  canSkipOffensiveMissions = 0x13,
  rumble = 0x14,
  // unused
  gpadButtonsConfig = 0x16,
  gpadSticksConfig = 0x17,
  viewedPatchNotesVersion = 0x18,
  viewedGameInfosVersion = 0x19,
  cardIcon = 0x1A,
  cardTitle = 0x1B,
  experience_MP = 0x1C,
  experience_Aliens = 0x1D,
  prestige_MP = 0x1E,
  prestige_Aliens = 0x1F,
  iconUnlocked = 0x20,
  titleUnlocked = 0x21,
  iconNew = 0x22,
  titleNew = 0x23,
  unlock = 0x24,
  unlockNew = 0x25,
  clanPrefix = 0x26,
  leanEnabled = 0x27,
  useEliteClanTag = 0x28,
  eliteClanTagText = 0x29,
  eliteClanLevel = 0x2A,
  initialGameMode = 0x2B,
  // unknown
  facebook = 0x2D,
  unlockedAliens = 0x2E,
  renderColorBlind = 0x2F,
  // unused
  // unused
  firstTimePlayedSPTime = 0x32,
  knowsAboutAliens = 0x33,
  speechReduced = 0x34,
  COMMON_SETTINGS_TOTAL_COUNT = 0x35,
};
</syntaxhighlight >
 
===== Multiplayer =====
<syntaxhighlight lang="cpp">
enum GamerProfileExeSettings // MP
{
  playlist = 0x0,
  voiceSpeakerGain = 0x1,
  spareBool0 = 0x2,
  spareBool1 = 0x3,
  spareBool2 = 0x4,
  spareBool3 = 0x5,
  spareBool4 = 0x6,
  spareBool5 = 0x7,
  spareBool6 = 0x8,
  spareBool7 = 0x9,
  spareBool8 = 0xA,
  spareBool9 = 0xB,
  spareBool10 = 0xC,
  spareBool11 = 0xD,
  spareBool12 = 0xE,
  spareBool13 = 0xF,
  spareBool14 = 0x10,
  spareBool15 = 0x11,
  motd = 0x12,
  EXE_SETTINGS_TOTAL_COUNT = 0x13,
};
</syntaxhighlight>
===== Singleplayer =====
<syntaxhighlight lang="cpp">
enum GamerProfileExeSettings // SP
{
  difficulty = 0x0,
  takeCoverWarnings = 0x1,
  cheat_points = 0x2,
  intelp1 = 0x3,
  intelp2 = 0x4,
  cg_subtitles = 0x5,
  highestMission = 0x6,
  missionspecops = 0x7,
  // 0x20 array of unknown (unused?) ints
  motd = 0x28,
  missionhighestdifficulty = 0x29,
  missionsohighestdifficulty = 0x2A,
  sv_lastSaveGame = 0x2B,
  EXE_SETTINGS_TOTAL_COUNT = 0x2C,
};
</syntaxhighlight >
 
== FILE.SVG ==
=== Call of Duty: Classic ===
<syntaxhighlight lang="cpp">
struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};
 
struct SaveHeader
{
  int saveVersion;
  char mapNameLen;
  char mapName[mapNameLen];
  char buildNumberLen;
  char buildNumber[buildNumberLen];
  char unknown1[20];
  char campaignLen;
  char campaign[campaignLen];
  char screenShotNameLen;
  char screenShotName[screenShotNameLen];
  int unknown2;
  char descriptionLen;
  char description[descriptionLen];
  qtime_s time;
  int bodySize;
};
</syntaxhighlight >


== SAVEGAME.SVG ==
== SAVEGAME.SVG ==
<source lang="cpp">
=== World at War ===
<syntaxhighlight lang="cpp">
struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};
 
struct SaveHeader
{
int saveVersion;
int gameCheckSum;
int saveCheckSum;
int saveId;
bool isUsingScriptChecksum;
int scrCheckSum[3];
char mapName[256];
char buildNumber[128];
char campaign[256];
char screenShotName[64];
char description[256];
char filename[64];
int health;
int skill;
bool internalSave;
qtime_s time;
int server_bodySize;
int client_bodySize;
};
</syntaxhighlight>
 
=== Black Ops & Black Ops II ===
<syntaxhighlight lang="cpp">
enum SaveType
enum SaveType
{
{
Line 41: Line 413:
   SAVE_TYPE_AUTOSAVE = 0x1,
   SAVE_TYPE_AUTOSAVE = 0x1,
   SAVE_TYPE_CONSOLE = 0x2,
   SAVE_TYPE_CONSOLE = 0x2,
  SAVE_TYPESCOUNT = 0x3,
};
};


Line 68: Line 439:
   char mapName[256];
   char mapName[256];
   char buildNumber[128];
   char buildNumber[128];
  unsigned int omnvarPerGameCount;
   char gametype[256];
  unsigned int omnvarPerClientCount;
   char gametype[128];
   char buildVersionSuffix[16];
   char buildVersionSuffix[16];
   unsigned int networkProtocol;
   unsigned int networkProtocol;
Line 79: Line 448:
   qtime_s time;
   qtime_s time;
   int bodySize;
   int bodySize;
   unsigned int pad[6];
   unsigned int pad[8];
};
</syntaxhighlight>
 
=== Ghosts ===
<syntaxhighlight lang="cpp">
enum SaveType
{
  SAVE_TYPE_INTERNAL = 0x0,
  SAVE_TYPE_AUTOSAVE = 0x1,
  SAVE_TYPE_CONSOLE = 0x2,
  SAVE_TYPESCOUNT = 0x3,
};
};


struct MemoryFile
struct qtime_s
{
{
   char *buffer;
   int tm_sec;
   unsigned __int64 bufferSize;
   int tm_min;
   unsigned __int64 bufferSizeOriginal;
   int tm_hour;
   unsigned __int64 bytesUsed;
   int tm_mday;
   int segmentIndex;
   int tm_mon;
   unsigned __int64 segmentStart;
   int tm_year;
   int segmentFullLen;
   int tm_wday;
   bool errorOnOverflow;
   int tm_yday;
   bool memoryOverflow;
   int tm_isdst;
  bool compress;
  void (__cdecl *archiveProc)(MemoryFile *, unsigned __int64, void *);
};
};


struct __declspec(align(128)) SaveGame
struct SaveHeader
{
{
   SaveHeader header;
   int saveVersion;
   MemoryFile memFile;
   int gameCheckSum;
  int saveCheckSum;
  int saveId;
  bool demoPlayback;
  bool splitscreen;
  int scrCheckSum[3];
  char mapName[256];
  char buildNumber[128];
  unsigned int omnvarPerGameCount;
  unsigned int omnvarPerClientCount;
  char gametype[128];
  char buildVersionSuffix[16];
  unsigned int networkProtocol;
  char screenShotName[64];
  char description[256];
  char filename[64];
  SaveType saveType;
  qtime_s time;
  int bodySize;
  unsigned int pad[6];
};
};
</source>
</syntaxhighlight>

Latest revision as of 04:15, 16 December 2024

GPADX.PRF Files

These files (GPADX_MP.PRF, GPADX_CM.PRF, and GPADX_SP.PRF, "X" being the controller number) contain variables related to game settings.

Call of Duty 4: Modern Warfare, World at War

Call of Duty 4 stores the GPAD files in plaintext. The max size the file can be is 1000 bytes. It was then later patched by Infinity Ward because users started to edit the files to exploit the game.

World at War in the other hand, is encrypted using Sony's AES encryption algorithm. After decrypting that layer the GPAD's is going to be plaintext just like Call of Duty 4. Treyarch hasn't bothered in patching the files, which allows modifications on the game.

Both games use .cfg codes, which is easy to manipulate dvars (Developer Vars).

Black Ops & Black Ops II

Treyarch has added additional protection on the save data. It is first encrypted using Sony's AES algorithm, after decrypting that layer it is additionally encrypted using the TripleDES-CBC algorithm.

3DES key:

unsigned char black_ops_3des_key[24] = "Md8ea20lPcftYwsl496q63x9"

3DES IV (Initialization Vector)

unsigned char black_ops_3des_iv[24] = "0Peyx825J4S2ndpr54rW312z"

After decrypting this TripleDES layer it is then plaintext in Black Ops and you are able to edit the file to your liking, allowing you to edit dvars and .cfg code. On Black Ops II in the other hand, it has hard-coded dvars that has a structure stored in the DDL asset.

Modern Warfare 2, Modern Warfare 3, Ghosts, Advanced Warfare

Ever since Modern Warfare 2, Infinity Ward started compiling the saves because of people taking advantage of cfg code in Call of Duty 4. They are hard-coded dvars that can only mod in-game settings like sensivity, in-game volume, and button configurations etc...

For each entry, first a 32 bit integer is stored as an id. After that, the value is stored. The values are stored like so:

enum GamerProfileDataType
{
  TYPE_INVALID = 0x0,
  TYPE_BYTE = 0x1,
  TYPE_BOOL = 0x2,
  TYPE_SHORT = 0x3,
  TYPE_INT = 0x4,
  TYPE_FLOAT = 0x5,
  TYPE_STRING = 0x6,
#if defined(IW5) || defined(IW6) || defined(S1) // If it is Modern Warfare 3, Ghosts, or Advanced Warfare...
  TYPE_BITFIELD = 0x7,
#endif
};

union GamerProfileDataUnion
{
  char byteVal;
  bool boolVal;
  __int16 shortVal;
  int intVal;
  float floatVal;
  const char *stringVal;
};

struct GamerProfileData
{
  GamerProfileDataType type;
  GamerProfileDataUnion u;
};

The id's are listed below.

Ghosts

Common
enum GamerProfileCommonSettings
{
  invertPitch = 0x0,
  autoAim = 0x1,
  viewSensitivity = 0x2,
  safeAreaHorz = 0x3,
  safeAreaVert = 0x4,
  blacklevel = 0x5,
  volume = 0x6,
  safeareaHorizontal = 0x7,
  safeareaVertical = 0x8,
  timeplayedsp = 0x9,
  timeplayedmp = 0xA,
  timeplayedso = 0xB,
  percentcompletesp = 0xC,
  percentcompletemp = 0xD,
  percentcompleteso = 0xE,
  hasEverPlayed_MainMenu = 0xF,
  hasEverPlayed_SP = 0x10,
  hasEverPlayed_SO = 0x11,
  hasEverPlayed_MP = 0x12,
  canSkipOffensiveMissions = 0x13,
  rumble = 0x14,
  // unused
  gpadButtonsConfig = 0x16,
  gpadSticksConfig = 0x17,
  viewedPatchNotesVersion = 0x18,
  viewedGameInfosVersion = 0x19,
  cardIcon = 0x1A,
  cardTitle = 0x1B,
  experience_MP = 0x1C,
  experience_Aliens = 0x1D,
  prestige_MP = 0x1E,
  prestige_Aliens = 0x1F,
  iconUnlocked = 0x20,
  titleUnlocked = 0x21,
  iconNew = 0x22,
  titleNew = 0x23,
  unlock = 0x24,
  unlockNew = 0x25,
  clanPrefix = 0x26,
  leanEnabled = 0x27,
  useEliteClanTag = 0x28,
  eliteClanTagText = 0x29,
  eliteClanLevel = 0x2A,
  initialGameMode = 0x2B,
  // unknown
  facebook = 0x2D,
  unlockedAliens = 0x2E,
  renderColorBlind = 0x2F,
  // unused
  // unused
  firstTimePlayedSPTime = 0x32,
  knowsAboutAliens = 0x33,
  speechReduced = 0x34,
  COMMON_SETTINGS_TOTAL_COUNT = 0x35,
};
Multiplayer
enum GamerProfileExeSettings // MP
{
  playlist = 0x0,
  voiceSpeakerGain = 0x1,
  spareBool0 = 0x2,
  spareBool1 = 0x3,
  spareBool2 = 0x4,
  spareBool3 = 0x5,
  spareBool4 = 0x6,
  spareBool5 = 0x7,
  spareBool6 = 0x8,
  spareBool7 = 0x9,
  spareBool8 = 0xA,
  spareBool9 = 0xB,
  spareBool10 = 0xC,
  spareBool11 = 0xD,
  spareBool12 = 0xE,
  spareBool13 = 0xF,
  spareBool14 = 0x10,
  spareBool15 = 0x11,
  motd = 0x12,
  EXE_SETTINGS_TOTAL_COUNT = 0x13,
};
Singleplayer
enum GamerProfileExeSettings // SP
{
  difficulty = 0x0,
  takeCoverWarnings = 0x1,
  cheat_points = 0x2,
  intelp1 = 0x3,
  intelp2 = 0x4,
  cg_subtitles = 0x5,
  highestMission = 0x6,
  missionspecops = 0x7,
  // 0x20 array of unknown (unused?) ints
  motd = 0x28,
  missionhighestdifficulty = 0x29,
  missionsohighestdifficulty = 0x2A,
  sv_lastSaveGame = 0x2B,
  EXE_SETTINGS_TOTAL_COUNT = 0x2C,
};

FILE.SVG

Call of Duty: Classic

struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

struct SaveHeader
{
  int saveVersion;
  char mapNameLen;
  char mapName[mapNameLen];
  char buildNumberLen;
  char buildNumber[buildNumberLen];
  char unknown1[20];
  char campaignLen;
  char campaign[campaignLen];
  char screenShotNameLen;
  char screenShotName[screenShotNameLen];
  int unknown2;
  char descriptionLen;
  char description[descriptionLen];
  qtime_s time;
  int bodySize;
};

SAVEGAME.SVG

World at War

struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

struct SaveHeader
{
 int saveVersion;
 int gameCheckSum;
 int saveCheckSum;
 int saveId;
 bool isUsingScriptChecksum;
 int scrCheckSum[3];
 char mapName[256];
 char buildNumber[128];
 char campaign[256];
 char screenShotName[64];
 char description[256];
 char filename[64];
 int health;
 int skill;
 bool internalSave;
 qtime_s time;
 int server_bodySize;
 int client_bodySize;
};

Black Ops & Black Ops II

enum SaveType
{
  SAVE_TYPE_INTERNAL = 0x0,
  SAVE_TYPE_AUTOSAVE = 0x1,
  SAVE_TYPE_CONSOLE = 0x2,
};

struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

struct SaveHeader
{
  int saveVersion;
  int gameCheckSum;
  int saveCheckSum;
  int saveId;
  bool demoPlayback;
  bool splitscreen;
  int scrCheckSum[3];
  char mapName[256];
  char buildNumber[128];
  char gametype[256];
  char buildVersionSuffix[16];
  unsigned int networkProtocol;
  char screenShotName[64];
  char description[256];
  char filename[64];
  SaveType saveType;
  qtime_s time;
  int bodySize;
  unsigned int pad[8];
};

Ghosts

enum SaveType
{
  SAVE_TYPE_INTERNAL = 0x0,
  SAVE_TYPE_AUTOSAVE = 0x1,
  SAVE_TYPE_CONSOLE = 0x2,
  SAVE_TYPESCOUNT = 0x3,
};

struct qtime_s
{
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
  int tm_yday;
  int tm_isdst;
};

struct SaveHeader
{
  int saveVersion;
  int gameCheckSum;
  int saveCheckSum;
  int saveId;
  bool demoPlayback;
  bool splitscreen;
  int scrCheckSum[3];
  char mapName[256];
  char buildNumber[128];
  unsigned int omnvarPerGameCount;
  unsigned int omnvarPerClientCount;
  char gametype[128];
  char buildVersionSuffix[16];
  unsigned int networkProtocol;
  char screenShotName[64];
  char description[256];
  char filename[64];
  SaveType saveType;
  qtime_s time;
  int bodySize;
  unsigned int pad[6];
};

This category currently contains no pages or media.