source: trunk/tools/test/instvir!.bas@ 57

Last change on this file since 57 was 57, checked in by Ben Rietbroek, 10 years ago

All source-files lowercased [v1.1.1-testing]

Some standard files like 'COPYING', 'LICENSE', etc. have not been
converted to lower case because they are usually distributed uppercased.

File size: 1.5 KB
Line 
1$COMPILE EXE
2
3Open "TESTVIR!.COM" For BINARY As #1
4Get$ #1, 512, VirusBase$
5
6If len(VirusBase$)>446 Then print "Image too long!": end
7VirusBase$ = VirusBase$ + string$(446-len(VirusBase$), 0)
8
9LocalMBR$ = AiRBOOT_LoadSector(1)
10VirusMBR$ = VirusBase$ + Mid$(LocalMBR$, 447)
11
12AiRBOOT_WriteSector 1, VirusMBR$
13AiRBOOT_WriteSector 50, LocalMBR$
14print "Test-Virus installed."
15
16Function AiRBOOT_LoadSector (byval Sector%) as STRING
17 SectorBuffer$ = string$(512, 0)
18 SectorPtr??? = StrPtr32(SectorBuffer$)
19 AiRBOOT_LoadSector_Retry:
20 ! mov ax, &h0201 ; load one sector
21 ! mov ch, 0
22 ! mov cl, Sector%
23 ! mov dx, &h0080 ; load to harddisc 0, head 0
24 ! les bx, SectorPtr???
25 ! int &h13
26 ! jnc AiRBOOT_LoadSector_Success
27 ! mov ah, &h00 ; reset disc
28 ! mov dl, &h80
29 ! int &h13
30 ! jmp AiRBOOT_LoadSector_Retry
31 AiRBOOT_LoadSector_Success:
32 FUNCTION = SectorBuffer$
33End Function
34
35Sub AIRBOOT_WriteSector (byval Sector%, byval SectorBuffer$)
36 SectorBuffer$ = SectorBuffer$ + string$(512-len(SectorBuffer$), 0)
37 SectorPtr??? = StrPtr32(SectorBuffer$)
38 AiRBOOT_WriteSector_Retry:
39 ! mov ax, &h0301 ; write one sector
40 ! mov ch, 0
41 ! mov cl, Sector%
42 ! mov dx, &h0080 ; write to harddisc 0, head 0
43 ! les bx, SectorPtr???
44 ! int &h13
45 ! jnc AiRBOOT_WriteSector_Success
46 ! mov ah, &h00 ; reset disc
47 ! mov dl, &h80
48 ! int &h13
49 ! jmp AiRBOOT_WriteSector_Retry
50 AiRBOOT_WriteSector_Success:
51End Sub
Note: See TracBrowser for help on using the repository browser.