home *** CD-ROM | disk | FTP | other *** search
/ TCE Demo 2 / TCE_DEMO_CD2.iso / demo_cd_.2 / mags / stosser / stoser08.arj / stoser08.msa / ISSUE_8 / 5.PNE < prev    next >
Text File  |  1987-04-22  |  7KB  |  170 lines

  1.  
  2.  
  3.               AN 'INTERESTING' DOC FILE BY ANDY CATO
  4.  
  5.                      -----------------------
  6.                               FILE 1
  7.                   HOW TO DEPACK EXECUTABLE FILES
  8.                             USING MONST
  9.                  -------------------------------
  10.  
  11.      This is the start of a munber of 'interesting' docs aimed at 
  12.      those of you out there that are interested in possibly trying 
  13.      to rip stuff from your demos/games etc.  First of all, to rip 
  14.      anything you must have it in memory in the first place.  Now 
  15.      the best way to do this would be to buy a ripping cartridge 
  16.      which i'm sure those of you out there who have got one would 
  17.      agree.  Failing that then some sort of program that can do a 
  18.      similar thing.  There are a number of them about including 
  19.      the excellent Adrenaline ripper.  Others are the Fuzion Mega 
  20.      Ripper, Probe St and many others I could mention.  
  21.  
  22.      If you are more interseted in actually 'getting inside ' a 
  23.      program then keep reading because you will find this doc
  24.      very 'interesting'.
  25.  
  26.      This doc will teach you the basics of 'getting inside' a     
  27.      packed program to depack it.
  28.  
  29.      You don't need to know any assembler to understand this doc 
  30.      but if you do it helps.  I have tried to make it as easy as 
  31.      possible to read and understand, so just follow the 
  32.      instructions and you won't go wrong - believe me.
  33.      All you need is Monst2 and a little patience (and that's not 
  34.      a group of ill dwarves).
  35.  
  36.      Before we start I'd just like to point out that assembler is 
  37.      not that difficult if you have the right books and tools.  I 
  38.      started off with Monst after reading the article in ST Format 
  39.      years ago on how to train a game, and ever since then i've 
  40.      been hooked.  THE book to get is ATARI ST INTERNALS by ABACUS 
  41.      SOFTWARE.  ISBN 0-916439-46-1.  This will tell you all you 
  42.      need to know about assembly programming to get started.  You 
  43.      could also learn as I did by using Easy Rider.  This is a 
  44.      disassembler which takes programs back down to their original 
  45.      code so you can change it and re-assemble through Genst it to 
  46.      see what does what.
  47.  
  48.      Ok then on with the show.............
  49.  
  50.      Read this very carefully, I shall only type it once!
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. 1    Load Monst2 in low or medium res from desktop.  It doesn't
  58.      matter about the resolution because you can press Ctrl + O
  59.      in Monst to change screen modes.
  60.  
  61. 2    You will now be looking at a prompt to load an executable 
  62.      file, if not then press Ctrl + L to get this prompt up.  
  63.      Enter your file to load and press return twice.
  64.      The file will now be loaded and in the Disassembly PC screen 
  65.      there should be some code and an arrow pointing to the first 
  66.      line of that code.  This arrow is known as the Program 
  67.      Counter or PC and indicates which line of code is to be run 
  68.      next.
  69.  
  70. 3    Press W to fill memory.  You will be prompted for a start 
  71.      address, an end address and data to fill with.
  72.      Ok then, type the following:
  73.  
  74.      A4,A4+(A7-A4-1),EE  then press return
  75.  
  76. 4    This will fill all of your memory with loads of Es from the 
  77.      end of your packed file. This should be enough for most 
  78.      programs.
  79.  
  80. 5    Now to unpack the file.
  81.  
  82. 6    Most depacking routines have two main parts to them and are 
  83.      seperated by a common instruction called a jump (JMP).
  84.      To search for the first JMP type the following:
  85.                     
  86.      G then I then JMP then press return
  87.  
  88.      You should now be looking at an instruction something like
  89.      
  90.      JMP   (A1)     or
  91.      JMP   (A2)     or 
  92.      JMP   (A3)     or
  93.      JMP   (A4)     or even something like
  94.      JMP  -$20(A7)
  95.  
  96.      or something similar to these instructions as long as there
  97.      are no question marks in the instruction. 
  98.  
  99. 7    Having found the JMP press Ctrl + B to set a breakpoint at
  100.      that address.  A [1] should appear to the right of the 
  101.      instruction.
  102.  
  103. 8    Press either Ctrl + R or R then G to run the program up to
  104.      this address.
  105.  
  106. 9    All having gone well you should be at the address where you 
  107.      set the breakpoint.  Press Ctrl + T once to run that 
  108.      instruction.  
  109.  
  110. 10   The code will now have jumped to the next part of the
  111.      routine so press N to find the next JMP (which should be
  112.      quite close ).  Follow steps 7 to 9 again.
  113.  
  114. 11   Your packed file is now unpacked and is ready to save.
  115.  
  116. 12   Press TAB until you are in the memory screen then press M
  117.      then PC then press return then type the following:
  118.  
  119.      G then L then EEEEEEEE   (8 Es in all) then press return.
  120.           
  121.      This will search for the data you filled memory with earlier 
  122.      on.  You may find a small group of Es here and there but 
  123.      press N until you find a large group of them.  If you get 
  124.      lost when searching then Press M then PC to get back to the 
  125.      start of the program then try again.
  126.  
  127. 13   Having found a large group of Es MAKE A NOTE OF THE ADDRESS 
  128.      OF THE START OF THEM.
  129.      You can find out how big the unpacked file is by doing this:
  130.  
  131.      Press O and you will be asked to enter an expression.  
  132.      Enter the address you made a note of then minus then PC then
  133.      return.  This will give you a Hex value and a decimal value
  134.      underneath after you press return.
  135.  
  136. eg.  $103060-PC   (the Es address minus the start of the program)
  137.  
  138. 13a  Press S for the save file prompt.
  139.      Now type in your file name to save then press return.
  140.      You will be asked for a start and end address.  For the start 
  141.      type in PC, then for the end type in the address you made a 
  142.      note of then press return to save.
  143.  
  144. 14   Your file will be saved as a data file and not a file you can 
  145.      run so don't try and run it 'cos it won't work.
  146.  
  147. 15   Once saved you can then hack your way through with all those 
  148.      rippers that couldn't find anything before.
  149.  
  150.  
  151.      The above routine will work on most programs but there are a 
  152.      few types that it won't work on, namely link-filed programs 
  153.      and some depackers that need decrypting first, but that's a 
  154.      whole new subject and i'm tired of typing so tough ****.  
  155.      
  156.  
  157.      Hope some of you out there you found this doc file useful.  
  158.      And have maybe learned a bit about assembler in the process.
  159.  
  160.  
  161.      Look out for more 'interesting' docs in the future.
  162.  
  163.      All spolling mestakes are mi owen
  164.  
  165.  
  166.  
  167.  
  168.      Spread me, i'm jam.
  169.  
  170.