User file format

The user file in Plants vs. Zombies contains all the essential data about your progress in the game, money, unlocked modes, trophies, achievements, purchased items, plants in your Zen Garden, and your Zombatars. This page describes the format of the user file. It can be modified directly with a hex editor, such as Frhed. There is also an easy-to-use user file editor under development.

File location and version
This information is based on the following version of Plants vs. Zombies (from readme.html in the installation directory):

Version 1.2.0.1073

Release Date: May 5, 2009

Build Date: August 20, 2012

Your user file is in C:\ProgramData\PopCap Games\PlantsVsZombies\userdata and is called user1.dat. If you have multiple users, there might be user2.dat, etc. - they are in the order listed in users.dat. If your file starts with "0x0C" (file version 12) it should be compatible with the below information. Otherwise there will be differences, but overall it should be similar.

The game loads user1.dat at startup and saves it on exit, so it can only be modified while the game is not running. WARNING: Create a backup copy of your original user1.dat file before modifying it, or you may end up with a corrupt file that crashes the game and no way to recover!

Types and formatting
In the below, decimal integer values will be written normally (e.g. 25) and hexadecimal values preceded by "0x" as in "0x1C". All values are little-endian: least significant bytes come first, so e.g. 511 or 0x1ff would be written in the file as "ff 01 00 00" if the field has a length of 4 bytes. Fields labelled "UNIX timestamp" are given in terms of the number of seconds since Jan 1, 1970 12:00:00am in UTC and can be converted using this online converter.

File format
Followed by 88 (0x58) bytes for each plant in Zen Garden, with the following structure:

The Zen Garden plants are followed by the following fields. In the table below offsets start after the last plant. To find the base, take the number at offset 0x330 (number of plants), multiply it by 88 (0x58), and add 0x334.

Followed by 72 (0x48) bytes for each Zombatar, with the following structure (still figuring this part out):

The Zombatars are followed by the following fields. In the table below offsets start after the last Zombatar. To find the base, take the number at offset 0x330 (number of plants), multiply it by 88 (0x58), take the number at offset 0x2D (number of Zombatars), multiply it by 72 (0x48), and add both to 0x365.