Micropolis (The original SimCity) is old game (published in 1989) and newly freed game (released GPLv3 in 2008.) You can download the source code from Don Hopkins' Micropolis Downloads page. Michael Gernoth's micropolis git repository is also useful.

How To Get $2,147,483,647

The amount of funds is written in cty file at offset 0x0BA4. To get $2,147,483,647, follow these steps:

  1. Open the cty file with a hex editor.
  2. Jump to 0x0BA4, and
  3. Modify 0x7FFFFFFF (signed 4-bytes)
          0011 2233 4455 6677 8899 aabb ccdd eeff  0123456789abcdef
00000ba0: 0000 0000 0000 893d 0001 0001 0000 0001  .......=........
|
v
00000ba0: 0000 0000 7fff ffff 0001 0001 0000 0001  ................

cty file format

Micropolis's cty file format is as following:

#define WORLD_X     120
#define WORLD_Y     120
#define HISTLEN     480
#define MISCHISTLEN 240

typedef struct {
    short   ResHis[HISTLEN/2];
    short   ComHis[HISTLEN/2];
    short   IndHis[HISTLEN/2];
    short   CrimeHis[HISTLEN/2];
    short   PollutionHis[HISTLEN/2];
    short   MoneyHis[HISTLEN/2];
    short   MiscHis[MISCHISTLEN/2];
    short   Map[WORLD_X * WORLD_Y];
} CTY_DATA;

Note: short is a Big-Endian (signed) 16-bits number.

For example, Map data is written in cty file at offset 0x0C30. (0x0C30 = 3120 = HISTLEN * 6 + MISCHISTLEN)

Total funds is MiscHis[50] and MiscHis[51] as a signed 32-bit number. MiscHis[50] is high-order word and MiscHis[51] is low-order word. This is written at micropolis's source code (src/sim/s_fileio.c#loadFile(char*)) as follows:


   /* total funds is a long.....    MiscHis is array of shorts */
   /* total funds is being put in the 50th & 51th word of MiscHis */
   /* find the address, cast the ptr to a lontPtr, take contents */
 
   l = *(QUAD *)(MiscHis + 50);
   HALF_SWAP_LONGS(&l, 1);
   SetFunds(l);

See also