home *** CD-ROM | disk | FTP | other *** search
/ The Elite Hackers Toolkit / TheEliteHackersToolkitVolume1_1998.rar / HACKERS.BIN / appcraks / Q312CRK.ZIP / Q312CRK.TXT < prev   
Text File  |  1990-01-01  |  5KB  |  150 lines

  1. ;put q312crk.com in a directory with quake2.exe v3.12 (315k) and
  2. ;type 'q312crk<enter>'
  3.  
  4.  
  5. ; Q2 cracking program no_cd
  6. ; works on ver 3.12
  7. ;
  8.         bits 16
  9.         org 0x100
  10.         segment .text
  11. start:
  12.                 mov dx,TITLEBAR
  13.                 call PRSTRING                   ;print title
  14.                 call OPENFILERW                 ;open Quake2
  15.                 mov [FILEHANDLE],ax
  16.                 mov dx,CHECKFLSZ
  17.                 call PRSTRING
  18.                 call SETPTR                     ;eof=0004EA00?
  19.                 mov di,value
  20.                 mov si,address
  21.                 mov cx,0x1
  22.                 mov dx,CRACKINGFILE
  23.                 call PRSTRING
  24. LOOP1:
  25.                 push cx
  26.                 call PTSTARTOF
  27.                 call READFILE
  28.                 call PTSTARTOF
  29.                 call WRITEBYTE
  30.                 add si,byte +0x4
  31.                 add di,byte +0x2
  32.                 pop cx
  33.                 loop LOOP1
  34.                 mov dx,SUCCESS
  35.                 jmp short END1
  36. PATCHERR:
  37.                 mov dx,PATCHDIFF
  38.                 jmp short END1
  39. VERSIONERR:
  40.                 mov dx,WRONGVER
  41.                 jmp short END1
  42. OPENERR:
  43.                 mov dx,CANTOPEN
  44. END1:
  45.                 call PRSTRING           ;display errcode and
  46.                 call CLOSEFILE
  47.                 mov ah,0x4c             ;end program
  48.                 int 0x21
  49. PRSTRING:
  50.         push ax
  51.                 mov ah,0x9              ;display string (ds:dx ptr up to '$')
  52.                 int 0x21
  53.                 pop ax
  54.                 ret
  55. OPENFILERW:
  56.                 mov ah,0x3d             ;open file w/ handle
  57.                 mov al,0x2              ;mode openaccess read/write
  58.                 mov dx,QUAKEX           ;ds:dx ptr to filename
  59.                 int 0x21
  60.                 jc OPENERR
  61.                 ret
  62. CLOSEFILE:
  63.                 mov ah,0x3e             ;close file w/ handle
  64.                 mov bx,[FILEHANDLE]          ;ptr to handle
  65.                 int 0x21
  66.                 ret
  67. SETPTR:
  68.                 mov bx,ax               ;flhandle
  69.                 mov ax,0x4202           ;move fileptr (02=start@eof)
  70.                 xor cx,cx               ;ms16bits of offset=00
  71.                 xor dx,dx               ;ls16bits of offset=00
  72.                 int 0x21
  73.                 jc OPENERR
  74.                 cmp ax,[VER1]
  75.                 jnz VERSIONERR
  76.                 cmp dx,[VER2]
  77.                 jnz VERSIONERR
  78.                 ret
  79. READFILE:
  80.                 mov ah,0x3f             ;read file
  81.                 mov bx,[FILEHANDLE]
  82.                 mov cx,0x1              ;only one byte
  83.                 mov dx,BUFFER1          ;ds:dx buffer to receive
  84.                 int 0x21
  85.                 mov ah,[BUFFER1]
  86.                 cmp [di],ah             ;look for 0x75 (jnz)
  87.                 jnz PATCHERR
  88.                 jc OPENERR
  89.                 ret
  90. WRITEBYTE:
  91.                 mov ah,0x40             ;write device
  92.                 mov bx,[FILEHANDLE]
  93.                 mov cx,0x1              ;one byte
  94.                 mov dx,di               ;ptr to data source+1
  95.                 inc dx                  ;write 0xEB (jmpshort)
  96.                 int 0x21
  97.                 jc OPENERR
  98.                 ret
  99. PTSTARTOF:
  100.                 mov ah,0x42             ;move file ptr
  101.                 mov al,0x0              ;start @ beginning of file
  102.                 mov bx,[FILEHANDLE]
  103.                 mov dx,[si]             ;msw offset
  104.                 mov cx,[si+0x2]         ;lsw offset
  105.                 int 0x21
  106.                 jnc RETURN
  107.                 jmp short OPENERR
  108. RETURN:
  109.                 ret
  110. ; text messages from here
  111. FILEHANDLE:     db 0,0
  112. VER1:           db 0,0xEA
  113. VER2:           db 0x04,0
  114. BUFFER1:        db 0
  115. QUAKEX:         db "QUAKE2.EXE"
  116.                 db 0
  117. address:          db 0x08,0xE5,0x02,0
  118. value:          db 0x75,0xEB
  119. TITLEBAR:       db "[No_cd FOR QUAKE2.EXE v3.12 BY MDSE Machines D"
  120.                 db "ivision... Opening file :$"
  121. CHECKFLSZ:      db "OK!"
  122.                 db 0x0d,0x0A,0xFE
  123.                 db " Filesize=0004EA00?  $"
  124. CRACKINGFILE:   db "OK!"
  125.                 db 0x0d,0x0A,0xFE
  126.                 db " Jnz>JmpShort@0002E508$"
  127. SUCCESS:        db "OK!"
  128.                 db 0x0d,0x0A,0xFE
  129.                 db " Done.        "
  130.                 db 0x0d,0x0A
  131.                 db "$"
  132. PATCHDIFF:          db "Frag!"
  133.                 db 0x0d
  134.                 db 0x0A,0xFE
  135.                 db " File already patched or different."
  136.                 db 0x0d,0x0A
  137.                 db "$"
  138. WRONGVER:          db "Frag!"
  139.                 db 0x0d,0x0A,0xFE
  140.                 db " File is packed or wrong version"
  141.                 db "!"
  142.                 db 0x0d,0x0A
  143.                 db "$"
  144. CANTOPEN:          db "Frag!"
  145.                 db 0x0d,0x0A,0xFE
  146.                 db " Can't open file !!"
  147.                 db 0x0d
  148.                 db 0x0A,"$"
  149.  
  150.