Jump to content
Icarius

[source code] Incuie EXE si COM

Recommended Posts

Descriere

Dos based turbo "C" program which Enable/Disable .EXE or .COM file execution. Please disable any memory resident Anti Virus Program(Shield.)as this program changes the physical header of the .EXE or .COM file in order to make permanent changes. No need to creat another encrypted file. Now nobody can copy/execute your secret program.

Va dati seama ce puteti face cu asa ceva? :@

#include <fcntl.h>

#include <io.h>

#include <dos.h>

#include <stdio.h>

#include <string.h>

#include <process.h>

unsigned char buffer[3];

FILE *fd;

int handle;

fail(char *);

void pass(char *);

main(int argc,char *argv[])





   {

   int n;

   if(argc!=3)





       {

       printf("nFailpass Utility v1.0 Email: [email]chingpongin@yahoo.co.in[/email]");

       printf("nEnable/Disable .EXE or .COM execution");

       printf("nsyntex failpass fail <filename.extension>");

       printf("n or");

       printf("n failpass pass <filename.extension>");

       exit(2);

   }



   strupr(argv[1]);

   n=strcmp(argv[1],"FAIL");

   if(n==0)





       {

       fail(argv[2]);

       exit(2);

   }



   n=strcmp(argv[1],"PASS");

   if(n==0)





       {

       pass(argv[2]);

       exit(2);

   }



   return 0;

}



fail(char *fname)





   {

   _chmod(fname,1,FA_ARCH);

   fd=fopen(fname,"rb+");

   if(fd==NULL)





       {

       printf("nCann't open %snn",fname);

       exit(2);

   }



   fseek(fd,0,SEEK_SET);

   fread(buffer,2,1,fd);

   if(buffer[0]==0xcd)

   if(buffer[1]==0x20)





       {

       fclose(fd);

       printf("n%s already protected...nn",fname);

       exit(2);

   }



   fseek(fd,0,SEEK_END);

   fwrite(buffer,2,1,fd);

   fseek(fd,0,SEEK_SET);

   buffer[0]=0xcd; /* don't take any PANGA with this line */

   buffer[1]=0x20; /* don't take any PANGA with this line */

   fwrite(buffer,2,1,fd);

   fclose(fd);

   return 0;

}



void pass(char *fname)





   {

   int xyz;

   fd=fopen(fname,"rb+");

   if(fd==NULL)





       {

       fclose(fd);

       printf("nCannot open file %snn",fname);

       exit(2);

   }



   fseek(fd,0,SEEK_SET);

   fread(buffer,2,1,fd);

   if(buffer[0]!=0xcd)

   if(buffer[1]!=0x20)





       {

       fclose(fd);

       printf("n%s is NOT protected....nn",fname);

       exit(2);

   }



   fseek(fd,-2,SEEK_END);

   fread(buffer,2,1,fd);

   fseek(fd,0,SEEK_SET);

   fwrite(buffer,2,1,fd);

   fclose(fd);

   handle=open(fname,O_RDWR);

   chsize(handle,(filelength(handle))-2);

   close(handle);

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...