1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Making A Website Blocker With Manifest

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

  1. The Alchemist

    The Alchemist New Member

    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