home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / +ORC / Orc pac 42B / FILEZ.ZIP / CRACKER.ASM < prev    next >
Encoding:
Assembly Source File  |  1997-03-06  |  4.6 KB  |  125 lines

  1. ;Cracker.ASM from Uncle Joe's Crackbook
  2.  
  3. .model  small
  4. .code
  5. ORG     100H
  6. start:          JMP     begin
  7.  
  8. ;******************************************************************************
  9. ;       these are all the variables you set to crack a file,
  10. ;       simply change the values and then assemble the program
  11. ;******************************************************************************
  12.  
  13. msb     EQU     0000H                   ;the first part of the patch offset
  14. lsb     EQU     055AH                   ;the second part of the patch offset
  15. cnt     EQU     3H                      ;number of bytes in your patch
  16. patch_data      DB 'EB2E90',0           ;the byte string to be written
  17. file_name       DB 'go.pdm',0           ;the name of the file to be patched
  18.  
  19. logo            DB 'Cracked by Uncle Joe',0AH,0DH
  20.         DB '  -=W.A.S.P. 92=- ',0AH,0DH
  21.  
  22. error1          DB 'FILE NOT FOUND',0AH,0DH
  23.         DB 'Make sure you have GO_CRACK.COM in the same',0AH,0DH
  24.         DB 'directory as GO.PDM',0AH,0DH
  25.         DB '$'
  26.         
  27. error2          DB 'A FATAL ERROR HAS OCCURED',0AH,0DH
  28.         DB 'THE CRACK WAS NOT APPLIED',0AH,0DH
  29.         DB '$'
  30.         
  31. error3          DB 'GO.PDM has the read only attribute set',0AH,0DH
  32.         DB 'reset it before attempting to make the patch',0AH,0DH
  33.         DB '$'
  34.         
  35. handle          DW 0
  36.  
  37. ;******************************************************************************
  38. ;       this procedure opens the file to be cracked
  39. ;******************************************************************************
  40.  
  41. open_it         PROC    near
  42.         MOV     DX,offset file_name     ;setup to open file to be
  43.         MOV     AX,3D02H                ;cracked
  44.         INT     21H
  45.         JNC     done                    ;if successful, continue
  46.  
  47.         CMP     AX,05H
  48.         JZ      read_only
  49.         MOV     AH,09H                  ;else display error message
  50.         MOV     DX,offset error1        ;and exit
  51.         INT     21H
  52.         JMP     exit
  53. read_only:      MOV     AH,09H
  54.         MOV     DX,offset error3
  55.         INT     21H
  56.         JMP     exit
  57.         
  58. done:           MOV     handle,AX               ;store the file handle for
  59.         RET                             ;use later and return
  60. open_it         ENDP
  61.  
  62. ;******************************************************************************
  63. ;       this procedure sets the file pointer to the patch location
  64. ;******************************************************************************
  65.  
  66. move_it         PROC    near
  67.         MOV     AH,42H                  ;setup to move the file
  68.         MOV     AL,00H                  ;pointer to the patch site
  69.         MOV     BX,handle               ;load the file handle
  70.         MOV     CX,msb                  ;the first part of offset
  71.         MOV     DX,lsb                  ;and the second part
  72.         INT     21H                     ;move the pointer
  73.         JNC     ok                      ;if successful, continue
  74.  
  75.         MOV     AH,09H
  76.         MOV     DX,offset error2
  77.         INT     21H                     ;else print error message and
  78.         JMP     exit                    ;exit
  79. ok:             RET
  80. move_it         ENDP
  81.  
  82. ;******************************************************************************
  83. ;       this procedure writes the crack to the file and closes it
  84. ;******************************************************************************
  85.  
  86. patch_it        PROC    near
  87.         MOV     AH,40H                  ;setup to write the crack
  88.         MOV     BX,handle               ;load file handle
  89.         MOV     CX,cnt                  ;load number of bytes to write
  90.         MOV     DX,offset patch_data    ;point DX to patch data
  91.         INT     21H                     ;make the patch
  92.  
  93.         JNC     close_it                ;if successful, contintue
  94.         MOV     AH,3EH
  95.         INT     21H
  96.         MOV     AH,09H                  ;if not then something
  97.         MOV     DX,offset error2        ;is wrong, disk may be write
  98.         INT     21H                     ;protected. If so, print error
  99.         JMP     exit                    ;message and exit
  100.         
  101. close_it:       MOV     AH,3EH                  ;crack was successful
  102.         INT     21H                     ;close file and return
  103.         RET
  104. patch_it        ENDP
  105.  
  106. ;******************************************************************************
  107. ;       the main program
  108. ;******************************************************************************
  109.  
  110. begin           PROC    near
  111.         CALL    open_it                 ;open file to be patched
  112.         CALL    move_it                 ;move pointer to patch site
  113.         CALL    patch_it                ;make the patch and close file
  114.         MOV     AH,09H
  115.         MOV     DX,offset logo          ;display logo
  116.         INT     21H
  117.  
  118. EXIT:           MOV     AX,4C00H                ;and exit
  119.         INT     21H
  120. BEGIN           ENDP
  121.  
  122.         END     START                
  123.  
  124.  
  125.