CKPatch is an extremely useful tool that is an alternative to hex editing. If you’re making a mod of Keens 2 or 3 and want to hex edit, you’ll have to use CKPatch instead because it isn’t legal to release the executables of those games, even if they are hex edited. The Patchotron is an easy way to make patch files for CKPatch.
Now on to patching. When a Keen game loads it loads the executable into memory (using some DOS API function) before it executes the program. When setting a patch file, the program will load this after it writes the executable to memory and write over what you specified. You don’t have to worry about accidentally ruining an exe file or something like that.
Place the CKPatch exe that corresponds to the Keen you’re editing in the folder of the game.
Before you make any patches you have to take a dump (no, don’t go to the bathroom). Here’s the process:
1. Open up notepad and paste in the following (this assumes you’re using Keen 1):
%ext ck1
%dump dump.txt
%end
2. You’ll learn what all this means later. For now, just save this file as patch.pat.
3. Now paste this text into a new notepad file:
ck1patch patch.pat
4. Save this file as Keen1.bat.
5. Now run Keen1.bat. It should load the game. Just quit, you don’t need to do anything. There should now be a file called dump.txt in your game folder. This contains what is written to memory when the game loads.
When you need the address for a patch, find it in this file, not in the Keen executable.
The bat file you made will be what you always use to run the game from now on. Now it’s time to create a patch file.
Remember that patch.pat file you made to dump? This is your patch that you’re going to use. Here’s a brief explanation of how the patch file works. A pound (#) symbol starts a comment that CKPatch will skip over. I suggest you add comments to describe what different parts of your patch file do, so you don’t forget when you come back to it later.
A percent (%) symbol starts a macro command, which is what is used to patch the game. Here’s a brief rundown on the different commands:
Command
Example
Use
%ext (game)
%ext ck1
It isn’t necessary because there are individual CKPatch executables, but in future releases of CKPatch, it may be combined into one exe. It is recommended you use this anyway for future compatibility. This patch would go at the beginning of a patch file.
%end
%end
Stops the reading and starts the game. Goes at the end of the patch file (duh…).
%patch (offset) (string)
%patch 0x0AAAAA “This is a test”
This is the most common command is this one, which allows you to write over any text in the entire game change filenames, etc… There are multiple ways of doing it, but I’ll tell you the one I find simplest. Open up your dump.txt file in a hex editor. Find the place where you want to write over some text. Get the hex address of that byte (if you don’t know how look in the help file of your hex editor). Now type in the macro %patch 0x0yourhexaddress “Your patch text”
It’s very important you put your patch text in quotes. That’s all you need to do.
%patchfile (offset) (string)
%patch 0x0AAAAA file.ext
Works the same way the %patch command except you’re loading a file into the memory instead of text.
%abort
%abort
Stops the reading and closes the program.
%version (version #)
%version 1.1
%version all
Only patches for the specified version. Used if the offset differs for different versions to make the patching more compatible. To go back to all versions use all after the %version command instead of a number.
%level.hint # (string)
%level.hint 5 “This is a test”
Used for Keens 1 (the yorp/garg statues) and 4 (Princess Lindsey hints). This could be done with the patch command but this command is a shortcut. The # represents the level number. See the level table near the bottom for specifications on what level numbers can be used and the number of allowed characters.
%level.DIR (dir)
%level.DIR levels
Used for Keens 1-3, changes the directory the levels are looked for in.
%level.name # (newname)
%level.entry # (newentry)
%level.name 5 “The Blue Place”
%level.entry 5 “Keen turns blue”
Level.name changes the name of a level in Keens 4-6. Level.entry changes the text it displays when you enter a level in Keens 4-6. The # represents the level number. See the level table near the bottom for specifications on what level numbers can be used and the number of allowed characters.
Allows you to load the respective resource into the game executable at start for Keens 4-6. It looks for the files relative to your patch file.
The following info is unnecessary if you are using the Patchotron.
Keen 1 hints and char limits
Level(s)
Char Limit
2, 6, 9, 10, 12
7 lines of 20 chars
11
4 lines of 20 chars
15
6 lines of 20 chars
Keen 4 hints and char limits (You may need to put carriage returns periodically)
Level(s)
Char Limit
5
73
7
76
Level Names (You may need to put carriage returns periodically)
Level(s) – Keen 4
Char Limit
0-2, 5-10, 15-17
15
3, 4, 11, 12, 14, 18
31
13
47
Level(s) – Keen 5
Char Limit
0, 2, 13-15
15
1, 3-12
31
Level(s) – Keen 6
Char Limit
0, 2, 5, 7, 9-11, 16, 18
15
1, 3, 4, 6, 8, 12-15, 17
31
Level Entry Texts (You may need to put carriage returns periodically)
Level(s) – Keen 4
Char Limit
0, 2, 7, 9
31
1, 3, 5, 6, 8, 10-12, 15-17
47
4, 13, 14, 18
63
Level(s) – Keen 5
Char Limit
0-10, 12-14
47
11, 15
63
Level(s) – Keen 6
Char Limit
0, 7
31
1-6, 8-10, 12, 16-18
47
13-15
63
11
79
The Patchotron
The Patchotron makes patch files read by CKPatch in an easy, user-friendly way, without the tedious work of finding offsets and such in a hex editor. This is Version 1.4..
Open up the Patchotron and select the Keen Game you want to start patching. You'll come to a screen with an array of buttons:
Here’s a brief rundown on the different buttons for Keens 1-3:
Button
Use
Menu
Allows you to change the text in the menu of a game (image).
Status Screen
Allows you to change the text in the status screen of a game.
About ID
Allows you to change the text in the About ID.. screen of a game.
OrderInfo
Allows you to change the text in the Ordering Info screen of a game.
Finale
Allows you to change the messages at the finale (end) of a game.
Mortimer Conversation
Allows you to change the messages at the beginning of level 16 in Keen 3.
Hints
Allows you to change the messages from the Yorp/Garg statues in Keen 1 and the frozen Vorticon Elders in Keen 2.
Files
Allows you to change the names of all the files for the game, including the extention.
High Score Entries
Allows you to change the default high score entries.
Cheats
Allows you to change both the cheat codes themselves (image) and the messages displayed when you activate/deactivate a cheat.
BWB Messages
Allows you to change any of the four messages displayed when you try to go into your BWB in Keen 3.
Here’s a brief rundown on the different buttons for Keens 4-6:
Button
Use
Level Names
Allows you to change the names of the levels in the game.
Level Entry Texts
Allows you to change the text displayed when you enter a level.
Hints
Allows you to change the messages from Princess Lindsay in Keen 4.
Files
Allows you to change the names of all the files for the game, including the extention.
Here’s a brief rundown on the different buttons that apply for all patching:
Button
Use
Custom Patch
If you know an offset yourself, this lets you have some text patched there.
Patchfile
If you know an offset yourself, this lets you have a file patched there.
Version
Adds a header to define version-specific patches.
Abort/Stop
Adds the respective command.
Dump
Adds a command that lets you choose a file to dump the memory into.
Other
Predefined patches that didn't fit into other categories.