Creating a key generator for Tiles and Tribulations v1.53


Version 1.1 Download [tutorial 1] and read it offline


Our target: "Tiles and Tribulations"

Tiles and Tribulations is a very addictive game developed for Technological Computer Innovations Corporation and updated by Barefoot Productions.
You have to catch falling, colourful tiles and place them strategically in bins to gain points and conquer levels.
Unfortunately the unregistered version has only 3 levels, but there is a way to get the other 47 levels. You only have to fill in a name and a registration code.
[Tiles and Tribulations v1.53] [mirror].


Tools and help

I used SoftICE to find both. Numega SoftICE v3.24 is available by following one of these great links:

Once you have installed SoftICE, you have to edit the winice.dat file.
Change the line:

INIT="X;"

into:

INIT="lines 60;wl;wd 22;wc 22;wr;code on;x;"

and remove the semicolon in front of the following lines:

;EXP=c:\windows\system\kernel32.dll
;EXP=c:\windows\system\user32.dll
;EXP=c:\windows\system\gdi32.dll

I also used some tutorials to get familiar with SoftICE because I didn't know anything about programming, cracking, etc....
The Sandman, Iczelion, HarvestR and Lord Caligo should offer you enough tutorials to give you a start.


Finding a name and a registration code

Start NuMega SoftICE Symbol Loader
File, Open Module..., Tiles95.exe
Module, Load (be aware that the "Stop at WinMain" button (the lamp) is disabled)
Press ctrl D and you'll be in SoftICE!
Now you are going to set a breakpoint, just type the following:

bpx DialogBoxParamA

Press ctrl D again to leave SoftICE and click on "Enter Code".
You are back in SoftICE and there is a message: Break due to BPX USER32!DialogBoxParamA. You are now at the place where the function DialogBoxParamA starts. It's the Win32 API function for creating a dialog box from a dialog box template resource.
Press F11 to jump to the place where the function DialogBoxParamA was called from. You are back in Tiles! Click on "Cancel" and you'll be back in SoftICE at the right place.
Press ctrl-arrow-up until you see PUSH 00413F84 and that looks very interesting! Now type the following:

d 413F84

Bingo! In the data window, you'll see 64 registration codes.
Disable the breakpoint by typing:

bc *

Press ctrl D to leave SoftICE for the last time, fill in any name in the registration form and try the registration codes until you find the right one for the chosen name.


Note

Perhaps there are more elegant ways to find the right name and registration code, but I only wanted to demonstrate that you don't have to be a full-time programmer or cracker to find some interesting things inside a program. Other protection schemes are more difficult than the one cracked above!
If you are still having trouble to find the right registration code then read the next part of this document.


Creating a password generator

When you take the first registration code (PBG0213) out of the list of 64 codes, you'll soon discover that this code corresponds with one single character, namely ASCII character I (decimal value 73). The next registration code (AMC5673) corresponds with ASCII character H (decimal value 72) and so on until you reach registration code EA1742K corresponding with ASCII character space (decimal value 32). The next registration code on the list of 64 (SG0622H) neither corresponds with decimal value 31 nor with ASCII character ÿ (decimal value 255), but with ASCII character _ (decimal value 95). The next one (BM0621H) will work with ASCII character ^ (decimal value 94) and so on until you reach the last registration code (U874J93), corresponding with ASCII character J (decimal value 74).

In one sentence: each registration code corresponds with one single character.
Very nice, but most of your names will have more than one single character! So you have to find out how Tiles and Tribulations handles names with more than one character.
After a few hours I solved the mystery.

Write down the decimal value of each character of your name and make the sum (S) of those values.

Use the following formulas now:

2 character name: S + 8 + (0 * 9)
3 character name: S + 8 + (1 * 9)
4 character name: S + 8 + (2 * 9) + 1
5 character name: S + 8 + (3 * 9) + 1 + 2
6 character name: S + 8 + (4 * 9) + 1 + 2 + 3
7 character name: S + 8 + (5 * 9) + 1 + 2 + 3 + 4
8 character name: S + 8 + (6 * 9) + 1 + 2 + 3 + 4 + 5

and so on...

Probably, you'll obtain a value much higher than 95.
In that case do the following: subtract 64 from the value until you obtain a value >= 32 and <= 95.
This decimal value corresponds with a registration code and that's the code for your name!

Let's take CRACK as registration name.

decimal value of C = 67
decimal value of R = 82
decimal value of A = 65
decimal value of C = 67
decimal value of K = 75

