Making A Website Blocker With Manifest

Discussion in 'C' started by The Alchemist, Apr 12, 2014.

  1. The Alchemist

    The Alchemist New Member

    Joined:
    Jul 7, 2012
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    I'm trying to make a website blocker that runs with administrator privileges.
    Here is my C code : http://www.scriptings.tk/paste/5348fab7a1ee5
    Or view it here :
    Code:
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
        FILE* handler;
        int i;
        char* str = "127.0.0.1       ";
        char site[25];
        handler   = fopen("C:\\\\Windows\\System32\\drivers\\etc\\hosts","a");
        do
        {
            printf("Enter site : ");
            fflush(stdin);
            gets(site);
            fputs(str, handler);
            fputs(site, handler);
            fputs("\n", handler);
            printf("Enter 1 to continue : ");
            scanf("%d",&i);
        } while(i == 1);
        fclose(handler);
        getch();
    }
    
    Here is my manifest file : http://www.scriptings.tk/paste/5348fb172bbd8
    OR view it here :
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <ms_asmv2:trustInfo xmlns:ms_asmv2="urn:schemas-microsoft- 
         com:asm.v2">
        <ms_asmv2:security>
          <ms_asmv2:requestedPrivileges>
            <ms_asmv2:requestedExecutionLevel level="requiredAdministrator">
            </ms_asmv2:requestedExecutionLevel>
          </ms_asmv2:requestedPrivileges>
        </ms_asmv2:security>
      </ms_asmv2:trustInfo>
    </assembly>
    Im using Microsoft Visual Studio 2010. Its getting Built completely and asking for administrator privileges while executing. But when I run the exe, an error comes up :
    [​IMG]

    How do I solve this problem? Is this something thats happening due to Windows 7 firewall or something?
    Please guys, help me out with this.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice