example.c

来自「一百个病毒的源代码 包括熊猫烧香等 极其具有研究价值」· C语言 代码 · 共 28 行

C
28
字号
#include <stdio.h>
#include <string.h>
#include <malloc.h>

/* Choose between including "lzssnone.inc" and "plusari.inc"            */
/* "lzssnone.inc" offers decompression of 0(none) and 1(lzss)           */
/* "plusari.inc"  offers decompression of 0(none), 1(lzss) and 2(lzari) */

/* #include "lzssnone.inc" */
#include "plusari.inc"

void main(int argc, char *argv[])
{
  unsigned char* databuffer;
  long i, datalen;

  exedat_archive(argv[0]);              //STEP 1: which archive are we using?
  datalen = exedat_search("file2.txt"); //STEP 2: search file2.txt in archive
  databuffer = malloc(datalen);
  exedat_load(databuffer);              //STEP 3: load the file in buffer

  for (i = 0; i < datalen; i++)
	putc((char)databuffer[i], stdout);  //output the characters we loaded

  free(databuffer);
  return;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?