The sum of those values equals 356.

356 + 8 + (3 * 9) + 1 + 2 = 394

394 - 64 - 64 - 64 - 64 - 64 = 74

Decimal value 74 (ASCII character J) corresponds with registration code U874J93.

Now you can write a little program. I wrote and compiled my key generator with [Microsoft QuickBASIC v4.5].
Here it is:


10 A = 0
20 B = 0
30 GOSUB 350

40 PRINT "  This program gives you a key for any name."
50 PRINT
60 LINE INPUT "  What's your name? "; N$

70 M$ = UCASE$(N$)
80 FOR I = 1 TO LEN(M$)
90      C$ = MID$(M$, I, 1)
100     A = A + ASC(C$)
110 NEXT I

120 IF LEN(M$) = 0 THEN GOTO 10
130 IF LEN(M$) = 1 THEN GOTO 270
140 IF LEN(M$) > 28 THEN GOSUB 350 ELSE 200
150 PRINT "  Don't use more than 28 characters!"
160 PRINT "  Press any key to try again!"
170 DO UNTIL INKEY$ <> ""
180 LOOP
190 GOTO 10

200 FOR I = 1 TO (LEN(M$) - 2)
210     B = B + I - 1
220 NEXT I
230 A = A + 8 + (LEN(M$) - 2) * 9 + B
240 WHILE A > 95
250     A = A - 64
260 WEND

270 GOSUB 350
280 FOR I = 1 TO (A - 31)
290     READ D$
300 NEXT I
310 PRINT "  Your name is:              "; M$
320 PRINT "  Your registration code is: "; D$
330 PRINT
340 END

350 CLS
360 PRINT "                      / ,"
370 PRINT "                 /\  \|/  /\"
380 PRINT "                 |\\_;=._//|"
390 PRINT "                  \."   "./"
400 PRINT "                  //^\ /^\\"
410 PRINT "           .'``",/ |0| |0| \,"``'."
420 PRINT "          /   ,  `'\.---./'`  ,   \"
430 PRINT "         /`  /`\,."(     )".,/`\  `\"
440 PRINT "         /`     ( '.'-.-'.' )     `\"
450 PRINT "         /"`     "._  :  _."     `"\"
460 PRINT "          `/.'`"=.,_``=``_,.="`'.\`"
470 PRINT "         .-"-.      )   (      .-"-."
480 PRINT "+-------{'. '`}-----~   ~-----{'. '`}-------+"
490 PRINT "|       `"---"`               `"---"`       |"
500 PRINT "| Key generator for Tiles and Tribulations  |"
510 PRINT "| v1.53 and previous versions.              |"
520 PRINT "| http://www.barefootinc.com                |"
530 PRINT "|                                By Snowcat |"
540 PRINT "+-------------------------------------------+"
550 PRINT
560 RETURN

570 DATA EA1742K,AL0418G,JM1149F,PT8749B,MS0853D,CS1177J,SC8927W,KP6697A
580 DATA KK4855G,JAG5524,DJM0416,CCH0522,KJR0430,JRB0421,DAC0065,MAB0605
590 DATA ECW0608,DOB0712,CLB0623,CDK0228,CRK0601,CXK0507,LLB6034,UPR4255
600 DATA NN1640E,WM1215W,BM0215M,FSL8930,PAS4258,KFD1269,JJJ0816,JMC3452
610 DATA SLH4228,TDB1883,MSC1990,GME4445,JEJ5512,KAO6294,EEH0611,BJW0226
620 DATA AMC5673,PBG0213,U874J93,VXJ4253,KA453Z4,DW8432X,BK3682M,DD2175R
630 DATA WA6638Y,KV2261E,LK3829A,DS7934P,NS4398K,BL3385W,JR5584S,DC1877G
640 DATA BM2418U,BJ4819B,LT2988V,JS9934T,SH5313L,EH0411A,BM0621H,SG0622H

Download the [source code]
Download the [crack]


Conclusion

It's nice to learn more about protection schemes. It's nice if you can crack those protection schemes, but for the author of the program it's nice that he gets what he deserves.
So, if you keep using cracked programs, please register and you'll have a good conscience!!!
There are some other nice programs available at the Barefoot Productions shop and you'll soon discover that most of them use the same 64 registration codes!!! Nice prospects!!!

SNOWCAT Back to the main page Tutorial created by Snowcat
Tutorial created: 1st November 1998
Version 1.1, last updated: 25th December 1998