Text Cracker v0.97b
By Cyan Helkaraxe
(c) 1999, All Rights Reserved.


The Text Cracker is an application designed to aid hacking of text-based or
other similar data within binary files.
Whereas other such applications simply search for a text string and replace it,
this amazing application will actually find and replace text strings that are
encoded.

Based around the ultra-reliable, low-noise D2 file manipulation engine, and
utilising the Debug-O-Matic II core by the same author, which has received
unqualified praise from professionals and home users alike, you can be
guaranteed world-beating performance!

This program is an MS-DOS application, and as such will deliver unmatchable
performance on the IBM-PC series of computers.
It is possible to run this program from an "MS-DOS prompt" under the notorious
Microsoft Windows shell, although you may experience difficulties. In this
case, shut down your computer into MS-DOS mode.



To use this application, you must specify options on the command line.
Go to the MS-DOS prompt, and type the following line, after changing
to the directory containing Text Cracker, and ensuring you have a copy of the
Sonic the Hedgehog 1 ROM in the directory, named SONIC1.BIN.

TEXTCRK SONIC1.BIN SONICHAK.BIN hill hell

The first piece of text is the name of the program. This tells DOS to run the
Text Cracker.

The next piece of text is the input file name. In this case, it is SONIC1.BIN.
Therefore, Text Cracker will work on this file -- don't worry, it won't make
any changes to that file, it only uses it for reading.

SONICHAK.BIN is also a filename, but instead of being a file on the disk, it
is the name of a file that will be created. If you specify the name of an
existing file, IT WILL BE OVERWRITTEN! Be careful with this. Also, this name
must be different from the input file name.

The last two pieces of text are the strings of text you are working with.
The first one, hill, tells Text Cracker what to search for in the ROM file.
The second one, hell, tells Text Cracker what to change that text to if it
finds it.
Instead of changing the input file, Text Cracker creates a new file containing
the modified version of the input file.
You cannot search for a string less than 2 characters.
If you change a 4 letter (say) string to an 8 letter string, then the 8 letter
string will be trimmed to 4 letters. Also, if the replace string is shorter
than the search string, the replace string will be packed out with spaces to
make it the same length. However, this only happens for relatively short
strings -- any longer strings may cause program crashes.

Therefore, by running the above command on the Sonic 1 ROM, you will find that
any occurrences of the text "hill" are changed to the text "hell". However, as
many have observed, the text "hill" never occurs in this ROM.
However, it does, but it is encoded, so instead of an H being an ASCII 68H, it
is actually an 18H.
This means that using a search function on a hex-editor, or similar would
result in the text never being found.
However, Text Cracker will find this encoded occurrence of "hill" without any
problem, and will also change it to an encoded version of "hell" too.
Therefore, by running the above command, and looking at the level select screen
on the Sonic 1 ROM, you'll find that Green Hill Zone becomes Green Hell Zone.
The same process can be used on the option screen text on Sonic 2, or in fact
just about any file you wish -- only your imagination is the limit!

The input and output files can contain a directory, so they could point to
a different place on the hard drive. Example:
TEXTCRK h:\emulat~1\megadr~1\romima~1\sonic1.bin h:\hacked.bin hill hell

The program can take a long time to process larger files, so please be
patient; there is currently no BREAK feature.

The current finds are listed on the screen in a table like this:

ADDRESS  OFFSET
5        0
1024     -2
2048     72

The address is the address in the file of the LAST letter of the
search. This is in decimal. Say I had a file containing:
asdasdasdSonicasdadsasd
Then if I searched for "Sonic" then the address would be 13.
This is because the last letter of Sonic is the 13th letter
into the file.
The file starts at byte 0, and counts up from there.
If I had:
Sonicasdasdasd
And did the same search, then the address would be 5.

The offset is how the text is encoded. If I had:
Sonicasdasd
In a file, and searched for "Sonic", then the address would be 5, and the
offset would be 0. However, if I had:
Tpojdasdasd
Which is "Sonic" with each letter increased by 1, the address would be 5
and the offset would be 1, indicating that the string's letters are higher
than the search string by 1.

CASE IS IMPORTANT!!! If you search for "SONIC", then the program will find:
sonic
SONIC
TPOJD
tpojd
rnmhb

in the file, but it will NOT find:
Sonic
sONIC
Tpojd

because of the caps.
Therefore, if you are searching for something in a file, then first try
all lower case, then try a capital letter at the start.

When hacking ROMs, you may find you need to use the "FIX CHECKSUM" feature
of the emulator in order to run the ROM properly.



This program is Copyright (c) 1999 Cyan Helkaraxe,
All Rights Reserved.
You may freely distribute this application, as long as
no changes are made, including nothing added or removed
from the file package, and as long as it remains free
of charge.
You may NOT claim this program as your own, or create
derivative works from it.


E-Mail me at:
manic@emulationzone.org      -- usual address
-or-
cyanh@hotmail.com            -- emergency address


VISIT _-=THE UNDERGROUND ZONE=-_ AT:
http://www.the-underground-zone.freeserve.co.uk
-or-
http://www.emulationzone.org/projects/cyan
