
ខាងក្រោមនេះប្រភពកូដ source code សរសេរក្នុង កម្មវិធីC
#include<dos.h>
#include<dir.h>
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1″;
FILE *target;
void block_site(void);
{
int done;
struct ffblk ffblk;//File block structure
/*to determine the root drive*/
if(done==0)
{
target=fopen(”C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
/*to determine the root drive*/
if(done==0)
{
target=fopen(”D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
/*to determine the root drive*/
if(done==0)
{
target=fopen(”E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
/*to determine the root drive*/
if(done==0)
{
target=fopen(”F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
}
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}
{
int success=0;
success=find_root();
if(success)
block_site();
}
2. ចំលងបញ្ចូល Compile source code ដោយប្រើ C/C++ compiler។
3. សាកល្បង រត់ compiled module វានឹងបិទវ៉ិបសាយ
4. ម្យ៉ាងទៀតលោកអ្នករត់ file block_Site.exe, ពេលនោះ restart កម្មវិធី browser ហើយបានបិទ URL បង្ហាញលេចចេញ “Page cannot displayed“។
4. ដោះចេញ remove បង្ហាញដូចខាងក្រោម
%windir%\system32\drivers\etc