home *** CD-ROM | disk | FTP | other *** search
/ Cracking 101 / C101-90.002 < prev    next >
Encoding:
Text File  |  1990-01-01  |  30.9 KB  |  643 lines

  1.  
  2.                           CRACKING 101 - 1990 edition
  3.  
  4.                                     Lesson 2
  5.  
  6.                               ┌──────────────────┐
  7.                               │ DOC CHECK PRIMER │
  8.                               └──────────────────┘
  9.  
  10.                                by Buckaroo Banzai
  11.  
  12.  
  13.               Ok, in   this  textfile,  I  will  start  talking  about
  14.          removing doc check protection schemes.  I find, the doc check
  15.          scheme to be slightly more difficult  to  work on than normal
  16.          INT 13 schemes.
  17.  
  18.               What is  a  doc  check.   Usually, a doc  check  when  a
  19.          program ask the  user to enter a phrase or code supplied with
  20.          the manual.  Now, one might think  that  "Shit,  we  can just
  21.          type all the codes in to a textfile and upload  it  with  the
  22.          DOCS", but that  way of thinking breaks down on programs such
  23.          as Future Classics where there  are  6  pages  with about 200
  24.          codes per page.   So  it is just better to remove  the  check
  25.          completely.
  26.  
  27.               In this  primer, I will get in to the theory of removing
  28.          a doc check, then start with  a  simple  example  (Electronic
  29.          Art's ESCAPE FROM HELL).  Then in the next file,  I will take
  30.          you deeper in  to  the world of doc checks and work with more
  31.          difficult examples.  But for now, lets get started.
  32.  
  33.               A doc check, in basic theory works much like normal
  34.          INT 13 copy protection.  Somewhere  in  the  beginning of the
  35.          program before it really starts, the check is  made.   If the
  36.          result is ok  (ie the user enters the correct word or phrase)
  37.          then the program continues.  If  not, then the program simply
  38.          exits to dos.
  39.  
  40.               Simple right,  well  not  really.   Usually,  the  input
  41.          routine is part  of the standard input routine of the program
  42.          so you just can't go about modify  the  call  to INT 16h (the
  43.          keyboard interrupt) like you could with INT 13h.   So,  where
  44.          do we start.   If  you  think back to cracking the old INT 13
  45.          protection schemes, you would  use  a program like PCWATCH or
  46.          TRAP13 to get a rough idea of where the call  resides.   With
  47.          doc checks, this is really not the best way to do it.
  48.  
  49.               I suggest  that  you try to break in to the program well
  50.          before the protection is checked.   Remember,  we must remove
  51.          the check without messing with the actual input routine so we
  52.          want to come in highest level.
  53.  
  54.               So, how  do we break in.  By using a good  debugger.   I
  55.          suggest Periscope.  I find it is the best and easiest to use.
  56.          Once we are  in,  all  the  is  left  is to trace through the
  57.          program until we find the topmost call to the doc check.  Now
  58.          we're moving.
  59.  
  60.               So let's say we have broken  in to the program and found
  61.          the topmost call to the doc check.  What next.   We  must try
  62.          to figure out   what   the   program   does.    There  are  2
  63.          possibilities.  First, the program  could  simply  check  the
  64.          inputed string against a value in memory, and  if  they don't
  65.          match simply exit  to  dos and if they do, just continue with
  66.          the program; or if the input  matches  it  can  set a flag in
  67.          memory that is checked by some routine later.
  68.  
  69.               So, on  to  the  example.   NOTE! All address  might  be
  70.          different.  This is  how  it  looked when I cracked it.  ALSO
  71.          NOTE, you should  be cracking  without  any  memory  resident
  72.          programs.  Make sure MEMORY is clear, and that  you  load the
  73.          system the same   way  each  time.   Remember,  if  you  load
  74.          everything the same, everything  will  be  in the same memory
  75.          location.
  76.  
  77.               So, what is our first step.  Well, I suggest picking out
  78.          the right tools to do the job.  In this case,  You  will only
  79.          need PERISCOPE (and  the  addin  program  that  comes with it
  80.          called PSKEY) and a good file editor  (when I say good I mean
  81.          it can edit and search in hex).  So let's get started.
  82.  
  83.               First, we  load  PERISCOPE (PS from now  on).   This  is
  84.          gonna be the  debugger  we use.  Next, we need a quick way in
  85.          to the debugger.  Since ESCAPE FROM HELL (EFH from now on) is
  86.          not all the picky about how it  keeps  a  crackest out, PSKEY
  87.          will do just fine but not without using a little trick.
  88.  
  89.               Normally, when using PSKEY (for those of  you who do not
  90.          know what PSKEY does, it allows up to break in to PS usings a
  91.          TSR hotkey) and  you  hit  the  hotkey,  PSKEY does an INT 2h
  92.          (NMI).  This then brings up PS  and  you  are  set.  But, EFH
  93.          revectors INT 2h (NMI) to simply an IRET so this  method does
  94.          not work.  How  do  we  get  around this, well, INT 2h is the
  95.          default used with PSKEY but not the only way to work it.  You
  96.          can also use  INT  3h  (Breakpoint   interrupt)  or  INT  15h
  97.          (Extended services interrrupt) to activate PS.   In this case
  98.          we will use  INT  3h;  so  when  we  invoke  PSKEY we add the
  99.          command line parameter "3" (ie:  "PSKEY  3CAL"  invokes PSKEY
  100.          using INT 3h setting the hotkey to CTRL-ALT-LEFT_SHIFT).
  101.  
  102.               So, now that we have a way in to EFH, where  do  we want
  103.          to break out.   Well  boys  (and Girls, and BTW: if there are
  104.          any Fems reading this, give me  a ring, I'd like to hear from
  105.          ya) I don't have any formula to give, but remember, I suggest
  106.          that we try  to  break  in  to  the  outermost   loop.    So,
  107.          experiance (and a  good  fucking guess) tells me to break out
  108.          in the title screen before the music begins.
  109.  
  110.               It just so happens that this time I was right (And noone
  111.          had to get nail to anything -D.A.)   Right  after  the  title
  112.          picture comes up, press your hotkey (oooh).  The PS debugging
  113.          screen should come up and you should see the  follow  section
  114.          of code..
  115.  
  116.          2309:019C CF            IRET
  117.          2309:019D 3D0085        CMP AX,8500
  118.          etc.
  119.  
  120.               This is  the exit code from PSKEY.  By usings the J(ump)
  121.          command, and executing the IRET,  you  will be put back right
  122.          to the spot  where  you pressed the hotkey (boy  I'm  getting
  123.          excited).  I would love to give you a code fragment here, but
  124.          each time you press the hotkey you will end up at a different
  125.          point.
  126.  
  127.               So what  do we do next.  Well, we will just have to keep
  128.          executing code until we find some  reference point.  Remember
  129.          how I said we wanted to break out before we reached  to music
  130.          at the title  screen.   Well,  you can bet that we are in the
  131.          outermost loop since the music comes before the doc check and
  132.          we haven't reached the call to  the music routine yet.  So we
  133.          start executing code.
  134.  
  135.               Then all  of  the  sudden  BOOM!  you  execute   a  CALL
  136.          instruction and music  bursts  through  the  speaker.  AHa, a
  137.          reference point.  We know we are on the right track.
  138.  
  139.               Press <ESC> during the music  so  that  we  can skip the
  140.          stupid intro for now.  After pressing <ESC> you should regain
  141.          control at the  instruction  after  the  call  to  the  music
  142.          routine.
  143.  
  144.               From here  on  out,  we  want  to procede rather slowly.
  145.          Each time you reach a CALL instruction you want to write down
  146.          the address where it is located.   Sooner  or  later you will
  147.          execute a CALL instruction and EFH will jump  in  to it's doc
  148.          check routine.  But  damn,  you  have the address of the that
  149.          call WRITTEN DOWN  right.   So   simply   reboot  and  reload
  150.          everything.
  151.  
  152.               Break out   in  to  PS  at  the  title  picture.    Now,
  153.          unassemble the address   you  wrote  down.   You  should  see
  154.          something like this
  155.  
  156.          21DD:3EA4 9AA5368132     CALL 3281:36A5  (current line)
  157.          21DD:3EA4 9A522F8132     CALL 3281:2F52
  158.          21DD:3EA4 C706BB070000   MOV WORD PTR [07BB],0000
  159.          21DD:3EA4 8BE5           MOV SP,BP
  160.          21DD:3EA4 5D             POP BP
  161.          21DD:3EA4 CB             RETF
  162.  
  163.               The first call, is the call  to the doc check, therefore
  164.          it can for  now  be assumed that the second call  is  to  the
  165.          actual game (remember,    most    programmers   follow   good
  166.          programming practice and will exit  the routine that does the
  167.          doc check to  finish the game).  Please NOTE,  from  here  on
  168.          out, if I  say  go back to STEP 1, reboot the machine, reload
  169.          and get to this point.  Ok.
  170.  
  171.               Our first though in seeing  code like this is shit maybe
  172.          they just check the keyword and exit to dos if  it's bad;  if
  173.          it it's good,  then  they just exit that subroutine and start
  174.          the game.  So having lots of time  on  our hands, we try just
  175.          executing the second CALL and bypass the first  (you  can  do
  176.          that by setting  the IP (instruction pointer) register to the
  177.          offset of the second call [In  our  case 3EA9]).  When you do
  178.          this, the screen clears, and you see the character  (Richard)
  179.          on the screen.   But just as you think it worked, it switches
  180.          back to text mode and prints the message "Hell is HOT".  Shit
  181.          I hate it when that happens.
  182.  
  183.               So now we know that somewhere  in the doc check routine,
  184.          EFH sets a  flag in memory.  We must figure  out  where  this
  185.          flag is and  figure out a way to fake it.  So go back to step
  186.          1, this time, let's trace (using the T command) in to the doc
  187.          check routine.
  188.  
  189.               I have included the entire  outerloop  of  the doc check
  190.          routine here.  The   small  subroutines  are   not   of   any
  191.          importants and infact  when I first crack EFH, I never traced
  192.          in to any of them.  It wasn't  until  I  was out getting this
  193.          information that I took a look to see what they did.
  194.  
  195.               Here is  the  dos check code.  I have place  some  basic
  196.          instructions that should  help you as you go along.  Although
  197.          you address might be different than mine, I will use mine for
  198.          reference.  Also, I have noted some special subroutines along
  199.          the way.
  200.  
  201.          ( - Unassembled DOC CHECK for ESCAPE FROM HELL [outer loop] )
  202.  
  203.               First, we start off with  some  initialization routines.
  204.          You don't need to be all to concerned with them.
  205.  
  206.          3281:36A5 55            PUSH BP
  207.          3281:36A6 8BEC          MOV BP,SP
  208.          3281:36A8 83EC2A        SUB SP,+2A
  209.          3281:36AB C746DE0000    MOV WORD PTR [BP-22],0000
  210.          3281:36B0 B80600        MOV AX,0006
  211.          3281:36B3 50            PUSH AX
  212.          3281:36B4 9AE3169900    CALL 0099:16E3
  213.          3281:36B9 59            POP CX
  214.          3281:36BA 48            DEC AX
  215.          3281:36BB 8946DA        MOV [BP-26],AX
  216.          3281:36BE B80F00        MOV AX,000F
  217.          3281:36C1 50            PUSH AX
  218.          3281:36C2 9AE3169900    CALL 0099:16E3
  219.          3281:36C7 59            POP CX
  220.          3281:36C8 48            DEC AX
  221.          3281:36C9 8946DC        MOV [BP-24],AX
  222.          3281:36CC C706CB070E00  MOV WORD PTR [07CB],000E
  223.          3281:36D2 C746D60000    MOV WORD PTR [BP-2A],0000
  224.          3281:36D7 E9C002        JMP 399A
  225.          3281:36DA C746D80000    MOV WORD PTR [BP-28],0000
  226.          3281:36DF E92501        JMP 3807
  227.          3281:36E2 9A9B479900    CALL 0099:479B
  228.          3281:36E7 B83866        MOV AX,6638
  229.          3281:36EA 50            PUSH AX
  230.          3281:36EB A03407        MOV AL,[0734]
  231.          3281:36EE B400          MOV AH,00
  232.          3281:36F0 50            PUSH AX
  233.          3281:36F1 B80C00        MOV AX,000C
  234.          3281:36F4 50            PUSH AX
  235.          3281:36F5 B8CF00        MOV AX,00CF
  236.          3281:36F8 50            PUSH AX
  237.          3281:36F9 8B46DC        MOV AX,[BP-24]
  238.          3281:36FC BA5800        MOV DX,0058
  239.          3281:36FF F7E2          MUL DX
  240.          3281:3701 8BD8          MOV BX,AX
  241.          3281:3703 8A87F640      MOV AL,[BX+40F6]
  242.          3281:3707 B400          MOV AH,00
  243.          3281:3709 8BD8          MOV BX,AX
  244.          3281:370B 81C39400      ADD BX,0094
  245.          3281:370F D1E3          SHL BX,1
  246.          3281:3711 D1E3          SHL BX,1
  247.          3281:3713 FFB7F25D      PUSH [BX+5DF2]
  248.          3281:3717 FFB7F05D      PUSH [BX+5DF0]
  249.          3281:371B 9AE7019900    CALL 0099:01E7
  250.          3281:3720 83C40C        ADD SP,+0C
  251.          3281:3723 8B46DA        MOV AX,[BP-26]
  252.          3281:3726 3D0500        CMP AX,0005
  253.          3281:3729 7603          JBE 372E
  254.          3281:372B E9B200        JMP 37E0
  255.          3281:372E 8BD8          MOV BX,AX
  256.          3281:3730 D1E3          SHL BX,1
  257.          3281:3732 2E            CS:
  258.          3281:3733 FFA73737      JMP [BX+3737]
  259.          3281:3737 43            INC BX
  260.          3281:3738 37            AAA
  261.          3281:3739 5E            POP SI
  262.          3281:373A 37            AAA
  263.          3281:373B 7837          JS 3774
  264.          3281:373D 92            XCHG DX,AX
  265.          3281:373E 37            AAA
  266.          3281:373F AC            LODSB
  267.          3281:3740 37            AAA
  268.          3281:3741 C637B8        MOV BYTE PTR [BX],B8
  269.          3281:3744 2000          AND [BX+SI],AL
  270.          3281:3746 50            PUSH AX
  271.          3281:3747 B82E01        MOV AX,012E
  272.          3281:374A 50            PUSH AX
  273.          3281:374B B88100        MOV AX,0081
  274.          3281:374E 50            PUSH AX
  275.          3281:374F B87348        MOV AX,4873
  276.          3281:3752 50            PUSH AX
  277.          3281:3753 9AD6029900    CALL 0099:02D6
  278.          3281:3758 83C408        ADD SP,+08
  279.          3281:375B E98200        JMP 37E0
  280.          3281:375E B82000        MOV AX,0020
  281.          3281:3761 50            PUSH AX
  282.          3281:3762 B82E01        MOV AX,012E
  283.          3281:3765 50            PUSH AX
  284.          3281:3766 B88100        MOV AX,0081
  285.          3281:3769 50            PUSH AX
  286.          3281:376A B88648        MOV AX,4886
  287.          3281:376D 50            PUSH AX
  288.          3281:376E 9AD6029900    CALL 0099:02D6
  289.          3281:3773 83C408        ADD SP,+08
  290.          3281:3776 EB68          JMP 37E0
  291.          3281:3778 B82000        MOV AX,0020
  292.          3281:377B 50            PUSH AX
  293.          3281:377C B82E01        MOV AX,012E
  294.          3281:377F 50            PUSH AX
  295.          3281:3780 B88100        MOV AX,0081
  296.          3281:3783 50            PUSH AX
  297.          3281:3784 B8AD48        MOV AX,48AD
  298.          3281:3787 50            PUSH AX
  299.          3281:3788 9AD6029900    CALL 0099:02D6
  300.          3281:378D 83C408        ADD SP,+08
  301.          3281:3790 EB4E          JMP 37E0
  302.          3281:3792 B82000        MOV AX,0020
  303.          3281:3795 50            PUSH AX
  304.          3281:3796 B82E01        MOV AX,012E
  305.          3281:3799 50            PUSH AX
  306.          3281:379A B88100        MOV AX,0081
  307.          3281:379D 50            PUSH AX
  308.          3281:379E B8C748        MOV AX,48C7
  309.          3281:37A1 50            PUSH AX
  310.          3281:37A2 9AD6029900    CALL 0099:02D6
  311.          3281:37A7 83C408        ADD SP,+08
  312.          3281:37AA EB34          JMP 37E0
  313.          3281:37AC B82000        MOV AX,0020
  314.          3281:37AF 50            PUSH AX
  315.          3281:37B0 B82E01        MOV AX,012E
  316.          3281:37B3 50            PUSH AX
  317.          3281:37B4 B88100        MOV AX,0081
  318.          3281:37B7 50            PUSH AX
  319.          3281:37B8 B8E848        MOV AX,48E8
  320.          3281:37BB 50            PUSH AX
  321.          3281:37BC 9AD6029900    CALL 0099:02D6
  322.          3281:37C1 83C408        ADD SP,+08
  323.          3281:37C4 EB1A          JMP 37E0
  324.          3281:37C6 B82000        MOV AX,0020
  325.          3281:37C9 50            PUSH AX
  326.          3281:37CA B82E01        MOV AX,012E
  327.          3281:37CD 50            PUSH AX
  328.          3281:37CE B88100        MOV AX,0081
  329.          3281:37D1 50            PUSH AX
  330.          3281:37D2 B80F49        MOV AX,490F
  331.          3281:37D5 50            PUSH AX
  332.          3281:37D6 9AD6029900    CALL 0099:02D6
  333.          3281:37DB 83C408        ADD SP,+08
  334.          3281:37DE EB00          JMP 37E0
  335.          3281:37E0 B82D00        MOV AX,002D
  336.          3281:37E3 50            PUSH AX
  337.          3281:37E4 B88200        MOV AX,0082
  338.          3281:37E7 50            PUSH AX
  339.          3281:37E8 9A96029900    CALL 0099:0296
  340.          3281:37ED 59            POP CX
  341.          3281:37EE 59            POP CX
  342.          3281:37EF B82849        MOV AX,4928
  343.          3281:37F2 50            PUSH AX
  344.          3281:37F3 9A3F039900    CALL 0099:033F
  345.          3281:37F8 59            POP CX
  346.          3281:37F9 837ED800      CMP WORD PTR [BP-28],+00
  347.          3281:37FD 7505          JNZ 3804
  348.  
  349.               Here is the first point of interest.  The call on the
  350.          following line will display the "what is xxxx" message. ─┐
  351.                                                                   │
  352.          3281:37FF 9A1B019900    CALL 0099:011B <─────────────────┘
  353.  
  354.          3281:3804 FF46D8        INC WORD PTR [BP-28]
  355.          3281:3807 837ED802      CMP WORD PTR [BP-28],+02
  356.          3281:380B 7D03          JGE 3810
  357.          3281:380D E9D2FE        JMP 36E2
  358.          3281:3810 8B46DA        MOV AX,[BP-26]
  359.          3281:3813 3D0500        CMP AX,0005
  360.          3281:3816 7603          JBE 381B
  361.          3281:3818 E97401        JMP 398F
  362.          3281:381B 8BD8          MOV BX,AX
  363.          3281:381D D1E3          SHL BX,1
  364.          3281:381F 2E            CS:
  365.          3281:3820 FFA72438      JMP [BX+3824]
  366.          3281:3824 3038          XOR [BX+SI],BH
  367.          3281:3826 6E            DB 6E
  368.          3281:3827 38AC38EA      CMP [SI+EA38],CH
  369.          3281:382B 3827          CMP [BX],AH
  370.          3281:382D 396439        CMP [SI+39],SP
  371.          3281:3830 B81000        MOV AX,0010
  372.          3281:3833 50            PUSH AX
  373.          3281:3834 16            PUSH SS
  374.          3281:3835 8D46E2        LEA AX,[BP-1E]
  375.          3281:3838 50            PUSH AX
  376.          3281:3839 9AFB149900    CALL 0099:14FB
  377.          3281:383E 83C406        ADD SP,+06
  378.          3281:3841 8D46E2        LEA AX,[BP-1E]
  379.          3281:3844 50            PUSH AX
  380.          3281:3845 9A0F00B81B    CALL 1BB8:000F
  381.          3281:384A 59            POP CX
  382.          3281:384B 8B46DC        MOV AX,[BP-24]
  383.          3281:384E BA5800        MOV DX,0058
  384.          3281:3851 F7E2          MUL DX
  385.          3281:3853 05F740        ADD AX,40F7
  386.          3281:3856 50            PUSH AX
  387.          3281:3857 8D46E2        LEA AX,[BP-1E]
  388.          3281:385A 50            PUSH AX
  389.          3281:385B 9A0E00661A    CALL 1A66:000E
  390.          3281:3860 59            POP CX
  391.          3281:3861 59            POP CX
  392.          3281:3862 0BC0          OR AX,AX
  393.          3281:3864 7505          JNZ 386B
  394.          3281:3866 C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  395.          3281:386B E92101        JMP 398F
  396.          3281:386E B81000        MOV AX,0010
  397.          3281:3871 50            PUSH AX
  398.          3281:3872 16            PUSH SS
  399.          3281:3873 8D46E2        LEA AX,[BP-1E]
  400.          3281:3876 50            PUSH AX
  401.          3281:3877 9AFB149900    CALL 0099:14FB
  402.          3281:387C 83C406        ADD SP,+06
  403.          3281:387F 8D46E2        LEA AX,[BP-1E]
  404.          3281:3882 50            PUSH AX
  405.          3281:3883 9A0F00B81B    CALL 1BB8:000F
  406.          3281:3888 59            POP CX
  407.          3281:3889 8B46DC        MOV AX,[BP-24]
  408.          3281:388C BA5800        MOV DX,0058
  409.          3281:388F F7E2          MUL DX
  410.          3281:3891 050841        ADD AX,4108
  411.          3281:3894 50            PUSH AX
  412.          3281:3895 8D46E2        LEA AX,[BP-1E]
  413.          3281:3898 50            PUSH AX
  414.          3281:3899 9A0E00661A    CALL 1A66:000E
  415.          3281:389E 59            POP CX
  416.          3281:389F 59            POP CX
  417.          3281:38A0 0BC0          OR AX,AX
  418.          3281:38A2 7505          JNZ 38A9
  419.          3281:38A4 C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  420.          3281:38A9 E9E300        JMP 398F
  421.          3281:38AC B81000        MOV AX,0010
  422.          3281:38AF 50            PUSH AX
  423.          3281:38B0 16            PUSH SS
  424.          3281:38B1 8D46E2        LEA AX,[BP-1E]
  425.          3281:38B4 50            PUSH AX
  426.          3281:38B5 9AFB149900    CALL 0099:14FB
  427.          3281:38BA 83C406        ADD SP,+06
  428.          3281:38BD 8D46E2        LEA AX,[BP-1E]
  429.          3281:38C0 50            PUSH AX
  430.          3281:38C1 9A0F00B81B    CALL 1BB8:000F
  431.          3281:38C6 59            POP CX
  432.          3281:38C7 8B46DC        MOV AX,[BP-24]
  433.          3281:38CA BA5800        MOV DX,0058
  434.          3281:38CD F7E2          MUL DX
  435.          3281:38CF 051941        ADD AX,4119
  436.          3281:38D2 50            PUSH AX
  437.          3281:38D3 8D46E2        LEA AX,[BP-1E]
  438.          3281:38D6 50            PUSH AX
  439.          3281:38D7 9A0E00661A    CALL 1A66:000E
  440.          3281:38DC 59            POP CX
  441.          3281:38DD 59            POP CX
  442.          3281:38DE 0BC0          OR AX,AX
  443.          3281:38E0 7505          JNZ 38E7
  444.          3281:38E2 C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  445.          3281:38E7 E9A500        JMP 398F
  446.          3281:38EA B81000        MOV AX,0010
  447.          3281:38ED 50            PUSH AX
  448.          3281:38EE 16            PUSH SS
  449.          3281:38EF 8D46E2        LEA AX,[BP-1E]
  450.          3281:38F2 50            PUSH AX
  451.          3281:38F3 9AFB149900    CALL 0099:14FB
  452.          3281:38F8 83C406        ADD SP,+06
  453.          3281:38FB 8D46E2        LEA AX,[BP-1E]
  454.          3281:38FE 50            PUSH AX
  455.          3281:38FF 9A0F00B81B    CALL 1BB8:000F
  456.          3281:3904 59            POP CX
  457.          3281:3905 8B46DC        MOV AX,[BP-24]
  458.          3281:3908 BA5800        MOV DX,0058
  459.          3281:390B F7E2          MUL DX
  460.          3281:390D 052A41        ADD AX,412A
  461.          3281:3910 50            PUSH AX
  462.          3281:3911 8D46E2        LEA AX,[BP-1E]
  463.          3281:3914 50            PUSH AX
  464.          3281:3915 9A0E00661A    CALL 1A66:000E
  465.          3281:391A 59            POP CX
  466.          3281:391B 59            POP CX
  467.          3281:391C 0BC0          OR AX,AX
  468.          3281:391E 7505          JNZ 3925
  469.          3281:3920 C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  470.          3281:3925 EB68          JMP 398F
  471.          3281:3927 B81000        MOV AX,0010
  472.          3281:392A 50            PUSH AX
  473.          3281:392B 16            PUSH SS
  474.          3281:392C 8D46E2        LEA AX,[BP-1E]
  475.          3281:392F 50            PUSH AX
  476.  
  477.               Next point of interest.  When you execute this line, the
  478.          game will pause and wait for you to enter the code word from
  479.          the manual.  ────────────────────────────────┐
  480.                                                       │
  481.                                                       │
  482.          3281:3930 9AFB149900    CALL 0099:14FB <─────┘
  483.  
  484.          3281:3935 83C406        ADD SP,+06
  485.          3281:3938 8D46E2        LEA AX,[BP-1E]
  486.          3281:393B 50            PUSH AX
  487.          3281:393C 9A0F00B81B    CALL 1BB8:000F
  488.          3281:3941 59            POP CX
  489.          3281:3942 8B46DC        MOV AX,[BP-24]
  490.          3281:3945 BA5800        MOV DX,0058
  491.          3281:3948 F7E2          MUL DX
  492.          3281:394A 053B41        ADD AX,413B
  493.          3281:394D 50            PUSH AX
  494.          3281:394E 8D46E2        LEA AX,[BP-1E]
  495.          3281:3951 50            PUSH AX
  496.          3281:3952 9A0E00661A    CALL 1A66:000E
  497.          3281:3957 59            POP CX
  498.          3281:3958 59            POP CX
  499.          3281:3959 0BC0          OR AX,AX
  500.          3281:395B 7505          JNZ 3962
  501.          3281:395D C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  502.          3281:3962 EB2B          JMP 398F
  503.          3281:3964 33D2          XOR DX,DX
  504.          3281:3966 B8B80B        MOV AX,0BB8
  505.          3281:3969 52            PUSH DX
  506.          3281:396A 50            PUSH AX
  507.  
  508.               Next point of interest.  This call is the final
  509.          evaluation of the entered word (or phrase).  On return, it
  510.          checks a checksum value.  This whole next section of code
  511.          (up to 3281:39Ad) simply test the validity of the keyword you
  512.          entered. I have marked the all jumps that happened when I
  513.          entered my keyword with an " * ".
  514.  
  515.          3281:396B 9A71139900    CALL 0099:1371
  516.          3281:3970 59            POP CX
  517.          3281:3971 59            POP CX
  518.          3281:3972 8946E0        MOV [BP-20],AX
  519.          3281:3975 8B46DC        MOV AX,[BP-24]
  520.          3281:3978 BA5800        MOV DX,0058
  521.          3281:397B F7E2          MUL DX
  522.          3281:397D 8BD8          MOV BX,AX
  523.          3281:397F 8B874C41      MOV AX,[BX+414C]
  524.          3281:3983 3B46E0        CMP AX,[BP-20]
  525.          3281:3986 7505         *JNZ 398D
  526.          3281:3988 C746DEFFFF    MOV WORD PTR [BP-22],FFFF
  527.          3281:398D EB00          JMP 398F
  528.          3281:398F 837EDE00      CMP WORD PTR [BP-22],+00
  529.          3281:3993 7402         *JZ 3997
  530.          3281:3995 EB0C          JMP 39A3
  531.          3281:3997 FF46D6        INC WORD PTR [BP-2A]
  532.          3281:399A 837ED602      CMP WORD PTR [BP-2A],+02
  533.          3281:399E 7D03         *JGE 39A3
  534.          3281:39A0 E937FD        JMP 36DA
  535.          3281:39A3 837EDE00      CMP WORD PTR [BP-22],+00
  536.          3281:39A7 7504         *JNZ 39AD
  537.          3281:39A9 0E            PUSH CS
  538.          3281:39AA E8E8FC        CALL 3695
  539.  
  540.               This is the last point of interest.  The next
  541.          instruction is where we set the key (by moving FFFFh to the
  542.          memory location DS:0744h).  This is what we need to fake to
  543.          allow the system to run.  ───────────────────────────┐
  544.                                                               │
  545.          3281:39AD C7064407FFFF  MOV WORD PTR [0744],FFFF <───┘
  546.          3281:39B3 B8FFFF        MOV AX,FFFF
  547.          3281:39B6 50            PUSH AX
  548.          3281:39B7 9AC0479900    CALL 0099:47C0
  549.          3281:39BC 59            POP CX
  550.          3281:39BD 8BE5          MOV SP,BP
  551.          3281:39BF 5D            POP BP
  552.          3281:39C0 CB            RETF
  553.  
  554.               Ok, we have now finished the doc check, and control has
  555.          returned (when the RETF instruction was executed) to
  556.          21DD:3EA9.  We are now ready to continue with the game.
  557.  
  558.  
  559.               Notice the instruction at 3281:39AD.  This  is where EFH
  560.          sets that external  flag.   But  how  did  I  determine this.
  561.          Well, by luck.  If you look through  the  entire routine, you
  562.          will not find any other instructions placing  a  value in the
  563.          data segment (DS).   And since I decided a long time ago that
  564.          EFH was written in a higher level  language,  we  can  assume
  565.          that it is writting to some variable.
  566.  
  567.               So, hoping that we have found the flag,  we  go  back to
  568.          step 1.  This  time,  we manualy edit the word at DS:0744 and
  569.          place the value FFFFh there.  We  then skip over the call the
  570.          the doc check  and execute the game.  Then before  our  eyes,
  571.          shit happenes.  The  game  comes  up, and everything is fine.
  572.          By George you've got it.
  573.  
  574.               So how do we fix the program to always return a good doc
  575.          check.  Well, we could go about it 2 ways.  The first, is you
  576.          could simple modify the instruction at 3281:3935 to perform a
  577.          long jump to 3281:39AD.  This  would  force  set the value no
  578.          matter what was  typed.  But who the fuck wants  to  have  to
  579.          type anything.  I sure don't so lets think of another way.
  580.  
  581.               If we  look at the entire doc check routine, we will see
  582.          that it does nothing but handle  the doc check (remember when
  583.          we first bypassed  the  check.   The  screen   came   up  and
  584.          everything looked fine  until  it dropped you out.  So we can
  585.          assume that the actual screen is  not setup in doc check.  So
  586.          I suggest placing a small patch right in the begining  of the
  587.          doc check.
  588.  
  589.               But what  should  this  patch  do? (BTW: it's late and I
  590.          don't know If I'm using ?s right.   So  if  not  TOO  FUCKING
  591.          BAD).  Well, all  it should do is place the  value  FFFFh  at
  592.          DS:0744h.  Here is the assembly language routine to do it.
  593.  
  594.                         50       PUSH AX
  595.                         B8FFFF   MOV AX,FFFF
  596.                         3E       DS:
  597.                         A34407   MOV WORD PTR [0744],AX
  598.                         58       POP AX
  599.                         CB       RETF
  600.  
  601.               This small  routine will place the value FFFFh at DS:744
  602.          and then exit back to the main  loop.   Simple huh (note, you
  603.          don't really need the save AX or load AX with  FFFFh for that
  604.          matter but I did it for clarity).
  605.  
  606.               So now  that we have the patch, and now where to put it,
  607.          how do we get it there.  Well,  thats  where  the file editor
  608.          comes in, but  first  you  will  need  2  things.    The  hex
  609.          equivlent of out   patch   (in  this  case  the  10  bytes  :
  610.          50,B8,FF,FF,3E,A3,44,07,58,CB) and some string to search for.
  611.          I suggest usings the first 14  bytes  of  the routines we are
  612.          going to write  over (the code at address 3281:36A5).   Those
  613.          bytes are 55, 8B, EC, 83, EC ,2A ,C7, 46, DE ,00 ,00, B8, 06,
  614.          and 00.  When   selecting  the  search  string,  select  only
  615.          instructions that ARN'T call,  jump,  loop or any instruction
  616.          that has a memory address in them.  This value  will  NOT  be
  617.          the same when you do the search.
  618.  
  619.               Now, using for file editor (I used PCTOOLS, but NORTON's
  620.          will do) search  for  our  string  (55,8B,  etc).  When it is
  621.          found (somewhere near sector 200)  write  down  the sector #.
  622.          Now, go and edit that sector.  Find our search string (55,8B,
  623.          etc) and replace  it  with the patch string (50,B8,FF,  etc).
  624.          Now save the sector.
  625.  
  626.               Your down.   Try  playing  the game.  It should load up,
  627.          and then go right from the title  page  (or the intro) to the
  628.          game without stopping  at  the doc check.  If  your  doesn't,
  629.          then you fucked  up.   Restart  from  the beginning (NO, this
  630.          file didn't fuck up, and I DON'T MAKE MISTAKES).
  631.  
  632.               Well, you did it.  You have  now  removed your first doc
  633.          check.  Don't ya feel real good.  With time, you will be able
  634.          to remove any type of doc check.
  635.  
  636.  
  637.                                                       -BUCKAROO BANZAI
  638.  
  639.  
  640.                      At this time I would just like to say
  641.  
  642.                           `ALL CRACKING GROUPS SUCK!'
  643.