POPCHT.DAT

Discuss PoP1 for DOS here.
Post Reply
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5745
Joined: April 9th, 2009, 10:58 pm

POPCHT.DAT

Post by Norbert »

What exactly is POPCHT.DAT? (A file that is inside popot.org's PoP1.zip.)
The game runs without it.
"CHT" may indicate a cheat program adds or uses it in some way.

Its contents is:

Code: Select all

50 72 69 6E 63 65 20 6F 66 20 50 65 72 73 69 61  Prince of Persia
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70  ...............p
72 69 6E 63 65 2E 65 78 65 00 00 00 00 00 01 00  rince.exe.......
07 00 65 20 61 39 39 20 39 30 20 39 30 20 39 30  ..e a99 90 90 90
20 39 30 0D 0A 65 20 63 33 66 66 20 39 30 20 39   90..e c3ff 90 9
30 20 39 30 20 39 30 0D 0A 00 00 65 20 61 39 39  0 90 90....e a99
20 66 66 20 30 65 20 37 65 20 34 66 0D 0A 20 65   ff 0e 7e 4f.. e
20 63 33 66 66 20 66 66 20 30 65 20 37 65 20 34   c3ff ff 0e 7e 4
66 0D 0A 00 00 00 00 00 00 00 00 00 00 00 00 00  f...............
Its contents is partially duplicate:

Code: Select all

50 72 69 6E 63 65 20 6F 66 20 50 65 72 73 69 61       "Prince of Persia"
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00          "..............."
70 72 69 6E 63 65 2E 65 78 65                         "prince.exe"

00 00 00 00 00                                        "....."
01 00 07 00                                           "...."

65 20 61 39 39                                        "e a99"
20 39 30 20 39 30 20 39 30 20 39 30 0D 0A             " 90 90 90 90.."
65 20 63 33 66 66                                     "e c3ff"
20 39 30 20 39 30 20 39 30 20 39 30 0D 0A             " 90 90 90 90.."

00 00                                                 ".."

65 20 61 39 39                                        "..e a99"
20 66 66 20 30 65 20 37 65 20 34 66 0D 0A             " ff 0e 7e 4f.."
20                                                    " "
65 20 63 33 66 66                                     "e c3ff"
20 66 66 20 30 65 20 37 65 20 34 66 0D 0A             " ff 0e 7e 4f.."

00 00 00 00 00 00 00 00 00 00 00 00 00                "............."
And "ff 0e 7e 4f" is actually in PRINCE.EXE, although this could be a coincidence.
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: POPCHT.DAT

Post by David »

And "ff 0e 7e 4f" is actually in PRINCE.EXE, although this could be a coincidence.
The offsets of these occurrences are 0x999 and 0xC2FF (in PRINCE.EXE 1.0 packed).
The numbers in POPCHT.DAT before them are (0x)a99 and (0x)c3ff, that is, 0x100 was added to the offsets.
So these are commands that instruct some program to edit PRINCE.EXE.

The syntax of these commands, and the fact that the file is loaded from offset 0x100, these remind me of DEBUG.EXE, a command line debugger that comes with DOS and Windows. (It can also be used as a hex-editor.)

Offset 0x100 is used because DEBUG assumes that the loaded file is a *.COM file (unless its extension is EXE or HEX), and those are loaded at offset 0x100.
(So PRINCE.EXE has to be renamed if one wants to edit it this way.)
Maybe the cheater program, that made these files, uses DEBUG for making the changes?
I might try to find out what program makes this type of file. (By searching for "DOS cheat utility" or something like that.)

It seems that the file contains two sets of commands.
The first is to add the cheats: (overwrite some bytes)

Code: Select all

e a99 90 90 90 90
e c3ff 90 90 90 90
The second is to remove them: (restore those bytes)

Code: Select all

e a99 ff 0e 7e 4f
e c3ff ff 0e 7e 4f
So what do these do?
Let's search for "ff 0e 7e 4f" in the disassembly:

Code: Select all

seg000:0799 FF 0E 7E 4F				 dec	 rem_min

Code: Select all

seg008:24DF FF 0E 7E 4F				 dec	 rem_min
So the cheat disables the decreasing of the remaining minutes. (Overwrites it with 0x90=NOP.)
Note that the first occurence is activated by the minus cheat key, so it does not really need to be overwritten.

This reminds me...
I once had a PRINCE.EXE that didn't decrease the remaining minutes (plus all hurt potions behaved like open potions -- to make the potions level easy).
But it had no POPCHT.DAT.
Actually it was the first version of PoP I ever played. (On a 286 with Hercules display and pcspeaker sound. The good old days...)
Post Reply