tag:blogger.com,1999:blog-51310328160410634692024-03-17T15:51:30.980+08:00Write codePersonal blog and tutorials.<br>
This will be my personal blog. I will add interesting stuff, tutorials, code, video, download links, etc.Unknownnoreply@blogger.comBlogger23125tag:blogger.com,1999:blog-5131032816041063469.post-78102482280652318072013-06-13T18:30:00.000+08:002013-06-13T18:30:17.355+08:00Blog template test<div>
<div class="separator" style="clear: both; text-align: center;">
Sensational template</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyUcfCcL_JdfLRujibBHLl4wNaWDozhDLLe8zBQIRyPzeZ3xP6iCSStMyyXmzNffhBBcMdzo7Yffdjn2pK6HlSVkJ8gCcVrXWRwMtcbz89FSdT2KyAyuAsgMcwiUilA3UJ5iw3LYelXBA/s600/Sensational+Responsive+blogger+template.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyUcfCcL_JdfLRujibBHLl4wNaWDozhDLLe8zBQIRyPzeZ3xP6iCSStMyyXmzNffhBBcMdzo7Yffdjn2pK6HlSVkJ8gCcVrXWRwMtcbz89FSdT2KyAyuAsgMcwiUilA3UJ5iw3LYelXBA/s320/Sensational+Responsive+blogger+template.png" width="320" /></a></div>
<br />
<br />
This new template looks cool. If you are interested, here the links for this template:</div>
<div>
<a href="http://www.blogtipsntricks.com/2013/01/sensational-free-responsive-blogger-template.html">http://www.blogtipsntricks.com/2013/01/sensational-free-responsive-blogger-template.html</a></div>
<div>
<br /></div>
This is only a test, you should ignore this.<br />
<div>
<br /></div>
<div>
<br /></div>
<div class="message_box announce">
Did you know that?</div>
<div class="message_box note">
This is only a test</div>
<div class="message_box success">
It just nothing here</div>
<div class="message_box warning">
This is useless posts</div>
<br />
<pre>for (int i = 0; i < 10; i++) {
printf("%d...\n", i);
}
</pre>
Cool!Unknownnoreply@blogger.com21tag:blogger.com,1999:blog-5131032816041063469.post-15714050870607289812012-10-01T00:09:00.000+08:002012-10-01T00:16:57.006+08:00Sandboxie: How safe it is?<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4GG-ZcDa91BJEeivRbsdMWxtDfwBeR29449SaWO-73fGE3CXuZIuymXwg0Q_xAj3GeCtb9yRTbFqUPQz6trNeSnXBxVdjlfW5BfUVZEECmaoi2z_U58-k0RGt7f4H9YAB9_a3JOzT96SS/s1600/sandboxie_icon.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4GG-ZcDa91BJEeivRbsdMWxtDfwBeR29449SaWO-73fGE3CXuZIuymXwg0Q_xAj3GeCtb9yRTbFqUPQz6trNeSnXBxVdjlfW5BfUVZEECmaoi2z_U58-k0RGt7f4H9YAB9_a3JOzT96SS/s1600/sandboxie_icon.gif" /></a></div>
<br />
<br />
More and more file shared between forum users, and a question arise. "Is the file safe?", "Is it safe to open this file? My antivirus XXX detect the file as YYY"<a href="http://www.blogger.com/blogger.g?blogID=5131032816041063469"></a><br />
<div>
<br /></div>
<div>
A forum user might reply that it maybe a false-positive detected by antivirus (and then begin comparing which antivirus is better). or something like this "To be safe, run inside sandboxie or virtual machine."</div>
<div>
<br /></div>
<div>
So today's topic is - <b>How safe is sandboxie</b>?</div>
<div>
To begin with, how about some introduction first.</div>
<div>
<br /></div>
<div>
<h3>
How sandboxie work?</h3>
</div>
<div>
According to main page, it's pretty clear how sandboxie work. Looking at gif images will surely made you understand in less than a second.</div>
<div>
<br /></div>
<div>
Sandboxie runs your program <b>INSIDE</b> isolated space. For example, says a software... let's call it "destroy_my_pc.exe". This software will alter your window's registry, modify file data, delete file on your computer and add some files into your computer. When you run this software using sandboxie, All the changes made by "destroy_my_pc.exe" on your computer will stays inside the sandbox, inside the isolated space.</div>
<div>
<br />
<a name='more'></a><br /></div>
<div>
Sandboxie will create a virtual space for your program. The space is usually on C:\Sandbox (Unless you changed the setting). So let's say the program wanted to create some file on your computer. Let's say it want to create a file on "C:\autorun.bat". When the program is run through sandboxie, the file will physically created on "C:\Sandbox\User\DefaultBox\drive\c\autorun.bat", not on "C:\autorun.bat". The software doesn't know that it runs on isolated space. The programs will see that the file resides on C:\autorun.bat but actually the file is on "C:\Sandbox\User\DefaultBox\drive\c\autorun.bat".</div>
<div>
<br /></div>
<div>
Let's say the software doesn't want to create autorun.bat when it is already exists. What it do is it will check the folder/drive content one by one to see if the file exists. Firstly, it do this by requesting the windows "What 's on C:\ ?". The windows reply back by giving file entries, such as: "Boot", "Program Files", "Users", "Windows", "some", "etc", etc", "etc...", "pagefile.sys", <b>"autorun.bat"</b> (<- Hey look... It's already there! Don't create the file!). So how the autorun.bat shows up on C:\ when it is not physically there? The file is on "C:\Sandbox\User\DefaultBox\drive\c\autorun.bat" Remember?</div>
<div>
<br /></div>
<div>
When a program inside a sandboxie request something from windows, sandboxie sits somewhere between windows and the program. While it sits there, it interfere the request by combining the entries returned by system with sandbox path. When a file got deleted inside sandbox, sandboxie simply remove deleted file from the entry. This is how it works with registry too. Sandboxie simply combine the two (real system and sandbox) into one and give it back to the program. How about altering file content? Simply by copying the file from physical path into sandbox path and alter the file data inside the sandbox path.<br />
<br />
<b>EDIT</b>: Here I found something more to help you understand. The use of paper metaphor is most correct and easily understand. Source: <a href="http://www.sandboxie.com/index.php?FrequentlyAskedQuestions#WhatIsSandboxie" target="_blank">WhatIsSandboxie</a>?<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
Think of your PC as a piece of paper. Every program you run writes on the paper. When you run your browser, it writes on the paper about every site you visited. And any malware you come across will usually try to write itself into the paper.</blockquote>
<blockquote class="tr_bq">
Traditional privacy and anti-malware software try to locate and erase any writings they think you wouldn't want on the paper. Most of the times they get it right. But first the makers of these solutions must teach the solution what to look for on the paper, and also how to erase it safely.</blockquote>
<blockquote class="tr_bq">
On the other hand, the Sandboxie sandbox works like a transparency layer placed over the paper. Programs write on the transparency layer and to them it looks like the real paper. When you delete the sandbox, it's like removing the transparency layer, the unchanged, real paper is revealed.</blockquote>
</blockquote>
</div>
<div>
<br /></div>
<div>
<h3>
How safe it is?</h3>
</div>
<div>
Sandboxie is pretty safe if you are using it right. Let's say you run a browser inside the sandboxie, downloaded some program which turned out to be a virus, and run it inside sandbox. The virus changed everything and deleted everything to make the windows unbootable. It also tried to copy files to external drive. But what really happen is all changes is inside the sandbox. When you restart your computer, your windows will still remain intact like nothing happens. What really infected is your sandbox. In fact, you can delete all your sandbox content by right-clicking it. Yes sandboxie is pretty safe.</div>
<div>
<br /></div>
<div>
<h3>
When does it not safe?</h3>
As explained before, sandboxie <b>combine</b> the system file and registry with sandbox file and registry. A program running on sandbox can see and read the system, but cannot write to it - all write goes into sandbox and subsequent read/write will be performed inside the sandbox.<br />
<br />
Sandboxie will not create a new fresh windows environment but rather a copy of your system. Well not exactly a full copy, but only copy when it is necessary such as when a program running inside sandbox wanted to write to an existing file, sandboxie will copy the file into sandbox first and then redirect the write into sandbox and all subsequent read and write will be on sandbox path.<br />
<br />
Let's say you downloaded a file named "openme.exe" and begin suspicious with the file as your antivirus detect the file as trojan or dangerous malware. But you are not convinced. You turned off the antivirus and run the file inside the sandboxie. Then, you monitored the process and suddenly the process terminated. You inspected your sandbox content to see what changes made by the program - nothing can be found. So you delete the file as it does nothing. Suddenly, the next when you tried to login into your gmail account or facebook account or yahoo account, you can't. Your password has been changed by someone. All your account has been hacked. You decided to update your antivirus program and definition and scan the entire system, but the result is everything clean. Nothing infected your system. So what happened exactly?</div>
<div>
<br />
What really happen is the program is instructed to collect all sensitive data on the victim computer. When you execute the file "openme.exe", the program will read your sensitive data, bypass firewall maybe and transmit all sensitive data to the attacker.<br />
<br /></div>
<div>
To prove this, I made a quick simple test program using VB6.0 and run inside sandboxie using its default settings. The program will run this test:</div>
<div>
- Internet connectivity test.</div>
<div>
- File read test</div>
<div>
- Screenshot test<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxVKDgUqKBRbIpaO1MmSxI3EfLvaUrswe0NhsDBR4cGRuR_xZ_XZveIHujHXgOdKhq__TlE7cEFXpy3oWZVOsHAAUfLYwGhF6wpf5oUWJfBFYj_Za1a5vw0sQh6Xo8WS2SBkWgqrxn6KB/s1600/sandtest.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="434" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirxVKDgUqKBRbIpaO1MmSxI3EfLvaUrswe0NhsDBR4cGRuR_xZ_XZveIHujHXgOdKhq__TlE7cEFXpy3oWZVOsHAAUfLYwGhF6wpf5oUWJfBFYj_Za1a5vw0sQh6Xo8WS2SBkWgqrxn6KB/s640/sandtest.png" width="640" /></a></div>
<br />
<br />
<b>All test run successfully.</b><br />
<br />
<h3>
How to be safe?</h3>
Stay away from suspicious file or web page, never open them. If you still wanted to open it, use a completely isolated environment such as virtual machine and perhaps with network function disabled. If you want to use sandboxie to test suspicious file, block access to sensitive file, folder or registry by opening sandbox settings. Also, read the <a href="http://www.sandboxie.com/index.php?FrequentlyAskedQuestions" target="_blank">Sandboxie FAQ</a> to understand how sandboxie works, how can it protect your system and what it cannot protect. Don't forget to use antivirus and firewall.</div>
<div>
<br /></div>
<div>
I've been using sandboxie nearly about 3 years. As a sandboxie user I love the features and how it works. I used sandboxie primarily to isolate games and some programs from my computer. Whenever I need to format my computer, I just restore my sandboxie.ini to the windows folder without need to reinstall all games. So far, I encounter zero problems by doing this. Even online games with cheat protection engine does work.</div>
Unknownnoreply@blogger.com22tag:blogger.com,1999:blog-5131032816041063469.post-43566018550518658562012-08-11T12:32:00.002+08:002012-08-14T22:23:32.006+08:00Parallel Port SPI Flash Programmer (and Unbrick via WM8650 tablet)When using spipgm, you might encounter parity error or similar other error. Mostly, it means that the chip is not recognized because of various factor, such as bad connection. This issue has already been answered by Martin Rehak on its own web page. You can see them on <a href="http://rayer.g6.cz/programm/programe.htm#SPIPGM" target="_blank">SPIPGM FAQ</a>.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijal7uHjuZJD5JQbOT2gSZkOAeJfx_hyphenhyphenM73_UpdKuBDVI9O_eUThyphenhyphenHE6vLqE4s1R4IfdCCGBjzHfDzwbFCwQ5Fhw0_M_cWRsLCsLvToqu1HdkYvpaA6rvU9MVFhIaGSb6hz6tmfcAyMoCZ/s1600/20120725_100914.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijal7uHjuZJD5JQbOT2gSZkOAeJfx_hyphenhyphenM73_UpdKuBDVI9O_eUThyphenhyphenHE6vLqE4s1R4IfdCCGBjzHfDzwbFCwQ5Fhw0_M_cWRsLCsLvToqu1HdkYvpaA6rvU9MVFhIaGSb6hz6tmfcAyMoCZ/s320/20120725_100914.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Flashing EON EN25F40</td></tr>
</tbody></table>
<br />
The first time I use this software, I too had encounter parity error. So I want to share how I solved this problem and flash successfully the chip (unbrick WM8650 tablet).<br />
<br />
<a name='more'></a>If you already built your hardware interface and had this error, you should check all connection again and ensure that the supplied power isn't noisy. It's better to use battery as power supply than using AC to DC power supply. Make sure the cable isn't too long. Do not omit capacitor and resistor. Use resistor with appropriate value.<br />
<br />
Also, this programmer cannot run on 64-bit windows. If you have 64-bit OS such as Windows 7 x64, this programmer software cannot run. You will be needing a 32-bit OS. The easy solution is to use virtualization technology such as VirtualBox or VMWare and install a 32-bit windows there, and don't forget to configure the virtual machine to use LPT port. If you don't have a 32-bit windows, you can use linux/ubuntu.<br />
<br />
In my cases, the hardware I built failed to communicate with the chip. Then I started over and rebuilt the hardware. The parts I uses are:<br />
- 8x or more (thin) <b>wires</b>. The chip had 8 pins after all.<br />
- 8x <b>pins</b> (taken from unused LPT cable)<br />
- 1x 3V <b>CR2302 battery</b><br />
- 1x <b>1000uF capacitor</b><br />
- 8x <b>100ohms resistor</b> (Use appropriate value - depends on your LPT port output impedance and wiring parameters)<br />
<br />
<h3>
1. Finding the parts</h3>
The first things to do is finding the thin wire. Thick wire will create a problem when soldering the wire to the chip as the spaces between chip's pins is too close.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Y6nTt2FlkNR0FPykkEUsxvXWHdmuUAN3QLbwD_rkdIBK8G5FW0ovuslXPv_oJcBLhebvR17I_RIJ52hzslLQQsQXlyELm13ugC48CafPUnjdUmrNFgMfKg1AazpeO32LmZFHgwYHhEZE/s1600/use+thin+wire.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5Y6nTt2FlkNR0FPykkEUsxvXWHdmuUAN3QLbwD_rkdIBK8G5FW0ovuslXPv_oJcBLhebvR17I_RIJ52hzslLQQsQXlyELm13ugC48CafPUnjdUmrNFgMfKg1AazpeO32LmZFHgwYHhEZE/s320/use+thin+wire.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Use thin wire(right), the other two wire on the left is too thick. </td></tr>
</tbody></table>
<br />
The next things to do is to find the capacitor and resistor. You can buy them or scrape from unused electronic appliances. The other options is to borrow them from your electronic appliances and return back (solder back) when done.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdJgQaD3nWAuESgUW_EtPN6ZtAJye_UVxqCJhB1cbt5AQGdjrBqcF7yfQvxyRkoRTqKeLLFiyH0kI6okcZQ_NLSp8N6MPrjZ4RVFAJwcgzDNpW1NT-jc-uBhxCMVcNbzETWtHIPGmaTPBc/s1600/parts.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdJgQaD3nWAuESgUW_EtPN6ZtAJye_UVxqCJhB1cbt5AQGdjrBqcF7yfQvxyRkoRTqKeLLFiyH0kI6okcZQ_NLSp8N6MPrjZ4RVFAJwcgzDNpW1NT-jc-uBhxCMVcNbzETWtHIPGmaTPBc/s320/parts.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Some parts I used</td></tr>
</tbody></table>
<br />
Then, a power supply. The chip i'm going to flash is EON EN25F40 and have a power range of 2.7V to 3.6V. So, I pulled out the CMOS battery from my computer motherboard and use it.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg04J_TdVcMA_N2GeHvqXI9SZYPrVTDtrtF1Je0gvjgc6AJw3HfF8BCX2SPlZvV9dxkYicvhDp7QXj7x7oZisUknfBeatTuOI8DimKCpsXLvp-h70Si8gO74M0hnFliee2QbgkPCo_-yX9t/s1600/where+my+battery.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="299" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg04J_TdVcMA_N2GeHvqXI9SZYPrVTDtrtF1Je0gvjgc6AJw3HfF8BCX2SPlZvV9dxkYicvhDp7QXj7x7oZisUknfBeatTuOI8DimKCpsXLvp-h70Si8gO74M0hnFliee2QbgkPCo_-yX9t/s320/where+my+battery.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Where is my CMOS battery?</td></tr>
</tbody></table>
<br />
<h3>
2. Making the hardware</h3>
<a href="http://rayer.g6.cz/elektro/spipgm.htm" target="_blank">Refer circuit diagram here</a>.<br />
<br />
The hardware I created was so simple. The wire will be connected to LPT port and to chip directly, but of course there will be a resistor between them. The resistor is soldered to the wire and become parts of the wire itself. Then a pin is soldered to the resistor and finally the other end of the wire is soldered to the chip.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6SKgbVjz8CdscqVvOWhkFrIvgvz0FQeM67tVRWgZheOKiDVYA9eFqfSBmqty1R77ovT3rEAsk6NNHSEwCQug7te3gQ_v_YmQc7jXgigs-EhBUgZDGRgRPQqOcTkOvFXjr3viIf6eAOSwJ/s1600/the+wire.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6SKgbVjz8CdscqVvOWhkFrIvgvz0FQeM67tVRWgZheOKiDVYA9eFqfSBmqty1R77ovT3rEAsk6NNHSEwCQug7te3gQ_v_YmQc7jXgigs-EhBUgZDGRgRPQqOcTkOvFXjr3viIf6eAOSwJ/s400/the+wire.jpg" width="300" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Wire, resistor and pin altogether.</td></tr>
</tbody></table>
<br />
The rest (capacitor and power) can be easily to figure out.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPGZ38vDfvZ7qXWut_rEDiif2M3vv-iMivkZweRcZTV_wAgNhQdQKWlWknKCh1cNpVZty4kIGmrr7Uj1PCUUlg8qwTnJgABsy56rlb6F0RYTd5VvNeac9SjBdlPgaMXMoUzxHKGqrupqqS/s1600/simple_diagram.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPGZ38vDfvZ7qXWut_rEDiif2M3vv-iMivkZweRcZTV_wAgNhQdQKWlWknKCh1cNpVZty4kIGmrr7Uj1PCUUlg8qwTnJgABsy56rlb6F0RYTd5VvNeac9SjBdlPgaMXMoUzxHKGqrupqqS/s400/simple_diagram.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A simple diagram.</td></tr>
</tbody></table>
<br />
<h3>
3. Testing the hardware</h3>
Once the hardware is finished, it's time to test the hardware. Make sure again all the connection is good. Then go to your computer, open command prompt and cd to spipgm directory. Then type<br />
> <span style="font-family: Courier New, Courier, monospace;">spipgmw /i</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhg0t71ZT52rs5iNEGRFPbJZqvgV01nX9wj_1NXvEHiELigh16JpiNI18hX7XQ2ayL6S5l-wu2_FCWGGHPCmIMKeO6auDgy1D0_Zu4xqzxAJNoOxJ3gIRM9XmR7nyKHsK9V6VKhTz12A5u/s1600/pin+connection.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhg0t71ZT52rs5iNEGRFPbJZqvgV01nX9wj_1NXvEHiELigh16JpiNI18hX7XQ2ayL6S5l-wu2_FCWGGHPCmIMKeO6auDgy1D0_Zu4xqzxAJNoOxJ3gIRM9XmR7nyKHsK9V6VKhTz12A5u/s320/pin+connection.jpg" width="262" /></a></div>
<br />
<br />
If the programmer identifies the chip correctly, then you can proceed to the next step. Otherwise, you need to debug your hardware and find the problem.<br />
<br />
Check the hardware back, ensure all connection is good especially on non soldered or movable part such as the wire to LPT port. Make sure the power supply isn't too weak and provide enough power. Minimize power noise and etc. Make sure to read <a href="http://rayer.g6.cz/programm/programe.htm#SPIPGM" target="_blank">SPIPGM FAQ</a> on Martin Rehak's page. After all of that, run back the command.<br />
<br />
In my cases, the problem still persists. What I do is I create some batch file which contains the following command and saved it to spipgm folder.<br />
---------- SNIP ----------<br />
@echo off<br />
:loop<br />
spipgmw /r 0 32 /d=0<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
goto loop<br />
---------- SNIP ----------<br />
@echo off<br />
<br />
<br />
:loop<br />
spipgmw /i /d=0<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
sort readme.txt > nul<br />
goto loop<br />
---------- SNIP ----------<br />
You can download it here: <a href="http://www.mediafire.com/download.php?zch2a94zza0hqtd" target="_blank">http://www.mediafire.com/download.php?zch2a94zza0hqtd</a><br />
<br />
The first batch command above is simply to instruct the spipgm to read 32 bytes of data from the chip and running in loop. If the isn't connected properly, it will show empty data (a lot of FF FF FF... or 00 00 00...). The second one is simply to identify the chip and run in loop.<br />
<br />
Then I execute the batch file and let it run. While it's running, I try to touch and reconnect the wire connecting the chip to LPT, the capacitor and the battery until I get some reading on screen. The reading (dump data) might be useless, such as accidental shorting of some pin with another pin might show some garbage data on screen. To know whether the hardware works or not, you should see the chip identification. If the programmer identifies the chip correctly, then it should works. In my case it identifies as EN25F40.<br />
<br />
After fixing the hardware problem, I let the batch run for half a minute just to see if the hardware is stable. If the dump reading isn't changed, then you know the hardware is stable.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijal7uHjuZJD5JQbOT2gSZkOAeJfx_hyphenhyphenM73_UpdKuBDVI9O_eUThyphenhyphenHE6vLqE4s1R4IfdCCGBjzHfDzwbFCwQ5Fhw0_M_cWRsLCsLvToqu1HdkYvpaA6rvU9MVFhIaGSb6hz6tmfcAyMoCZ/s1600/20120725_100914.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijal7uHjuZJD5JQbOT2gSZkOAeJfx_hyphenhyphenM73_UpdKuBDVI9O_eUThyphenhyphenHE6vLqE4s1R4IfdCCGBjzHfDzwbFCwQ5Fhw0_M_cWRsLCsLvToqu1HdkYvpaA6rvU9MVFhIaGSb6hz6tmfcAyMoCZ/s320/20120725_100914.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The connection.</td></tr>
</tbody></table>
<br />
<h3>
4. Flashing</h3>
Before flashing, the chip needs to be unlocked and erased first. Run this command:<br />
> <span style="font-family: Courier New, Courier, monospace;">spipgmw /u</span><br />
> <span style="font-family: Courier New, Courier, monospace;">spipgmw /e</span><br />
<br />
The first one is to unlock the write protection bit. If the programmer complain "Status register is protected, you will need to set WP# high", you might need to check your connection again. Especially the connection on WP# pin (pin number 3). WP stands for write protect. You need to set it high, which means you need to apply some voltage to that pin. Make sure the power supply and capacitor is properly connected too.<br />
<br />
The second one is to erase the chip. It is required. The chip cannot be flashed when there is still data on it.<br />
<br />
After that, it's time to flash the chip with a new data. Obtain or make a file containing data to flash to the chip. I'm in a process of unbricking WM8650 tablet, so the file I used to flash is <a href="http://www.sendspace.com/file/ina4x8" target="_blank">WM8650a.bin</a> (Taken from <a href="http://www.techknow.t0xic.nl/forum/index.php?topic=261.0" target="_blank">techknow forum</a>). Then type:<br />
> <span style="font-family: Courier New, Courier, monospace;">spipgmw /p wm8650a.bin</span><br />
<br />
This will flash the files to the chip. Wait until finish. It should be finished in a minute or two or maybe less. The programmer will finish first before you finish to make some coffee/tea, maybe ;) Better make your coffee after finishing step 2.<br />
<br />
Then, you need to verify newly flashed data on the chip with the file you used to flash the chip. Type this:<br />
> <span style="font-family: Courier New, Courier, monospace;">spipgmw /v wm8650a.bin</span><br />
<br />
If the verify successful, you can safely put back the chip in its place and solder it to the board. If not, try erase and flash again. Make sure not to disturb the hardware while flashing.<br />
<br />
<h3>
5. Finish</h3>
When finished and all the data on chip has been verified successfully, I begin to desolder the wire from the chip and solder the chip back into the WM8650 daughter board. Then put proper ROM into sdcard and power the tablet. The tablet was alive again and its flashing a new ROM. Funnily enough, the tablet hasn't been untouched for about a week and while flashing, a warning appear and it tell me "Battery Low!" and the tablet immediately shut down. I got the feeling that the chip need to desolder back and reflashed. Fortunately, no. After plug in the charger and powered on the tablet, the tablet enter ROM Upgrade mode back and able finish it.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNazykcopDk0zTvs-RodeSCAhxlnBXolRSutGpJgcYKjVeLZ5f6zUHWOGyRcwnRAqMmBF0aErVZoZZ2nr0yCg52i9QsYo_I67FiFP8wMutpaEjMte2mWIe2p93GLH9s9mbX24KrDAFW109/s1600/solder+back.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNazykcopDk0zTvs-RodeSCAhxlnBXolRSutGpJgcYKjVeLZ5f6zUHWOGyRcwnRAqMmBF0aErVZoZZ2nr0yCg52i9QsYo_I67FiFP8wMutpaEjMte2mWIe2p93GLH9s9mbX24KrDAFW109/s320/solder+back.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Solder back the chip</td></tr>
</tbody></table>
<br />
<h3>
6. Note</h3>
If you are trying to unbrick the tablet, some people successfully flashed the chip without taking the chip out of the board. You might want to try this by solder the wire directly to the chip while its still connected to the board. I already tried without success.<br />
<br />
Here the picture of WM8650 after unbricking. The tablet is alive again. RSATK<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoGVdba06-wJXIKjQKfKxgNsoWAx4VpYdvsCcOPMEN5eYgFnG_5lp9Tgvh8O_btGzay4aDXVOyQqi5NSMgm2SG4Fj99oHgGgsOFLDCbq073KGrooYhnOX-_N4zph2gbk4zL1qfj9K3rMFX/s1600/wm8650+alive+after+unbrick.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoGVdba06-wJXIKjQKfKxgNsoWAx4VpYdvsCcOPMEN5eYgFnG_5lp9Tgvh8O_btGzay4aDXVOyQqi5NSMgm2SG4Fj99oHgGgsOFLDCbq073KGrooYhnOX-_N4zph2gbk4zL1qfj9K3rMFX/s400/wm8650+alive+after+unbrick.jpg" width="400" /></a></div>
<br />
<br />
Helpful Link:<br />
<br />
<a href="http://img840.imageshack.us/i/spipgmv2.gif/" target="_blank">http://img840.imageshack.us/i/spipgmv2.gif/</a> - Circuit diagram<br />
<a href="http://rayer.g6.cz/elektro/spipgm.htm" target="_blank">http://rayer.g6.cz/elektro/spipgm.htm</a> - Circuit diagram and blog<br />
<a href="http://rayer.g6.cz/programm/programe.htm#SPIPGM" target="_blank">http://rayer.g6.cz/programm/programe.htm#SPIPGM</a> - spipgm SPI Programmer download and FAQs<br />
<a href="http://www.techknow.t0xic.nl/forum/index.php?topic=261.0" target="_blank">http://www.techknow.t0xic.nl/forum/index.php?topic=261.0</a> - Debrick guide<br />
<br />
<a href="http://nn1.upanh.com/b4.s28.d2/f4ac7b14f00fa76eed2a98543796d1fd_46323571.spipgm25q80scp.jpg">http://nn1.upanh.com/b4.s28.d2/f4ac7b14f00fa76eed2a98543796d1fd_46323571.spipgm25q80scp.jpg</a> - A simple direct hardware by linhcentrioUnknownnoreply@blogger.com29tag:blogger.com,1999:blog-5131032816041063469.post-36504273627229332932012-07-23T01:27:00.000+08:002012-07-23T06:12:41.330+08:00Gravis Stinger Driver for Windows XP, Vista, 7<br />
Older things tend to get discarded and left unused. I found a gravis stinger gamepad on drawer which were belong to my little brother. It was a present from my father. Now it hasn't been used for many years. Things is, there is no proper driver for windows xp and 7.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgH4QjkVZQx4BB74og-vlD2Rt_2bcjG7rrhw7dVrW8q6u5G3-HeAYp3LUBjf-1r5NioQzzjkgrhsB65K3tlfytIhqO46H7V2Hg2Hr4olVAfaCUJrcdXoJ1Osv1mAayIod-HJPMkXR0HjJt/s1600/stinger-compat.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgH4QjkVZQx4BB74og-vlD2Rt_2bcjG7rrhw7dVrW8q6u5G3-HeAYp3LUBjf-1r5NioQzzjkgrhsB65K3tlfytIhqO46H7V2Hg2Hr4olVAfaCUJrcdXoJ1Osv1mAayIod-HJPMkXR0HjJt/s1600/stinger-compat.png" /></a></div>
<br />
<br />
Back on old days, gravis stinger costs as much as today's gamepad or joystick and perhaps more expensive. Today's there are plenty of game controller to choose from and cheaper. The old hardware was left unused.<br />
<a name='more'></a>I tried to make the driver myself. So I prepared everything, finding old serial header and plug the stinger. Windows detect the device, but there is no driver. Since this gamepad is using serial interface, it would be easy to make a user mode application that interact directly with the device without making a driver first. So, the first thing I should do is dumping the data sent from the device to my computer.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4Fc3QA__WUqeILOSnCcll88-upL3TjofWGqew2mnzch98lW06YD8zzKZqt7SUKvfeLFgz79VBbJufZeP241LlGlfEi0Vdku0vrPmgV93nxyGNpSgsPlask7OQO6BVkluaP8pShTzaAAA/s1600/dusty-computer-hot-plugging-serial-interface.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4Fc3QA__WUqeILOSnCcll88-upL3TjofWGqew2mnzch98lW06YD8zzKZqt7SUKvfeLFgz79VBbJufZeP241LlGlfEi0Vdku0vrPmgV93nxyGNpSgsPlask7OQO6BVkluaP8pShTzaAAA/s320/dusty-computer-hot-plugging-serial-interface.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Hot plugging the serial interface</td></tr>
</tbody></table>
<h3>
<span style="font-size: large;">1. Dumping</span></h3>
This should be easy, the first thing is to do is get the device to communicate with the windows. The first thing to do is to plug the device with compatible windows. The driver was made for windows 9x, so I choose to setup windows ME into a virtual machine. While installing WinME, Windows Installer asked me for a serial key. Oh no! I can't remember them. Fortunately I still remember the key but only after 3 trial.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6K91-quydvB7yRYk9NzuAyjq83zJKl1W8X_NAbPheOxDPQpndhrc5opZw_l2HuzFGPV4QKzRlPX0DgWSHvxZDgCQdOMyBncCZcFi-_6IVbiMvbPXQFcVdOfGCT7OTQIgrEog1vVZG2hbq/s1600/05+still+remember.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6K91-quydvB7yRYk9NzuAyjq83zJKl1W8X_NAbPheOxDPQpndhrc5opZw_l2HuzFGPV4QKzRlPX0DgWSHvxZDgCQdOMyBncCZcFi-_6IVbiMvbPXQFcVdOfGCT7OTQIgrEog1vVZG2hbq/s320/05+still+remember.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Wrong product key</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIcqTUz1I6bdHMlQ_KKJg-LIMR3QNuYSVfgifLCtK53CGSAkMMWGO8ScQMjxjmopxNAqGHLm26TQS_pGvLMn3jwq_4sDK0MEykGLK4cqGv2BEvLEpryc4MMpF5Os0xn1CD-gHlzoQR544Q/s1600/10+gravis.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="237" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIcqTUz1I6bdHMlQ_KKJg-LIMR3QNuYSVfgifLCtK53CGSAkMMWGO8ScQMjxjmopxNAqGHLm26TQS_pGvLMn3jwq_4sDK0MEykGLK4cqGv2BEvLEpryc4MMpF5Os0xn1CD-gHlzoQR544Q/s320/10+gravis.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">WinME Gravis Stinger driver detect</td></tr>
</tbody></table>
<br />
Then, I installed the driver that I took directly from stinger website archive and finally I installed <span style="background-color: white;">Eltima Serial Port Monitor and begin dumping by pressing all the gamepad button and moving around the thumbstick.</span><br />
<span style="background-color: white;"><br /></span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcXwWkr3uU-RtYH_oVE5IsC0QivlRLwptC9VBxkSe558VJCn5-oaF6uSGni2c8XWBSeWPWuItlMOqqedqTq5g4OqCPJlyZumrrfLO2oYlrqT_ZvAVKXTb6xTC5Uy1utctq4_X0P-HY4H_f/s1600/11+monitor.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcXwWkr3uU-RtYH_oVE5IsC0QivlRLwptC9VBxkSe558VJCn5-oaF6uSGni2c8XWBSeWPWuItlMOqqedqTq5g4OqCPJlyZumrrfLO2oYlrqT_ZvAVKXTb6xTC5Uy1utctq4_X0P-HY4H_f/s320/11+monitor.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Dumping with Eltima Serial Port Monitor</td></tr>
</tbody></table>
<span style="background-color: white;"><br /></span><br />
<h3>
<span style="background-color: white;"><span style="font-size: large;">2. Program a test driver</span></span></h3>
<span style="background-color: white;">After finished the dumping, the data needs to be understand. After gaining understanding about the data, then, I started a new VB.Net project to program a simple driver based on the dumped data. It was successful.</span><br />
<span style="background-color: white;"><br /></span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWSZyA43Qsqnlfq_eFdTzC1TqRp5cIAWa7nXqZEJ4h1U5XkNbBePLqiXEtziMtHtL_VpgqciaszfWLmlU2BNmggUwvRm_UvEzX6LjM_OfJyqpsKAI4iHVG_fs9eUMLqeSQSYUZh2Z44tP5/s1600/12+test.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWSZyA43Qsqnlfq_eFdTzC1TqRp5cIAWa7nXqZEJ4h1U5XkNbBePLqiXEtziMtHtL_VpgqciaszfWLmlU2BNmggUwvRm_UvEzX6LjM_OfJyqpsKAI4iHVG_fs9eUMLqeSQSYUZh2Z44tP5/s400/12+test.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">A test driver, the checkbox represent the pressed button on gravis, while the radio button represent the thumbstick location.</td></tr>
</tbody></table>
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;"><br /></span><br />
<h3>
<span style="background-color: white;"><span style="font-size: large;">3. Making the driver</span></span></h3>
<span style="background-color: white;">Well, this is a hard part. Instead of making the kernel driver from scratch, I remember a project called PPJoy. It was unfortunate that this driver was abandoned by the author. So I search again and found vJoy. It's in active development state, in fact the author did respond to me after replying to the forum just about some hours after posting there.</span><br />
<span style="background-color: white;"><br /></span><br />
<span style="background-color: white;">So, I chose vJoy and make a feeder that will feed the vJoy driver with input from the stinger. The vJoy will send back the input to the game.</span><br />
<span style="background-color: white;"><br /></span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_M0te9T3Int6jLqoiIN01t4bdhRvs-S5iQXeqc678sz3r_pKaBhS5P_s5H6lEtSI2G41ObJWJuNiZddptB67Fv2pDdZZDSnXxAPwJhVAG2dr5ZFRC8XK9343ssrvCyxLCKz2t_xgwQFd/s1600/gravis-stinger-windows7-driver.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_M0te9T3Int6jLqoiIN01t4bdhRvs-S5iQXeqc678sz3r_pKaBhS5P_s5H6lEtSI2G41ObJWJuNiZddptB67Fv2pDdZZDSnXxAPwJhVAG2dr5ZFRC8XK9343ssrvCyxLCKz2t_xgwQFd/s400/gravis-stinger-windows7-driver.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Gravis Stinger Windows XP,Vista,7,8 Driver</td></tr>
</tbody></table>
<span style="background-color: white;"><br /></span><br />
<h3>
<span style="background-color: white;"><span style="font-size: large;">4. Download</span></span></h3>
<span style="background-color: white;">Well, here the download link. I didn't bundle the vJoy with it as the driver is still unstable and causes BSOD while trying to standby. To install, follow this instruction carefully:</span><br />
<ol>
<li><a href="http://vjoystick.sourceforge.net/site/">Download vJoy</a> (Upon developing the feeder, I uses v2.0.1 - BSOD on standby)</li>
<li>Configure as follow (X, Y axis. 10 buttons using vJoyConf inside <a href="http://sourceforge.net/projects/vjoystick/files/Beta%202.x/2.0.1%20250712/vJoy2.0.1Apps.zip/download">vJoy2.0.1Apps package</a>)<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwN0CYdRjzK4KIVbI7NoPAZApgsfwiQSYs1llb6GXxqL_sDv10muLugwC3qJruq1VxNT1RBwt5wyyTsTUUqQvHU5R9dQNBSaYNkbbqAUlTsjtOYgaEWXzstyNphLx89_Qm6Ek8XCF_uWZU/s1600/configure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwN0CYdRjzK4KIVbI7NoPAZApgsfwiQSYs1llb6GXxqL_sDv10muLugwC3qJruq1VxNT1RBwt5wyyTsTUUqQvHU5R9dQNBSaYNkbbqAUlTsjtOYgaEWXzstyNphLx89_Qm6Ek8XCF_uWZU/s320/configure.png" width="251" /></a></li>
<li>Restart your computer. (or disable and re-enable the driver)</li>
<li>Download the <a href="http://www.mediafire.com/download.php?tsfr76ows9gavxv">Gravis Stinger Driver Feeder</a> and start it. (I will repack the driver later with proper configuration)</li>
<li>Choose the correct com port(where do you attach gravis stinger - default COM1) and press Start button.</li>
<li>Calibrate by clicking Joy Panel > Properties > Settings</li>
</ol>
<br />
Here a screenshot me playing the super mario with Gravis Stinger on Windows 7.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCNbLyuhawdAHBF8DZryPO0mthmdxVTNotOJMq8wTQPejP0EkbApU1tqqbtfRVBraxFVqH95gqZWnvljtTMGHbzABcYHw4AXTn7vnGRkvD1bN_rAsvORG3-a-7TNHUx9vycBN3_hwny1ht/s1600/demo.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="348" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCNbLyuhawdAHBF8DZryPO0mthmdxVTNotOJMq8wTQPejP0EkbApU1tqqbtfRVBraxFVqH95gqZWnvljtTMGHbzABcYHw4AXTn7vnGRkvD1bN_rAsvORG3-a-7TNHUx9vycBN3_hwny1ht/s640/demo.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Gravis Stinger Driver Feeder On Windows 7 Demo</td></tr>
</tbody></table>
<br class="Apple-interchange-newline" />Syahmi Azharhttp://www.blogger.com/profile/14781246766009267942noreply@blogger.com23tag:blogger.com,1999:blog-5131032816041063469.post-11939705109137637892012-07-22T23:15:00.001+08:002012-07-22T23:33:27.757+08:00Sending file through UDP Socket<b style="background-color: white; font-size: x-large;">Introduction</b><br />
<div style="text-align: left;">
</div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiftz7hBJzVfgsMnZEdcLB8KiU2zQxsIJk_4jOr-DmS7JOe3ohm635AbOkJ6x9GTF1JL9Rtgo9lVirkc37L241pR2WofVz8H6ojzSWQifdYoyHD5DbHN42Og4V4D8fIXtRnw4CwL1d0K7I/s1600/xcantik.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiftz7hBJzVfgsMnZEdcLB8KiU2zQxsIJk_4jOr-DmS7JOe3ohm635AbOkJ6x9GTF1JL9Rtgo9lVirkc37L241pR2WofVz8H6ojzSWQifdYoyHD5DbHN42Og4V4D8fIXtRnw4CwL1d0K7I/s200/xcantik.png" width="200" /></a>(THIS is a repost, <a href="http://dnxgroup.blogspot.com/2011/12/sending-file-through-udp-socket.html">original post can be found on DNX Group blog</a>)<br />
User Datagram Protocol or UDP is a simple protocol. This protocol is unreliable - when a data packet is sent, it cannot be not known if it will reach its destination or not. There is no acknowledgement, retransmission, or timeout. When multiple data is sent at once, the order which they arrive cannot be predicted. They might be out of order. The data that is sent with sequence 1,2,3 might be recieved as 2,3,1. So, sending files through UDP socket is a bit difficult.<br />
<br />
<a name='more'></a><br />
<br />
Normally in a realtime game such as FPS, UDP protocol is used to send player location and behaviour. This data will be send continuously to provide a realtime player action to other player. But when the data is not arrived, the data will be skipped without retransmission so that the gameplay will be realtime, and not delayed. When sending files, a new protocol must be constructed as the file data must be sent completely. It cannot be skipped as it will corrupt the file.<br />
<br />
<span class="Apple-style-span" style="font-size: large;"><b>About This Project</b></span><br />
This is a simple project to demonstrate sending a file through UDP Socket. The code here might not perfect and may contains several flaws and bugs which might prevent the file from being sent perfectly.<br />
<br />
<a href="http://www.mediafire.com/?ouc216vhvamtbtp" target="_blank">Download Project file + Demo</a><br />
<br />
<span class="Apple-style-span" style="font-size: large;"><b>UDP</b></span><br />
To start this project, a simple UDP socket class must be constructed to assists sending and receiving data packet through UDP socket. This class will be named CSockUDP and will contain this method:<br />
<pre class="brush: cpp">class CSockUDP
{
public:
static int InitWinsock();
static void DestroyWinsock();
void SetCallback(cbDataRecieved fnRecieved);
int CreateSocket(int nPort = 31313);
void StartListen();
void StopListen();
bool SetServerAddress(char* szServer, int nPort);
int SendData(LPVOID lpData, int nSize);
int ResendData();
}<span class="Apple-style-span" style="font-family: 'Times New Roman';"><span class="Apple-style-span" style="white-space: normal;"></span></span></pre>
<br />
<span class="Apple-style-span" style="background-color: #fff2cc; font-family: monospace; white-space: pre;">InitWinsock()</span> and <span class="Apple-style-span" style="background-color: #fff2cc; font-family: monospace; white-space: pre;">DestroyWinsock()</span> is a call to WinsockAPI to initiates and stop the use of Winsock Dll. It must be called on very early when the program is started and on the very end before the program terminated.<br />
<br />
A call to <span class="Apple-style-span" style="background-color: #fff2cc; font-family: monospace; white-space: pre;">CreateSocket()</span> will create a new UDP socket and assign it with a port number. Then, <span class="Apple-style-span" style="background-color: #fff2cc; font-family: monospace; white-space: pre;">SetCallback()</span> is called to set receive event function. <span class="Apple-style-span" style="background-color: #fff2cc; font-family: monospace; white-space: pre;">StartListen()</span> will create a new thread which will executes a loop code and listen for any incoming data. Other method is self explanation.<br />
<br />
----<br />
<br />
To send files through UDP socket, firstly a protocol must be constructed. Every data packet that is sent must have some sort of acknowledgement and identification so the receiver can understand what is it and what should it do. We can start by creating a data header followed by the data itself.<br />
<br />
<pre class="brush: cpp">struct TUDPHeader
{
char szID[3]; // 'IKH' - unique id
DWORD dwCRC32; // Checksum of Data
char type; // eDataType
int nLength; // Data length
// Data (TUDPFileHeader/TUDPFileReply/TUDPFileTransfer)
};</pre>
Inside this header, <span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">szID</span> is an identification. It will contain unique data, "IKH" in this case and send it to the receiver. When the receiver read the data and found that the first 3 bytes is equal to "IKH", it will continue read the packet but when it different, the packet will simply be skipped as it might come from other software that is also sending a data to the same port.<br />
<br />
<span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">dwCRC32</span> will contain a data checksum (not including <span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">TUDPHeader</span>). The sender will calculate the data checksum and fill <span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">dwCRC32</span> with it. When it arrives at destination, the receiver will calculate the data checksum again and compare it with <span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">dwCRC32</span>. If the checksum calculated by receiver differ from what is sent by sender, it will indicates that the data is corrupted or altered before its reach its destination. If this happen, the receiver will request that the data must be sent back again.<br />
<br />
type explains to the receiver what must it do with the data.<br />
<br />
<pre class="brush: cpp">enum eDataType
{
eDataTypeConnect, // ping
eDataTypeConnected, // Reply if server got connect message
eDataTypeResend, // Corrupted data, request for resend
eDataTypeQuit, // Exit the program, client and server
eDataTypeFileHeader, // TUDPFileHeader
eDataTypeFileTransfer, // TUDPFileTransfer
eDataTypeFileReplyAccept, // Accept the file send request
eDataTypeFileReplyReject, // Denied the file send request
eDataTypeFileReplyOK, // Proceed to next stream
eDataTypeFileReplyFinish // Finished transfer
};
</pre>
<br />
Lastly inside this header (<span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">TUDPHeader</span>), is <span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">nLength</span>. <span class="Apple-style-span" style="background-color: #d9ead3; font-family: monospace; white-space: pre;">nLength </span>will tell how big is the data sent by sender. Without it, the receiver does not know when the data end.<br />
<br />
----<br />
<br />
When a file is being sent, a packet is constructed from <span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">TUDPHeader</span> followed by <span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">TUDPFileHeader</span>. It will send a file name followed by size of the file in bytes.<br />
<br />
<pre class="brush: cpp">struct TUDPFileHeader
{
char szFileName[128];
int nFileSize;
};</pre>
<br />
After that, receiver will reply either to accept the file or reject it like we can see in <span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">eDataType</span>, <span class="Apple-style-span" style="font-family: monospace; white-space: pre;"><span class="Apple-style-span" style="background-color: #cfe2f3;">eDataTypeFileReplyAccept</span>/</span><span class="Apple-style-span" style="font-family: monospace; white-space: pre;"><span class="Apple-style-span" style="background-color: #cfe2f3;">eDataTypeFileReplyReject</span>. </span>If the file is accepted, the receiver will create a new file and the sender will immediately send the file data using <span class="Apple-style-span" style="font-family: monospace; white-space: pre;">TUDPFileTransfer </span>which contain file offset, data size and the file data itself.<br />
<br />
<pre class="brush: cpp">struct TUDPFileTransfer
{
int nFileOffset;
int nLength;
char szData[2048];
};</pre>
<br />
The receiver then writes the newly created file with the data its received in <span class="Apple-style-span" style="background-color: #fce5cd; font-family: monospace; white-space: pre;">TUDPFileTransfer</span> until the file completed.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgskrBwT-mJslQGN8xJGPAQ5WB5GuQaSkIPXL0XGPXkYogNzeY42fdTiuUYbUyO38gQK6K246xq1NHyi0tDxwqcBfC1TfcUqGExxctqBh0vqE1YEKj6FYQJcgtICjTXgN3iWFZcJivE3qc/s1600/TUDPHeaderTUDPFileHeader.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="198" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgskrBwT-mJslQGN8xJGPAQ5WB5GuQaSkIPXL0XGPXkYogNzeY42fdTiuUYbUyO38gQK6K246xq1NHyi0tDxwqcBfC1TfcUqGExxctqBh0vqE1YEKj6FYQJcgtICjTXgN3iWFZcJivE3qc/s400/TUDPHeaderTUDPFileHeader.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 13px;">Example of sending data packet with TUDPHeader + TUDPFileHeader<br />
<div>
<br /></div>
</td></tr>
</tbody></table>
Artikel ini juga boleh didapati dalam Bahasa Melayu: <a href="http://dnxgroup.blogspot.com/2011/11/menghantar-file-menggunakan-soket-udp.html">Klik disini</a>Syahmi Azharhttp://www.blogger.com/profile/14781246766009267942noreply@blogger.com12tag:blogger.com,1999:blog-5131032816041063469.post-41608895781478514252012-07-22T23:08:00.000+08:002012-07-22T23:12:03.376+08:00New Blog Template<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSKQv79WZT2SyHNdqRrn-RovG8V_ILJMXV_8nbnCJu5M3l3wyZWo_UQQ4CszS-wBuQvvDhTzvxJgvd5m-rTC3tkwYB0uCKVsCwBKMCvX2aLbG_oMHn_0ElMxpJTxvtSArykjtIuYj5Sb32/s1600/rodster.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="244" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSKQv79WZT2SyHNdqRrn-RovG8V_ILJMXV_8nbnCJu5M3l3wyZWo_UQQ4CszS-wBuQvvDhTzvxJgvd5m-rTC3tkwYB0uCKVsCwBKMCvX2aLbG_oMHn_0ElMxpJTxvtSArykjtIuYj5Sb32/s320/rodster.png" width="320" /></a></div>
<br />
I changed a new blog template. This one looks better. Maybe. I've been looking for HTML5 blogger template, but none could I found interesting.<br />
<a name='more'></a>Template name is <a href="http://btemplates.com/2012/blogger-template-rodster/">Rodster which can be found on BTemplate</a>. Previously, I used Ethereal blue template which has cool blue background but this templates uses white background that might not be so easy on the eye, especially if you have bright monitor. Another changes, I removed facebook comment box. There is no use to have multiple comment box. Also, there is search box on top right corner. It might looks like header title on a container, but its actually a textbox.Syahmi Azharhttp://www.blogger.com/profile/14781246766009267942noreply@blogger.com16tag:blogger.com,1999:blog-5131032816041063469.post-48435271408025240712012-07-14T02:17:00.003+08:002012-07-14T02:23:40.539+08:00Using modem/router as a TTL Serial cableHi all,<br />
<br />
Ok here the story. I have another bricked unknown WM8650 android tablet given to me for repair. According to the tutorial found on some forum, first I need to check if the bootloader is still alive or already dead by using serial interface. So I get my Nokia DKU5 cable which were previously showing dead/damaged USB devices symptom - "USB Devices not Recognized" and plug it into my computer hoping that the cable will be detected by windows. Unfortunately windows does not detect it and show the error instead.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis7nDpB5_dG2eso7HoxSSQIkmldDtOGEyE94anngCQwS9of3cNXpEDO64IB7PsWuCLOpG22-0IEBlaQcxYsjHbv4pnXjDYmH5oCPII9aO6G4MxBOfITQJIkN8WBjQ1cKM4bgrhW5wQDmzi/s1600/usb-device-not-recognized.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis7nDpB5_dG2eso7HoxSSQIkmldDtOGEyE94anngCQwS9of3cNXpEDO64IB7PsWuCLOpG22-0IEBlaQcxYsjHbv4pnXjDYmH5oCPII9aO6G4MxBOfITQJIkN8WBjQ1cKM4bgrhW5wQDmzi/s320/usb-device-not-recognized.jpg" width="311" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<a name='more'></a><br />
<br />
<br /><br />
I have another serial cable, but its USB to RS232 Serial cable. A counterfeit china made USB to RS232 cable! Why?! I already know this cable uses prolific chip inside. The manufacturer of the cable gives old driver on their site, but I want to use latest driver as I experienced some BSODs previously back in 2010/2011 with old driver. So I browsed the prolific website and notices red text that said "<a href="http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=155&pcid=41"><span style="color: red;">Warning Letter on Counterfeit Products</span></a>". I don't care and still I downloaded the latest driver from prolific website get them installed on my laptop. When I plug in the USB cable, the drivers install. Unfortunately, it shows as devices not started (Error Code - 10). So I began to reinstall, restarting and trying other driver from prolific website, still same. The device cannot start. Then I remember the red text. I opened the pdf files that comes with the driver and in there its already mentioned that the counterfeit product will show symptom that the device cannot start.<br />
<br /><br />
I get angry at both, why there is people making a counterfeit product? Why prolific? why can't just allow the driver to start? Instead of using old driver I began disassemble the driver, find the counterfeit detection and rewrite the jump, sign the driver and reinstall them and the error went away.<br />
<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLjeSOotqiyak9Mqctu5z_HjdESgRqtBricbxCPHPLYTLGYBE_ifyY2ngdH42ErfI6nTiyMZsGo8xVk9QIuIhAK4FaB7N5ilsrtwwuP4Qq9EV07QikHoNsP09ZzXsegJz9etSwoZztctkL/s1600/fakechip.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="58" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLjeSOotqiyak9Mqctu5z_HjdESgRqtBricbxCPHPLYTLGYBE_ifyY2ngdH42ErfI6nTiyMZsGo8xVk9QIuIhAK4FaB7N5ilsrtwwuP4Qq9EV07QikHoNsP09ZzXsegJz9etSwoZztctkL/s400/fakechip.png" width="400" /></a></div>
<br /><br />
OK, enough of side story.<br />
<br /><br />
Before I can connect this USB-RS232 cable to the tablet, I need some kind of converter, RS232 to TTL converter. So I googled around and found some random schematics on the internet, do some kind of reading about signal differences between them and while preparing the parts, hey... what about using router serial interface instead?!<br />
<br />
I have two unused router, Billion Bipac 5112S (No wireless) which were replaced by D-Link DSL2640T (with routertech firmware) and then replaced again with TP-Link (because it has wireless N). So I opened these routers to expose their internal circuitry and attach jumpers between these routers. The ground pin is connected to each other while the transmit and receive TX/RX pin were crossed so when the other devices is transmitting data via TX, the other devices will received through RX and vice versa.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMq47VvYIWHGcQzzExTug_1DSQO_kCEjVFxMVrTNliYnLd4RUBqu4xKHsL0vwAWlgHXXzDpctYYjBzufBSkJ4akaS8oxie3JHcNDHwEfQziC30I1RC6wn5BXnTueHpcwerzqepWrCyZ9uQ/s1600/connection-pinout.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMq47VvYIWHGcQzzExTug_1DSQO_kCEjVFxMVrTNliYnLd4RUBqu4xKHsL0vwAWlgHXXzDpctYYjBzufBSkJ4akaS8oxie3JHcNDHwEfQziC30I1RC6wn5BXnTueHpcwerzqepWrCyZ9uQ/s320/connection-pinout.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjys9URuC8HaUoAP-RPqxImH9EBkRWuu8Zy3RiGZvaLyx1MmU189a8MjkHXvVaXgd0QRFjR0fnBwbwkfhX-SR_bmXHj8k2WBZWenynswp51rTvlpv-4GIq-8Fd00m3Wxyw3QvcT9jai9xBe/s1600/mess-connection.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjys9URuC8HaUoAP-RPqxImH9EBkRWuu8Zy3RiGZvaLyx1MmU189a8MjkHXvVaXgd0QRFjR0fnBwbwkfhX-SR_bmXHj8k2WBZWenynswp51rTvlpv-4GIq-8Fd00m3Wxyw3QvcT9jai9xBe/s320/mess-connection.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
I powered up my dlink router and connecting my laptop to the router through wireless and then I opened putty and login to my router as root and issuing some command:<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;;">cat /dev/tty</span></blockquote>
Then I switch on my Bipac router, nothing on screen... Changed the jumper connection on bipac, maybe I connect the TX/RX/GND to the wrong pin. Then I tried again, still nothing on screen - just black with blinking cursor. Then I issued some other command<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">ls /dev</span><br />
(I tried on each device i found interesting, and it turned out to be <span style="font-family: 'Courier New', Courier, monospace;">/dev/console</span>)</blockquote>
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">cat /dev/console</span></blockquote>
Then I turned on the bipac router back, now I have some egyptian-alien hieroglyph coming out on my screen. It must be baud rate mismatch. So I issue another command to change the baud rate:<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">stty -F /dev/console speed 115200 -cstopb -parenb</span></blockquote>
Turned off and back on the router, I finally have something that not gibberish on screen. So, I have the screen output, how about sending command back to bipac router? By echoing the command to /dev/console like this: echo the_command_to_send > /dev/console<br />
I was able to send the command to bipac router. But it's not comfortable, as I need to open two putty windows, one for view the bipac router output while the other one to send command.<br />
<br /><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8N0h5r8hHQAJUMDZNcBPKmbRNfJ78cS2QMEjDzXObddoh_cIIITIbXbX1vcIwCMI0xLDHEtNVDcbIcoML9sy7wYfDUc4Aq2EAS5YyGMH4tSGX2dURDsUM-JphJ2wbR_KnDr_U374HO0B/s1600/00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8N0h5r8hHQAJUMDZNcBPKmbRNfJ78cS2QMEjDzXObddoh_cIIITIbXbX1vcIwCMI0xLDHEtNVDcbIcoML9sy7wYfDUc4Aq2EAS5YyGMH4tSGX2dURDsUM-JphJ2wbR_KnDr_U374HO0B/s640/00.png" width="640" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0gzBvM2e4hzhTogVeJ5VwdSX0O3KMbGRGyG-TP6i5KIr3DbRq2X0wOemhNAKMzsNaQPFwF6z-yvdLld2OJ1mogEAU7vvt7LTAJQSQtVYvzvRxEZDOH5_4ShNTGwnyTR6aRVGTGb7MAHq0/s1600/01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0gzBvM2e4hzhTogVeJ5VwdSX0O3KMbGRGyG-TP6i5KIr3DbRq2X0wOemhNAKMzsNaQPFwF6z-yvdLld2OJ1mogEAU7vvt7LTAJQSQtVYvzvRxEZDOH5_4ShNTGwnyTR6aRVGTGb7MAHq0/s400/01.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /><br />
<br /><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuMA1zWm2PskVrrcubhEfrEL0ectcuMTzi_Yglf2ksTVr60bAhYJGL97_Bbb-Pnp9kepjEfRLj9n-BNqbEajVVXwvmgXcLvtFy3w3FsJrgC_Lb8xlgJq85BCCQdmANbBgv3qC6J-fFpsbk/s1600/06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuMA1zWm2PskVrrcubhEfrEL0ectcuMTzi_Yglf2ksTVr60bAhYJGL97_Bbb-Pnp9kepjEfRLj9n-BNqbEajVVXwvmgXcLvtFy3w3FsJrgC_Lb8xlgJq85BCCQdmANbBgv3qC6J-fFpsbk/s640/06.png" width="640" /></a></div>
<br /><br />
<br />
So I search something and found netcat and then ser2net. I recompiled this both for my dlink router and upload them to my router using WinSCP. Everything is uploaded to /tmp/ folder. Here the two programs available to download:<br />
<br />
<ul>
<li>netcat - Can forward device output to another devices. (Will upload later)</li>
<li><a href="http://www.mediafire.com/download.php?ira5i6b22lz3bqe">ser2net - A Serial to Network Proxy so you can access the serial interface using your computer.</a></li>
</ul>
<br />
<br />
To use ser2net, a config file is needed, so I made a config file as follow and start the program:<br />
<blockquote class="tr_bq">
<span style="font-family: 'Courier New', Courier, monospace;">echo 43:telnet:10:/dev/console:115200 NONE 1STOPBIT 8DATABITS XONXOFF>/tmp/ser.conf<br /><br />./ser2net -n -d -c /tmp/ser.conf</span></blockquote>
Now I have a wireless TTL Serial cable, I can send command 100 meters away without wire constraint within my laptop.Unknownnoreply@blogger.com15tag:blogger.com,1999:blog-5131032816041063469.post-70273587336454016982012-06-19T15:12:00.001+08:002012-06-19T17:11:03.570+08:00MyTime v1.0.60Good <PUT_YOUR_TIME_HERE> everybody. This is my first post on 2012 :)<br />
Here is my latest project, MyTime and this is the first initial public release - v1.0.60<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjkaBHVH7EzPtXjYrV43BEv515bUUfD2h1e4euv2pu0k7dzhRvlgH8QTpMwguPI3JINgwtfoUiRzFLN6bQgGa0fy2zaFMIlwSILWA-73QI115d52vpepZKgsA2XstlCP6pCtnHG5s8aAII/s1600/showscreenshot1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjkaBHVH7EzPtXjYrV43BEv515bUUfD2h1e4euv2pu0k7dzhRvlgH8QTpMwguPI3JINgwtfoUiRzFLN6bQgGa0fy2zaFMIlwSILWA-73QI115d52vpepZKgsA2XstlCP6pCtnHG5s8aAII/s320/showscreenshot1.jpg" width="320" /></a></div>
<br />
<br />
<span style="font-size: large;"><b>What is MyTime?</b></span><br />
MyTime is a reminder software, a PIM (Personal Information Manager) software and is suitable for home or office use. You can use it to store reminder, tasks, contacts and notes. You can even play music with it as its include music playlist.<br />
<a name='more'></a><br />
<b>Features:</b><br />
- Reminder<br />
- Tasks/To-do lists<br />
- Notes<br />
- Contacts<br />
- Music<br />
- Notice<br />
<br />
You might familiar with all this feature MyTime has, but what about notice? what is notice?<br />
<br />
- Notice is a feature developed to enable user to send notices to other MyTime user on the same network. :)<br />
So upon launching this application for the first time, you might get some firewall dialog to allow or block the use of network function for this software. It's depend on you to enable or disable this feature.<br />
<br />
<b>Grab it here:</b><br />
- <a href="http://www.mediafire.com/?39x4z3zf969qu">http://www.mediafire.com/?39x4z3zf969qu</a><br />
<br />
<b>Requirements:</b><br />
- Windows XP and above.Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-5131032816041063469.post-69881084824168053472011-06-29T19:42:00.001+08:002011-07-01T12:16:39.793+08:00Android Market: Unsuccessful DownloadHave you ever got this message "Unsuccessful Download" when downloading from Android Market? Well, one day I tried to download something from android market and got this message from android tablet which I bought recently.<br />
<br />
After some reading and found nothing, and looking at my tablet I realize that my tablet time and date reset and go back to 1977 due to empty battery. So...<br />
<br />
<b>The solutions is:</b> Make sure your date is set correctly. Then try again download some apps from market.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-5131032816041063469.post-44950269358395069732011-04-07T01:42:00.025+08:002011-04-07T02:27:21.821+08:00How to start program/game without explorer.exe<span style="font-size: 130%; font-weight: bold;">Introduction</span><br />
First of all, this is just a random tutorial.<br />
Sometimes while using your computer, your explorer may unexpectedly crash. This usually caused by explorer extension or something else. For example, winamp shell extension or WinRAR Shell Integration crashed and since it sits on explorer.exe, it will crash its parent process too. When explorer crash, it usually restart itself automatically, but sometimes, it won't start and you need to start it manually either by restarting your computer or using task manager to create a new task.<br />
<br />
<a name='more'></a><br />
<br />
<span style="font-size: 130%; font-weight: bold;">Run</span><br />
To start a program, you need some kind of launcher to do so. Windows has its own launcher called Run. To start Run, you must press this combination <span style="font-weight: bold;">WIN+R</span> on your keyboard. Look at your keyboard and find a key that have a windows symbol on it. Press and hold it and then press R button.<br />
<br />
Unfortunately this methods only work if you have running explorer.exe because the key combination is handled by the explorer. So what you must do to start the program?<br />
<br />
<span style="font-size: 130%; font-weight: bold;">Task Manager</span><br />
Task manager is a windows tools to view, monitor and manage task or applications that is currently running on your computer. Task manager also provide a launcher to run the applications you want. To start Task Manager, simply press this combination: <span style="font-weight: bold;">CTRL+SHIFT+ESC</span> or <span style="font-weight: bold;">CTRL+ALT+DEL</span>, both combination will work unless you got this message <span style="color: red;">"Task manager has been disabled by the administrator"</span>. If you got this message, then there is no way to start task manager unless you enable it back. This tutorial will not touch on how to enabled the task manager.<br />
<br />
Next step is to create a new task. Click <span style="font-weight: bold;">file</span> menu and select <span style="font-weight: bold;">New Task</span>. Click <span style="font-weight: bold;">browse</span> and choose what application you want to open. If you want to start explorer.exe, browse to Windows\explorer.exe or simply type in the text box "explorer.exe".<br />
<br />
<span style="font-size: 130%; font-weight: bold;">Other trick</span><br />
If you still stuck and cannot use explorer, run, start task manager, then there is still another trick that will enable you to run program.<br />
<br />
First trick is to run accessibility tools called <span style="font-weight: bold;">sticky key</span>. By pressing <span style="font-weight: bold;">SHIFT five times rapidly</span>, you will hear a beep sound and a dialog will appear. (Assuming you are running windows 7) From there, click "Go to the ease of Access Center to disable the keyboard shortcut". You will be redirected to ease of Access Center. The Access Center look familiar enough like when you opening folder or My Computer. From there, just type any location you want to go inside the address bar. Assuming you wanted to go to C:\ you must type C:\ into the address bar and press enter. Now you are on C:\ and you can browse your local drive.<br />
<br />
Now you know how to run any program without explorer.exe. There is still other way, I will update this article if I find other way.Syahmi Azharhttp://www.blogger.com/profile/14781246766009267942noreply@blogger.com4tag:blogger.com,1999:blog-5131032816041063469.post-68427840738164559282011-04-05T21:16:00.003+08:002011-04-07T02:25:18.884+08:00GDI DDRAW SDLI'm going to learn gdi, DirectDraw and sdl... I want to make a dll wrapper that will wrap all DirectDraw call and use SDL instead.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-5131032816041063469.post-67883961746750494602011-03-28T14:48:00.004+08:002011-03-28T21:30:47.313+08:00fsredir v1.1.0<b>Updated fsredir to v1.1.0</b><br />
Hi all, I finally managed to update fsredir driver. There is issue with previous version which is file/folder will be duplicated when both target and source folder contain same file name. The fix is very easy but tracing other minor issue is not.<br />
<br />
Since this driver is loaded on each volume, I added a feature to enable only certain drive and implement new configuration file parser. This feature can be changed by modifying fsredir.marker.<br />
<br />
<a name='more'></a><br />
<br />
Hopefully this changes will fix everything, but I didn't fully test the driver myself as I'm on my laptop now with limited resources, so if you found any issue and bug, please report it.<br />
<br />
<b>Changes include:</b><br />
- Fixed duplicated file/folder entry<br />
- New configuration file format<br />
- Some minor fix <br />
<br />
<b>Configuration file:</b><br />
<blockquote><span style="font-family: "Courier New",Courier,monospace;">root=\fsredir</span><br />
<span style="font-family: "Courier New",Courier,monospace;">EnabledDrive=C:;X:</span></blockquote>Root - Path where files or folder will be redirected. Place quotes around path name if it contain spaces.<br />
EnabledDrive - You can enabled only selected drive, for multiple drive separate each drive by semicolon "<b>;</b>" like example above.<br />
<br />
<b>Download:</b><br />
<a href="http://www.fileserve.com/file/azGFwJd">[fsredir_x86_v110.zip]</a> <a href="http://www.mediafire.com/?xz1g0ml70qucvmg">[mirror]</a>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-5131032816041063469.post-18589205550426129192011-03-25T03:49:00.009+08:002023-10-21T18:45:09.675+08:00Virtual Orchestra Studio + Music Pack<div style="text-align: left;"><span style="font-size: large;"><b>Update 2023 <br /></b></span></div><div style="text-align: left;"><p>Download: <a href="http://www.mediafire.com/?z4hcf1urfarom">[mediafire mirror]</a></p><p>Win10+ Fix: Download and put ddraw.dll in game directory. <a href="https://github.com/narzoul/DDrawCompat/releases">https://github.com/narzoul/DDrawCompat/releases</a><br /></p></div><p><span style="font-size: large;"><b>Introduction </b></span><br />
If you like music, piano or rythm game, then try Virtual Orchestra Studio - a free game created by the koreans. This game, like <a href="http://www.synthesiagame.com/">synthesia</a> is based on midi technology. With VOS, you can practice your hand, finger and mind altogether. This is some review about Virtual Orchestra Studio. You can download for free below which include music/song pack.<br />
<br />
</p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNrghj5-V-DQk23hQrRu4RDo_GunroXSqpDB1LkJCmEH83kdJeUNkTKEGfpqjaspM92nopL8p_VBe09WrxLqh7xjyKmrdHwGwVb77HeQF1GbILuRlklDbHFNl6ukkgzEZYDptPniJETh-O/s1600/e0001342_08070812.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNrghj5-V-DQk23hQrRu4RDo_GunroXSqpDB1LkJCmEH83kdJeUNkTKEGfpqjaspM92nopL8p_VBe09WrxLqh7xjyKmrdHwGwVb77HeQF1GbILuRlklDbHFNl6ukkgzEZYDptPniJETh-O/s320/e0001342_08070812.jpg" width="320" /></a></div><br />
<span style="font-size: large;"><b></b></span><br />
<a name='more'></a><span style="font-size: large;"><b>The Game</b></span><br />
You will be able to choose song and character you like. The character you choose will affect your eyes when playing as each character will use different background color. I like Jail character as when playing, it will give you nice calm blue background which enable you to focus. The other character available to choose are Rock (purple), Bit - a robot or drone (cyan), Flanka - a slime monster (green slime), Simpson (gray), P.L.O (blue-gray), Franken (pink), and Rucy (blue).<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_Xc-Ak1AG0dsrw9gvYVM1VB5NAZ57f5cwXb1eyaoOP1AQdseYyHuVVYoYiFzqroATdlR3dhvOPrvAJ_GH_caDBNYyqV0-dK9vmnyhzCK_oujcGmoxes97TBupkIhTTLbAYXlAj0UkbYz-/s1600/aaa.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_Xc-Ak1AG0dsrw9gvYVM1VB5NAZ57f5cwXb1eyaoOP1AQdseYyHuVVYoYiFzqroATdlR3dhvOPrvAJ_GH_caDBNYyqV0-dK9vmnyhzCK_oujcGmoxes97TBupkIhTTLbAYXlAj0UkbYz-/s320/aaa.jpg" width="320" /></a></div>This game consists of 7 different note that will fall down and reach the blue line you must press the corresponding key at the exact moment when the note is still in the blue line. Each time you hit the key as the note fall into the blue line, a score will be given. The score vary if you missed, make a mistake such as pressing key twice (fault), or if you pressed too fast before the note could reach the bottom or too slow (good).<br />
The default key for each note is A (do), S (re), C (mi), Space (fa), M (so), L (la) ; (si). The key can be configured to something else, my preference is A S D Space J K L.<br />
<br />
It's been a long time since I played O2Jam and I forgot much about that game. So this might not be correct... In O2Jam, when the note reach to its position, whether we pressed the corresponding key or not, press the wrong key, the music is still the same. There is no variation in music instrument too. In Virtual Orchestra Studio, you can change the instrument before playing as you like by pressing arrow button. When you are making a mistake, such as pressing the note multiple time, the note itself will playing multiple time. If you missed, the note will not be played at all.<br />
I believe that other cannot determine whether you played properly or not in O2Jam but in VOS, other may laugh at you, if you play improperly.<br />
<br />
<span style="font-size: large;"><b>The Music</b></span> <br />
There are many different music category that you can choose from which is Century End, Classic, For Beginners, Game and Anime, Jazz, New Age, Other, Pop, Rock, SoundTrack, Techno and World Pop.<br />
Each different category contains music that you can choose. With my music pack, there will be two additional category which I get from various source and you can choose approximately 1000+ song.<br />
<br />
The game uses custom format .VOS which basically a midi file with note arrangement. This game also support <a href="http://en.wikipedia.org/wiki/Be-Music_Script">Be-Music Script</a> file (.bms) developed by <a href="http://www.sun-inet.or.jp/%7Eyaneurao/bm98/bmsformat.html">Urao Yane</a>. If you are looking for some bms file, you can search on <a href="http://www.google.com/">google engine</a> or any other search engine. Perhaps when looking for bms files, you will find out that most of the link seems to be dead or outdated. In this case, you can use <a href="http://web.archive.org/">web.archive.org</a> to get the old website content and download from there.<br />
<br />
<span style="font-size: large;"><b>Vos Creator</b></span><br />
Since the game is midi based, you can easily convert any of your favorite midi file to VOS format by launching Vos Creator. You can choose and select which note you want to be available in the game. The arrangement is done by the Vos itself, so nothing you can do about it. When opening Vos Creator, there will be two side and a vertical scrollbar on the center. The left-side is the available note, and the right side is the view in the game. You can select which note to be available in game on the left side. You also can right-click on the note to toggle note length.<br />
<br />
The Vos Creator is included in the package as a zip file. You need to extract it first before using it.<br />
<br />
<span style="font-size: large;"><b>The Game Creator</b></span><br />
The game is made by HanseulSoft Inc. Opening the credits menu reveal that they are only a small group that make this great game. It appears that they use their nickname such as Strider, lilith, 2loopers, HappyChild and etc in the credits. Their website <a href="http://www.voshall.com/">www.voshall.com</a> appears to be redirected to <a href="http://fashionvos.com/">fashionvos.com</a> when writing this review. I didn't check what is FashionVos yet as it is in korea language, but it seems to be music like game too with fashion?<br />
<br />
<span style="font-size: large;"><b>Download</b></span><br />
The game can be downloaded <a href="http://www.fileserve.com/file/DKkGUye/Virtual%20Orchestra%20Studio.zip">[here]</a> or in <a href="http://www.mediafire.com/?z4hcf1urfarom">[mediafire mirror]</a>, it doesn't included any installer. So you just need to extract and launch vos.exe<br />
If you run this game on windows 7 or vista, be sure the read this <a href="http://write-code.blogspot.com/2011/03/solving-old-games-graphics-problem-on.html">[blog entry]</a> too.<br />
If you would like to beat someone, then there is <a href="http://www.fileserve.com/file/JyTfved/Virtual%20Orchestra%20Studio%20-%20Score.zip">[scoretable]</a> containing my score as well as others. Simply extract into the VOS folder.<br />
<br />
Don't forget to play this game with your family and friends.Unknownnoreply@blogger.com28tag:blogger.com,1999:blog-5131032816041063469.post-9318280082089769772011-03-25T02:05:00.012+08:002011-04-04T14:58:08.915+08:00Solving old games graphics problem on Windows 7 and Vista<span style="font-size: large;"><b>Introduction </b></span><br />
Old popular games such as Age of Empires, Starcraft, Worms and Diablo that runs on windows 7 and vista is suffering palette problem which caused the game graphics color messed, color problem, palette stolen, etc. <br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjKmwfnQru6h9MvsaTrlhWPoytl2XSqF-gHDtSyA_07S0ThhY0Ccg-SVbExl7jIiGZAnjo6FWWeVWf9VeqBZSgXZwEKVsV1MTNh_97JHDlf5AmJxB1mOLwbuROatrer_cRhg_tnwG7Fnk/s1600/vos.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBjKmwfnQru6h9MvsaTrlhWPoytl2XSqF-gHDtSyA_07S0ThhY0Ccg-SVbExl7jIiGZAnjo6FWWeVWf9VeqBZSgXZwEKVsV1MTNh_97JHDlf5AmJxB1mOLwbuROatrer_cRhg_tnwG7Fnk/s320/vos.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">VOS - Color messed (rainbow) and it's not black actually.</td><td class="tr-caption" style="text-align: center;"><br />
</td><td class="tr-caption" style="text-align: center;"><br />
</td></tr>
</tbody></table>Recently, I wanted to play some old game and one of them are <a href="http://write-code.blogspot.com/2011/03/virtual-orchestra-studio-music-pack.html">Virtual Orchestra Studio</a>, the color messed but doesn't influence the game. I played normally without doing any trick or methods that solve the color issue. Suddenly, one day while playing Virtual Orchestra Studio, the color that supposed to be blue turned white and almost the entire screen turned bright including background!<br />
Because the game is about pressing the key at the right moment and since I cannot see the note fall because the note and the background looks the same. It make me think to write some tools to solve this issue because almost all people talk about the solution to this problems is to terminate explorer.exe and then start the game, but I don't like this method.<br />
<br />
<span style="font-size: large;"><b></b></span><br />
<a name='more'></a><span style="font-size: large;"><b>The Issue</b></span><br />
After googling around, I found interesting statement about what caused the problem here: <a href="http://forums.bf2s.com/viewtopic.php?pid=2898635#p2898635">http://forums.bf2s.com/viewtopic.php?pid=2898635#p2898635</a> which says:<br />
"The game colours get all messed up<br />
<br />
This happens when another application is stealing W:A's palette. W:A logs such occurrences to the file "palette.log" in your W:A folder. If you can, try closing the programs listed there.<br />
<br />
Often it's a component of Windows itself that's stealing W:A's palette (usually csrss.exe)."<br />
The problem is that windows application is stealing the palette.<br />
<br />
<span style="font-size: large;"><b>Idea Arrive</b></span><br />
My first idea is to write a tools that will find the application that steal the palette and suspend it. <b>Suspending</b> will cause some <b>side effects</b> such as when explorer.exe steal the palette, you <b>will not be able to ALT+TAB to minimize</b> the game. So instead of suspending it, I want to hook the process to change its behavior to not touching the palette when the game is running. Since I don't know much about graphics I begin googling and found existing tools, methods and solution to fix the problem on this site: <a href="http://blog.macuyiko.com/2009/07/solving-color-problem-red-grass-purple.html">http://blog.macuyiko.com/2009/07/solving-color-problem-red-grass-purple.html</a><br />
<br />
<span style="font-size: large;"><b>Methods and Solution:</b></span><br />
There are various methods and solution explained at macuyiko's blog. I will list some only, if you want to see the complete list, go <a href="http://blog.macuyiko.com/2009/07/solving-color-problem-red-grass-purple.html">[here]</a><br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRk7b0dqSrt2H1NpVoeOwPJ9MncJw1lj6RU0Ut4_oHMOxfWhWw_ozJQ069KWG-pezD6L6olixK80kcNeyCRkjXvbw9zJzGTKeeilp7PEWOBn42iQ7Zu-GCBtOLT5-vefk6pAv_gVc751GA/s1600/startmenu.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRk7b0dqSrt2H1NpVoeOwPJ9MncJw1lj6RU0Ut4_oHMOxfWhWw_ozJQ069KWG-pezD6L6olixK80kcNeyCRkjXvbw9zJzGTKeeilp7PEWOBn42iQ7Zu-GCBtOLT5-vefk6pAv_gVc751GA/s200/startmenu.png" width="165" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Exit Explorer</td></tr>
</tbody></table>1) The famous terminate explorer.exe:<br />
<ul><li>Killing explorer.exe isn't my option and it doesn't feel safe for me. But there is other way to close the explorer gently and start the game.</li>
<li>First make sure you can start task manager by pressing CTRL+SHIFT+ESC (directly open the task manager) or CTRL+ALT+DEL (I don't like this combination since it will bring you to the lock screen).</li>
<li>Then open start menu and press <b>CTRL+SHIFT</b>, then <b>right-click </b>to any empty area on your start menu and select <b>Exit Explorer</b>.</li>
<li>Back to your task manager, select File and choose <b>New Task</b>. Browse your game executable and click <b>OK</b>.</li>
<li>If you want to get the explorer back, type explorer.exe in New Task.</li>
</ul><br />
2) The strange screen resolution method:<br />
<ul><li>First, right-click at any empty desktop area to bring out the menu, select <b>Screen Resolution</b> and click <b>advance settings</b>.</li>
<li>Another windows will be opened, now you need to click <b>monitor tab</b> and leave it open. Run the game.</li>
<li>This is strange solution but works.</li>
</ul><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidp4GTR5m1HpZoiXzHdFJzTTH7StIYmmSuO8MYHgRzk-nFO-pA4wc3qxnk6rrg_7CUIAqsnAwDrHo48Vqs8UFZhuH1BDH0boxouPQuCv40HY-_oJveDoNRyJUDVsGzBmrtzMiLCxTKs_qw/s1600/screen-res-monitor-tab.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="171" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidp4GTR5m1HpZoiXzHdFJzTTH7StIYmmSuO8MYHgRzk-nFO-pA4wc3qxnk6rrg_7CUIAqsnAwDrHo48Vqs8UFZhuH1BDH0boxouPQuCv40HY-_oJveDoNRyJUDVsGzBmrtzMiLCxTKs_qw/s320/screen-res-monitor-tab.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">3-Steps Screen Resolution method</td></tr>
</tbody></table><br />
3) Jari Komppa's DirectDraw hack:<br />
<ul><li>This method will use Jari Komppa's DirectDraw hack, a direct draw dll that wraps direct draw calls and redirect them to OpenGL. I was never successfully try this method as I only have one old direct draw game on current laptop installed and the game crashes when using this method. My assumption is that not all direct draw call is implemented yet.</li>
<li>First, download Jari Komppa's ddraw hack <a href="http://sol.gfxile.net/ddhack/">[here]</a>, select <a href="http://sol.gfxile.net/zip/ddhack10.zip">[ddhack10.zip]</a></li>
<li>Extract and place them in your game executable folder and then run the game.</li>
<li>If you don't know your executable game folder, right-click on game shortcut and choose <b>Open File Location</b>.</li>
</ul><br />
4) Compatibility hack:<br />
<ul><li>This is a tool created by Mudlord. It will add game exe into registry entry to enable compatibility mode.</li>
<li>You can download the tool <a href="http://mudlord.hcs64.com/code/w7ddpatcher.zip">[here]</a> or <a href="http://static.macuyiko.com/files/w7ddpatcher/w7ddpatcher.zip">[here]</a> (mirrored by <a href="http://blog.macuyiko.com/">[Seppe Vanden]</a> as original source seems to be down).</li>
<li>Extract and run the tools and then select patch.</li>
<li>Select your game executable and wait for the patching process begin. The game will be start and terminate immediately as the application tried to grab the process identifier.</li>
<li><b>Note:</b> This tools will not patch your executables, but it will add some entry in registry. No file will be harmed and touched.</li>
<li><b>Update:</b> Unfortunately, this method works only for few minutes for me.</li>
</ul><br />
So far, I like to use solution number 2 and 4. If I'm not lazy enough, I will create a tool that will hook windows explorer. Why bother to create a tool when there is already enough tools available? Simply because, I will release the source code too and you can learn from it.Unknownnoreply@blogger.com58tag:blogger.com,1999:blog-5131032816041063469.post-17487206014339647782011-03-16T09:41:00.002+08:002012-07-22T23:19:08.694+08:00Making passcode application in C#This is a tutorial making a simple passcode application in C#<br />
Video tutorial is included :) <br />
<br />
<div style="color: #0b5394;">
<b>Requirements:</b></div>
<ul>
<li>Visual Studio with C#</li>
<li>Basic knowledge of C# and Programming </li>
</ul>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi53Oap3-60iViA_f2PZ8aRO4Nojgk9j-hjyZPUPDLP8iAthBIYfuu9plWg_iJBR8jm8YOjdC6Q6T13Jd8jb9CaDffOaMOXIcTTGLuTyXKBV8HonpgdG_vhuaQxbBylxdYhkGU7ihLpK4n/s1600/Passcode+%2528Time+0_00_23%253B27%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi53Oap3-60iViA_f2PZ8aRO4Nojgk9j-hjyZPUPDLP8iAthBIYfuu9plWg_iJBR8jm8YOjdC6Q6T13Jd8jb9CaDffOaMOXIcTTGLuTyXKBV8HonpgdG_vhuaQxbBylxdYhkGU7ihLpK4n/s320/Passcode+%2528Time+0_00_23%253B27%2529.png" width="320" /></a><span style="font-size: large;"><b>Quick step-by-step:</b></span><br />
<br />
<span style="font-size: large;"><b><span style="color: #0b5394; font-size: small;">Step 1: Create a new project</span></b></span><br />
<ul>
<li>Start <b>Microsoft Visual Studio 2010</b></li>
<li>In Menu, click <b>File</b> - <b>New</b> - <b>Project</b></li>
<li>Select <b>Visual C#</b></li>
<li>Select <b>Windows Form Applications</b></li>
<li>Name your project, eg. <b><span style="color: #38761d;">Passcode</span></b></li>
<li>Click OK</li>
</ul>
<br />
<a name='more'></a><br />
<br />
<div style="color: #0b5394;">
<b>Step 2: Designing your form</b></div>
<ul><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg39735YpqpkvRzfN3mIisR_5n6AP5_DjjToWW6RNSkADmrqGMo4N9qaBTGB1DTBbfzqeWYzf8oSClnp3073QF2uUS88cPqixzrMhH2qd03xEabVo8e-8nHLplu_IzCwpQE4-uRm-PF1EiG/s1600/Passcode+%2528Time+0_01_32%253B22%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg39735YpqpkvRzfN3mIisR_5n6AP5_DjjToWW6RNSkADmrqGMo4N9qaBTGB1DTBbfzqeWYzf8oSClnp3073QF2uUS88cPqixzrMhH2qd03xEabVo8e-8nHLplu_IzCwpQE4-uRm-PF1EiG/s320/Passcode+%2528Time+0_01_32%253B22%2529.png" width="320" /></a>
<li>Begin designing your form by opening the <b>Toolbox</b></li>
<li>Your passcode application will have a textbox, numeric button, clear button and enter button.</li>
<li>Textbox will display entered passcode, numeric button (0,1,2,3 - 9) is for the user to click, clear button is to clear the entered passcode and enter button to check the passcode entered.</li>
<li>Double-Click or Drag Drop the textbox from toolbox to the form</li>
<ul>
<li>Resize the textbox accordingly</li>
<li>You may want to change the text style and size for this textbox. Right-click on the textbox and click Properties. Change the Font value.</li>
<li>Rename this textbox, eg. <b><span style="color: #274e13;">txtPass</span></b>. Right-click the textbox and change the value of (Name)</li>
</ul>
<li>Now, add a button</li>
<ul><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLymxfWo0gWV9N6SJVgBJxbzXNynHqld6erTz5s15L7ZtMCfTb-j98KbBvZhIXMCVEXXOge7TsAB_4Zq-uu3IKBYlx1jN9y_hrEPurXexFdTaB2yNGaI1dwWG-iKvXx6iufZxeur6m0nZO/s1600/Passcode+%2528Time+0_04_15%253B19%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLymxfWo0gWV9N6SJVgBJxbzXNynHqld6erTz5s15L7ZtMCfTb-j98KbBvZhIXMCVEXXOge7TsAB_4Zq-uu3IKBYlx1jN9y_hrEPurXexFdTaB2yNGaI1dwWG-iKvXx6iufZxeur6m0nZO/s200/Passcode+%2528Time+0_04_15%253B19%2529.png" width="200" /></a>
<li>Resize and change font styles.</li>
<li>Change the button text, on Properties, change the value of text to "<b>1</b>" (without quotes)</li>
<li>Optional: Rename the button, eg. <b style="color: #274e13;">btn1</b></li>
<li>Repeat the same step for other numeric button, Clear button and Enter button</li>
</ul>
<li> Resize and decorate your form</li>
</ul>
<br />
<div style="color: #0b5394;">
<b>Step 3: Code your application</b></div>
<ul>
<li>Code the numeric button event, double-click the first button which is 1</li>
<ul>
<li>Automatic code will be created for the button click event</li>
<li>Add this code:</li>
<ul>
<li style="font-family: "Courier New",Courier,monospace; font-size: x-small;"><span style="font-size: small;">txtPass.Text = txtPass.Text + <span style="color: #990000;">"1"</span>;</span><br />
</li>
</ul>
<li>txtPass refer to the textbox you named earlier.</li>
<li>the code simply append a number 1 (string) to the textbox without deleting previous text</li>
<li>Repeat the same code for other numeric button</li>
</ul>
<li>Code the Clear button, double-click the Clear button.</li>
<ul><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyzeVNLGOO00W9zL8DN-lbvoOax9H9PDaU0joQGngLOM0FeJUkBiMOgzvIHN12Usq34Z6twlEelRljrZLnabsUc3jXCOX6Fdi3YXel2JCuZJvliCLn8fC-j-CUnfkeYxNsEIcNWSPEfPI9/s1600/Passcode+%2528Time+0_06_28%253B21%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyzeVNLGOO00W9zL8DN-lbvoOax9H9PDaU0joQGngLOM0FeJUkBiMOgzvIHN12Usq34Z6twlEelRljrZLnabsUc3jXCOX6Fdi3YXel2JCuZJvliCLn8fC-j-CUnfkeYxNsEIcNWSPEfPI9/s200/Passcode+%2528Time+0_06_28%253B21%2529.png" width="200" /></a>
<li>Automatic code will be created</li>
<li>Add this code:</li>
<ul>
<li style="font-family: "Courier New",Courier,monospace; font-size: x-small;"><span style="font-size: small;">txtPass.Text = <span style="color: #990000;">""</span>;</span><br />
</li>
</ul>
<li>This code will simply replace the textbox with an empty string</li>
</ul>
<li>Code the Enter button, double-click the Enter button</li>
<ul>
<li>Add this code:</li>
<ul>
<li style="font-family: "Courier New",Courier,monospace; font-size: x-small;"><span style="font-size: small;"><span style="color: blue;">if</span> (txtPass.Text == <span style="color: #990000;">"12345"</span>)<br />
{</span> <span style="font-size: small; margin-left: 40px;">txtPass.Text = <span style="color: #990000;">"Passed"</span>;</span><span style="font-size: small;"><br />
}<br />
<span style="color: blue;">else</span><br />
{</span> <span style="font-size: small; margin-left: 40px;">txtPass.Text = <span style="color: #990000;">"Wrong Passcode! Please try again"</span>;</span><span style="font-size: small;"><br />
}</span><br />
</li>
</ul>
<li>This code compares the text entered in txtPass with the string value 12345</li>
<li>If txtPass equals to 12345, it then replaced the text in txtPass to "Passed". You can change eg. letting the user into the application after passcode entered correctly</li>
<li>Vice-versa for entering wrong passcode combination</li>
</ul>
</ul>
<br />
<div style="color: #0b5394;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5eVJOdd89hzT4-oI3q16Q-F4S-tqhGg9GmOpCSGAaC9C8WBLnN-MvHaGMgB4R9_ILlUwnxW35zuC-Q0SKSNsGnot0kyQ3bX6MvdMMhXrJAoyfG1V9zJGC-u0xjrcF_jzfKbhMYBuUo3XQ/s1600/Passcode+%2528Time+0_09_14%253B00%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5eVJOdd89hzT4-oI3q16Q-F4S-tqhGg9GmOpCSGAaC9C8WBLnN-MvHaGMgB4R9_ILlUwnxW35zuC-Q0SKSNsGnot0kyQ3bX6MvdMMhXrJAoyfG1V9zJGC-u0xjrcF_jzfKbhMYBuUo3XQ/s200/Passcode+%2528Time+0_09_14%253B00%2529.png" width="200" /></a></div>
<b> Step 4: Test your passcode application</b></div>
<ul>
<li>To run your application, click on Debug - Start without debugging</li>
<li>The application will start and try to enter some value</li>
<li>Finish! :)</li>
</ul>
<br />
<div style="color: #0b5394;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy6jiKSQpa-X35mkF-0bVbsZ4HtFTnAUkhXsDftz1Spo2ra8ppdLBXOJ6j3Ljvw0S6AiR5Qsb3kf4vUyDQtnA_aq1dkpssgQ47GvrtD13e9EiobVoqCiSUlplW-WA7xTj7PR0wwQ-psROC/s1600/Passcode+%2528Time+0_10_52%253B22%2529.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="149" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy6jiKSQpa-X35mkF-0bVbsZ4HtFTnAUkhXsDftz1Spo2ra8ppdLBXOJ6j3Ljvw0S6AiR5Qsb3kf4vUyDQtnA_aq1dkpssgQ47GvrtD13e9EiobVoqCiSUlplW-WA7xTj7PR0wwQ-psROC/s200/Passcode+%2528Time+0_10_52%253B22%2529.png" width="200" /></a></div>
<b>Step 5: Automatic exit after entered incorrectly 3 times</b></div>
<ul>
<li>Go back to the code.</li>
<li>Go to the top, where you can find class text</li>
<li>Add this variable code under the class:</li>
<ul style="font-family: "Courier New",Courier,monospace;">
<li><span style="font-size: small;"><span style="color: blue;">int</span> nTry = 0;</span></li>
</ul>
<li>The reason to add the variable here is because the variable value will retain until the application exit</li>
<li>Now, go back to the Enter button code:</li>
<li>Change to:</li>
<ul><ul>
<li style="font-family: "Courier New",Courier,monospace; font-size: x-small;"><span style="font-size: small;"><span style="color: blue;">if</span> (txtPass.Text == <span style="color: #990000;">"12345"</span>)<br />
{</span> <span style="font-size: small; margin-left: 40px;">txtPass.Text = <span style="color: #990000;">"Passed"</span>;</span><span style="font-size: small;"><br />
}<br />
<span style="color: blue;">else</span><br />
{</span> <span style="font-size: small; margin-left: 40px;">txtPass.Text = <span style="color: #990000;">"Wrong Passcode! Please try again"</span>;</span><span style="font-size: small;"><br />
</span> <span style="font-size: small; margin-left: 40px;">nTry++;</span><span style="font-size: small;"><br />
</span> <span style="font-size: small; margin-left: 40px;"><span style="color: blue;">if</span> (nTry == 3)</span><span style="font-size: small;"><br />
</span> <span style="font-size: small; margin-left: 40px;">{</span><span style="font-size: small;"><br />
</span> <span style="font-size: small; margin-left: 80px;">Application.Exit();</span><span style="font-size: small;"><br />
</span> <span style="font-size: small; margin-left: 40px;">} </span><span style="font-size: small;"><br />
}</span><br />
<br />
<span style="margin-left: 40px;"></span><br />
</li>
</ul>
<li>nTry will be incremented each time you entered wrong passcode combination</li>
<li>If the value of nTry is equal to 3, then the Application.Exit() will be executed.</li>
</ul>
<li>Done! Test again with wrong passcode. Enter it three times and see your application will exit itself.</li>
</ul>
<br />
See the video tutorial here:<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/DU0ncWWc9N0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<b style="color: red;">Note:</b> Since this is a simple passcode application, the security of the application is too weak and <b>some</b> people will find out the real passcode easily.<br />
<ul><ul></ul>
</ul>Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-5131032816041063469.post-43688771882018417722011-03-01T11:20:00.004+08:002011-03-29T01:08:09.649+08:00CHDK for Canon Powershot A495<span style="font-size: large;"><b></b></span><br />
Last year, I ported CHDK to Canon Powershot A495, which can be found here: <a href="http://chdk.setepontos.com/index.php?topic=5570.0">http://chdk.setepontos.com/index.php?topic=5570.0</a><br />
But didn't have much time. If anybody interested to continue my work, you can see and get git repository here: <a href="http://gitorious.org/canon-powershot-a495-chdk/canon-powershot-a495-chdk/trees/master">http://gitorious.org/canon-powershot-a495-chdk/canon-powershot-a495-chdk/trees/master</a><br />
<br />
<span style="font-size: large;"><b>Introduction:</b></span><br />
After bought new camera - Canon a495, I'm looking for firmware for this camera model to see anything updated. But unfortunately I didn't found any. After looking hard, I found CHDK which stands for Canon Hack Development Kit for Canon camera. They didn't support a495 camera model, so I began reading porting guide, open arm disassembler and begin porting it using firmware 100d dumped by fvdk.<br />
<br />
After half of the port done, I begin dumping myself and realize that my camera has 100f firmware. :-S :S :S :-S.... :|<br />
c.c :'(<br />
So, I left 100d and begin porting 100f and release beta version. The 100d version is still on git repository, incomplete and half-way done. I might continue to port this, or not... If I have time to spend.<br />
<br />
<span style="font-size: large;"><b>Firmware download:</b></span><br />
Beta 1 - <a href="http://www.fileserve.com/file/QuNZNd2">a495-100f-0.9.9-Syahmi-full.zip</a><br />
Beta 2 - <a href="http://www.fileserve.com/file/wSEfekG">a495-100f-0.9.9-957-full_beta2.zip</a><br />
<br />
<span style="font-size: large;"><b>Some Photos: </b></span><br />
Some photo is taken from alpha release and some from beta release. All this photo taken during the development.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21q-xtQX56DV7oyPPJj3dRhoReYFjsYln1fdCn-aGmyQOrVu46Vs5C9vPxKf5CkWGdiwYpM0TqxmTsWYItWSXI3YV80Cs-PkuPh6L03oABDZRy9EryJzVE38aT9PeMcqU76iby4nFW6Mo/s1600/33644_1664813942819_1311375017_31775566_6899317_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21q-xtQX56DV7oyPPJj3dRhoReYFjsYln1fdCn-aGmyQOrVu46Vs5C9vPxKf5CkWGdiwYpM0TqxmTsWYItWSXI3YV80Cs-PkuPh6L03oABDZRy9EryJzVE38aT9PeMcqU76iby4nFW6Mo/s320/33644_1664813942819_1311375017_31775566_6899317_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">CHDK Script Menu</td></tr>
</tbody></table><div class="separator" style="clear: both; text-align: center;"></div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVJ6jDTEEBQlqK_1anRN1lphoAGykeaW8GomI-34K3C9q2s59JVY5UIAcoZHG1_9UNYnn1n11dV4WSpsE1UpVZETY2naejlFbvq5-oVpx3c3LxE8m2j4VDlrUqt7sO4KTXcdRa1RNE7MvF/s1600/67219_1664811582760_1311375017_31775557_7465824_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVJ6jDTEEBQlqK_1anRN1lphoAGykeaW8GomI-34K3C9q2s59JVY5UIAcoZHG1_9UNYnn1n11dV4WSpsE1UpVZETY2naejlFbvq5-oVpx3c3LxE8m2j4VDlrUqt7sO4KTXcdRa1RNE7MvF/s320/67219_1664811582760_1311375017_31775557_7465824_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sokoban Games on a495</td></tr>
</tbody></table><br />
<a name='more'></a><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvQt4Eu_sh_n96bbAi10GAxlLq7qx_3kODAYssyB9whCylVopz6TKqdcrBrvTi91mVsLMHXyKI20v9v13eHXVwvWyRrHJCsbk7Od3n1vVMkgPwqusJhOY_hfJe_qgF9wNXqb-BNQCVEPGD/s1600/67538_1664816942894_1311375017_31775579_6331517_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvQt4Eu_sh_n96bbAi10GAxlLq7qx_3kODAYssyB9whCylVopz6TKqdcrBrvTi91mVsLMHXyKI20v9v13eHXVwvWyRrHJCsbk7Od3n1vVMkgPwqusJhOY_hfJe_qgF9wNXqb-BNQCVEPGD/s320/67538_1664816942894_1311375017_31775579_6331517_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Canon a495</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNt6dngoryq0I2MUCXP3_-xkarYhsqlb0pQbiayGN3l33ZnhPF-GdYruV5hIXWeSfFo1wnujrwqmIRspgCVUVfTLU4YrRkVexqW3fy1q8jnCcjL4rxV7rMuzPFKTt42U4hCvcjWSxIa65B/s1600/71977_1664811022746_1311375017_31775555_357215_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNt6dngoryq0I2MUCXP3_-xkarYhsqlb0pQbiayGN3l33ZnhPF-GdYruV5hIXWeSfFo1wnujrwqmIRspgCVUVfTLU4YrRkVexqW3fy1q8jnCcjL4rxV7rMuzPFKTt42U4hCvcjWSxIa65B/s320/71977_1664811022746_1311375017_31775555_357215_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">CHDK Main Menu</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE-KpxoHqYsmDHDTpEGv4avIVC3p0k6cdUEvHAvVcWFz446WYk2YSh60WkovmwVKXJNOc06-wuv0RlG_qAwggaiWPVv8lsPU6ESCY4T2yIFR-FF0tC9djStWZVn1rqyOolUkpsekNApsdq/s1600/73204_1664814902843_1311375017_31775570_693513_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhE-KpxoHqYsmDHDTpEGv4avIVC3p0k6cdUEvHAvVcWFz446WYk2YSh60WkovmwVKXJNOc06-wuv0RlG_qAwggaiWPVv8lsPU6ESCY4T2yIFR-FF0tC9djStWZVn1rqyOolUkpsekNApsdq/s320/73204_1664814902843_1311375017_31775570_693513_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Outline</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuKUzDj6QikS0mFJjUD0Vt2zceBVsRZ-G-dah0G8A3jknKmEw97MTMrzIh7joZNLO7jcmEyRbv_9GqX0NZWkSSyW0ips4dm8d6SeGK0Ryfgs724ng-1SpChPoMdIgcUbpiz07B6idusq9q/s1600/73537_1664813222801_1311375017_31775563_1928881_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuKUzDj6QikS0mFJjUD0Vt2zceBVsRZ-G-dah0G8A3jknKmEw97MTMrzIh7joZNLO7jcmEyRbv_9GqX0NZWkSSyW0ips4dm8d6SeGK0Ryfgs724ng-1SpChPoMdIgcUbpiz07B6idusq9q/s320/73537_1664813222801_1311375017_31775563_1928881_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Zebra On - Overexposure</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJQfCCrV204On5EIEs9Z0P6_ply7vEVXezty3Oe1zkcPwT9HZW6GNIrypXCgSxiY2X1VC-RVysXqSgAOO4xkPscIDtMP3nX5a6KIkudwS3mjy3ObO3FDyR3XsuNTWnlcSqLYU18i6FMNKe/s1600/73780_1664815022846_1311375017_31775571_3410164_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJQfCCrV204On5EIEs9Z0P6_ply7vEVXezty3Oe1zkcPwT9HZW6GNIrypXCgSxiY2X1VC-RVysXqSgAOO4xkPscIDtMP3nX5a6KIkudwS3mjy3ObO3FDyR3XsuNTWnlcSqLYU18i6FMNKe/s320/73780_1664815022846_1311375017_31775571_3410164_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">File Browser in a495</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkigjAYEkzqGmHRo9ac42BxacNlQ7LHA9Zw3dyhCkPJGj7H-RYJPQV0eUeBmloL21KcQpb8G84O4SWWIH-Czs8Q7jHFicArswDS77tEwlf8ZCWxMziES2yOslmxHd9jFPny_yZbytPMnH7/s1600/74423_1664812822791_1311375017_31775562_8019802_n.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkigjAYEkzqGmHRo9ac42BxacNlQ7LHA9Zw3dyhCkPJGj7H-RYJPQV0eUeBmloL21KcQpb8G84O4SWWIH-Czs8Q7jHFicArswDS77tEwlf8ZCWxMziES2yOslmxHd9jFPny_yZbytPMnH7/s320/74423_1664812822791_1311375017_31775562_8019802_n.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Histogram</td></tr>
</tbody></table><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4wt41Bn_ug1m6obdrqgccDD0ueDjfW66PRzn1sgBMKI7xzX48ECTnbqPTo8qrKgdg1Gv7Idcoa5sz6FdOs9cGGh_0xj89x7pUIkd_LXycV7QaqdxhbIHc3J90TnmwQKlSXzFE7jbW219z/s1600/zw3zsrzw.bmp" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="191" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4wt41Bn_ug1m6obdrqgccDD0ueDjfW66PRzn1sgBMKI7xzX48ECTnbqPTo8qrKgdg1Gv7Idcoa5sz6FdOs9cGGh_0xj89x7pUIkd_LXycV7QaqdxhbIHc3J90TnmwQKlSXzFE7jbW219z/s320/zw3zsrzw.bmp" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">CHDK splash screen from alpha version</td></tr>
</tbody></table>Unknownnoreply@blogger.com6tag:blogger.com,1999:blog-5131032816041063469.post-35245271473064974382011-03-01T11:00:00.004+08:002012-08-11T16:27:37.549+08:00Unbricking Gome/Fake FlyTouch Android tablet<span style="font-size: large;"><b>Update2:</b></span><br />
See this post too: <a href="http://write-code.blogspot.com/2012/08/parallel-port-spi-flash-programmer-and-unbrick-wm8650.html">http://write-code.blogspot.com/2012/08/parallel-port-spi-flash-programmer-and-unbrick-wm8650.html</a><span style="font-size: large;"><b><br /></b></span>
<span style="font-size: large;"><b>Update:</b></span> <br />
This blog post about total bricked Fake Flytouch - bootloader failed to start. If the devices turned on, the Blue LED will lit but the screen will remain black.<br />
If you flash the wrong firmware, it might not fully bricked. Try to flash with new firmware, see comment post for the download link.<br />
<br />
<span style="font-size: large;"><b>Introduction:</b></span><br />
I bricked Gome/Fake? FlyTouch when upgrade its firmware by accidentally removing microSD card when upgrading w-load/u-boot in process. I don't know the exact name as the device itself doesn't have anything written on it except MID written on box.<br />
It looks exactly like in this post: <a href="http://www.androidtablets.net/forum/gome-flytouch/1411-help-detecting-model-device-2-6-29-00236-g4f8dbbb-dirty.html#post8372">http://www.androidtablets.net/forum/gome-flytouch/1411-help-detecting-model-device-2-6-29-00236-g4f8dbbb-dirty.html#post8372</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs328.ash2/60867_437950417948_579882948_5282024_7818959_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="http://sphotos.ak.fbcdn.net/hphotos-ak-ash2/hs328.ash2/60867_437950417948_579882948_5282024_7818959_n.jpg" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Reading through this <a href="http://www.slatedroid.com/index.php?/topic/5668-re-programing-spi-serial-flash-on-cpu-daughtercard-de-bricking/">thread</a>, i found an interesting post about using <b>LPT or Parallel port </b>to reflash the bootloader IC using <a href="http://rayer.ic.cz/elektro/spipgm.htm">SPIPGM</a> by Martin Rehak/RayeR. The SPIPGM can be found here: <a href="http://rayer.ic.cz/programm/programm.htm#SPIPGM">http://rayer.ic.cz/programm/programm.htm#SPIPGM</a><br />
<br />
<a name='more'></a><br />
<br />
So, I begin disassemble FlyTouch by following this youtube video: <br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/z26uxS2W2nc?feature=player_embedded' frameborder='0'></iframe></div>
<br />
Then, I take out the cpu daughter board and begin identifying the chip needed to desolder. The chips have marking <a href="http://www.alldatasheet.com/datasheet-pdf/pdf/207640/EON/EN25F40.html">F40-100GCP</a> (You can see the picture below). I just use a soldering iron and a solder suction as I don't have anything like hot-air station/solder wick. Before desolder, I use some kind of heatsink to protect the IC from being damaged by excessive solder heat.<br />
<br />
The result<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://www.blogger.com/goog_1119880417" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqIg9F-W379QVJ0SADx8tu4-Ia0QDMaBFTQXq66VhzoWxp98uBrkBKlKJmZY4EeFaD_can6rT9NDY9OzAa_hb5z0khp8mwUYl39lfBeMInyQrmd3thJZuwG3QcvEkoOxnYxisKpwwvBhMM/s320/IMG_2294.JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
As you can see, I damaged the PCB! PCB traces peeled off. So if you want to desolder, make sure not to apply too much heat on the PCB.<br />
<br />
Then, I start wiring the IC to the LPT according to the circuit diagram posted on RayeR's website: <a href="http://rayer.ic.cz/elektro/spipgm/spipgm.gif">http://rayer.ic.cz/elektro/spipgm/spipgm.gif</a><br />
<br />
<br />
Then, launch spipgmw.exe /i to identify the chip but it wont recognize and show parity Error. I recheck the connection, change the resistor and capacitor... then tried again... still no. After few days struggle with this, I found out bad connection between the chips and wire. So I changed by soldering the chips and use alligator clips instead.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpY8qX5KQCro8A6ovFXPiZ2UhnnU-fxO2_WmJ8uW7nueLiyfuduistKRH4XsVMZojPA1qJfWRcPUIdcS74SOqTGhOKm_90g3Fnnazx4MtKSMTC4GuCqD4Kkyi0id4Qzjms4zAFRelxcRxM/s1600/IMG_2286.JPG" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpY8qX5KQCro8A6ovFXPiZ2UhnnU-fxO2_WmJ8uW7nueLiyfuduistKRH4XsVMZojPA1qJfWRcPUIdcS74SOqTGhOKm_90g3Fnnazx4MtKSMTC4GuCqD4Kkyi0id4Qzjms4zAFRelxcRxM/s320/IMG_2286.JPG" width="320" /></a> <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOgtE6LDvrun8h9TSkdRvJ8k0A1Vj32KEdvccuAZmEC30Cj8dyW-_1RcdqVnFKFPwwifziSkYACgE-lp5Mg7JOAUaRQW2SS-yqtUCOjSAjft4S-AeO5knyBkqoLwQROMGJ1SUvXwD7ZJGv/s1600/IMG_2288.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOgtE6LDvrun8h9TSkdRvJ8k0A1Vj32KEdvccuAZmEC30Cj8dyW-_1RcdqVnFKFPwwifziSkYACgE-lp5Mg7JOAUaRQW2SS-yqtUCOjSAjft4S-AeO5knyBkqoLwQROMGJ1SUvXwD7ZJGv/s320/IMG_2288.JPG" width="320" /></a></div>
<br />
The chips identified as EON EN25F40!, Then I tried to dump the SPI Flash by using this command<br />
spipgmw.exe /d dump.bin<br />
<br />
...<br />
Dump successful!<br />
<br />
Finally, it's time to reflash the chip. So, I made out my own binary file by combining w-load and u-boot and flash it into the chip (I cannot remember where I put the file, but you can get from <a href="http://www.beyondlogic.org/wp/4Mb_spi_flash.zip">here</a>, not made by me). Before flash, it is important to erase it first.<br />
spipgmw.exe /e<br />
spipgmw.exe /p 4mb.bin<br />
<br />
Then, I solder it back with new hope, Insert SD Card with new firmware and android boot!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0sGwBB8UWkip8inFCF4i1RjOWoXo56OoGqbc6-URZdqai-PSGmAEeNdoGzPCx2G-WTfFQQR0Tj370FPVcaYJNN0yoWy68YHSBwcejXeYPTmAAgp4iGWNHV3mwbdhs8fM0tJD0XBxkVZt-/s1600/IMG_2299.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0sGwBB8UWkip8inFCF4i1RjOWoXo56OoGqbc6-URZdqai-PSGmAEeNdoGzPCx2G-WTfFQQR0Tj370FPVcaYJNN0yoWy68YHSBwcejXeYPTmAAgp4iGWNHV3mwbdhs8fM0tJD0XBxkVZt-/s320/IMG_2299.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1IIf7Ig9e-n5ias-DV2NYzWc1Wglo1krbYDY9t3VOISGSJlGP55bzNA2Ad589_NY_93ohXF8wbpzp8AeEgGGwZ3h-oIvN8OHKi39JDUVcmaI-m2uGgng-Patx0j8eHkFPZIL5paMx8fX-/s1600/IMG_2306.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1IIf7Ig9e-n5ias-DV2NYzWc1Wglo1krbYDY9t3VOISGSJlGP55bzNA2Ad589_NY_93ohXF8wbpzp8AeEgGGwZ3h-oIvN8OHKi39JDUVcmaI-m2uGgng-Patx0j8eHkFPZIL5paMx8fX-/s320/IMG_2306.JPG" width="240" /></a></div>
<br />
Helpful link:<br />
<a href="http://img840.imageshack.us/i/spipgmv2.gif/">http://img840.imageshack.us/i/spipgmv2.gif/</a> - Circuit diagram<br />
<a href="http://www.slatedroid.com/index.php?showtopic=5668">http://www.slatedroid.com/index.php?showtopic=5668</a> - De-Brick discussion<br />
<strike><a href="http://rayer.ic.cz/elektro/spipgm.htm">http://rayer.ic.cz/elektro/spipgm.htm</a> - Post about spipgm</strike><br />
<strike><a href="http://rayer.ic.cz/programm/programm.htm#SPIPGM">http://rayer.ic.cz/programm/programm.htm#SPIPGM</a> - spipgm download</strike><br />
<a href="http://rayer.g6.cz/elektro/spipgm.htm">http://rayer.g6.cz/elektro/spipgm.htm</a><br />
<a href="http://rayer.g6.cz/programm/programe.htm#SPIPGM">http://rayer.g6.cz/programm/programe.htm#SPIPGM</a>
<br />
<a href="http://retired.beyondlogic.org/wp/4Mb_spi_flash.zip">http://retired.beyondlogic.org/wp/4Mb_spi_flash.zip</a> - Rom (Link updated on 19 May 2012)<br />
<a href="http://projectgus.com/2010/08/unbricking-wm8505-based-tablets/">http://projectgus.com/2010/08/unbricking-wm8505-based-tablets/</a>Unknownnoreply@blogger.com31tag:blogger.com,1999:blog-5131032816041063469.post-27805283212625111982011-02-09T19:09:00.000+08:002011-02-09T19:09:22.727+08:00fsredir New Version 1.0.1New fsredir version<br />
v1.0.1.6 - <a href="http://www.fileserve.com/file/d7pjH5V">Download Here</a><br />
<br />
After a lot of bugfixes, I still think there is a bug in this version. Please try and give me some feedback.<br />
Thanks.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-5131032816041063469.post-35504357929612388972011-02-07T00:14:00.004+08:002011-02-07T00:39:52.147+08:00Latest fsredir in actionIt's been a while since I last update this blog.<br />
<br />
I want to tell that fsredir drivers almost complete (or already completes) and its now works on Windows XP too :) Of course it will works on windows 7 and windows PE. I haven't tested this driver with windows vista and other windows version because I don't have them but hope this driver works for them. Originally I want to make it support only for WinPE but considering that this driver might be helpful for some user such as lack of free space on C:\ drive and want to put the data on D:\ and still want windows to think that files still on C:\.<br />
<br />
<a name='more'></a><br />
<br />
There is a person that work for F-Secure who helped me so much by giving me some tips and some tutorial links that helped me very much. Thanks to him, and with his help I can develop and debug fsredir driver easily. Here are some link that he shared with me and I want to share with you:<br />
<ul><li><a href="http://virtualkd.sysprogs.org/">http://virtualkd.sysprogs.org/ </a>- VirtualKD, Windows kernel debugger booster for Virtual Machines. - I use Oracle VirtualBox with VirtualKD, debugging windows now become very fast as VirtualKD replace 10kb/s virtual COM Port to something faster.</li>
<li><a href="http://windbg.info/doc/2-windbg-a-z.html">http://windbg.info/doc/2-windbg-a-z.html</a> - WinDbg, From A-Z is everything you need to know about WinDbg. I didn't fully read this but it still helps me.</li>
<li><a href="http://www.docstoc.com/docs/38790050/Defeating-Kernel-Native-API-Hook">http://www.docstoc.com/docs/38790050/Defeating-Kernel-Native-API-Hook</a> - Become a clue how driver hooking works. Reminder: fsredir driver didn't use SSDT hooks or any hooking technique. It was only a minifilter driver based on SimRep and use callbacks.</li>
</ul>Before, I debug my driver using minidump files created by BSOD as I don't know how to debug windows. Now with VirtualKd, it makes me want to learn basic Windows debugging ;)<br />
<br />
Latest fsredir driver now can copy directory content on... :S<br />
Let's say you put fsredir.marker on D:\ and write \fsredir for root directory. You put files on D:\fsredir\test.txt, the files now appear on C:\test.txt<br />
<br />
Here some picture fsredir in action running on Windows XP. <br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5-T1jT5i0DaqW9BtIKAK8fr70F8l_ENWNwUqAE7DSLI9RtgLY0nSjKtVVRazKR6U-NxAYrwZ8AWgvKkZtWbqrW4cyVv-lRBxykh_vjWyTmlXFIUJeAT3fgHeihUth3fvKtNpAjoL0cq59/s1600/step-1-fsredirmarker-on-d.png" style="margin-left: auto; margin-right: auto;" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Creating a new file named as <b>fsredir.marker</b> on <b>D:\</b></span></td></tr>
</tbody></table><div class="separator" style="clear: both; text-align: center;"><br />
</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://1.bp.blogspot.com/_2NxmZgTJg-k/TU7DeX9BZaI/AAAAAAAAAGE/vmW24T8C8JQ/s1600/step-2-fsredir-root.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="http://1.bp.blogspot.com/_2NxmZgTJg-k/TU7DeX9BZaI/AAAAAAAAAGE/vmW24T8C8JQ/s1600/step-2-fsredir-root.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Put <b>\fsredir</b> inside <b>fsredir.marker</b> for root path</span></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO58JwBC2J-NpIxzgOuFdh9Tv0nJLgapcMW6UglZhpJViQpHmtdhvkWNhchAx7gOnkx4UeJ4pfs9WfilJ3gNC6TqROjWSnDGCzdBwrnf6hJSyvV8LGx62IOZrF-jhZXLPuwtpKX9Jd8kMv/s1600/step-2-fsredir-root-on-d.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO58JwBC2J-NpIxzgOuFdh9Tv0nJLgapcMW6UglZhpJViQpHmtdhvkWNhchAx7gOnkx4UeJ4pfs9WfilJ3gNC6TqROjWSnDGCzdBwrnf6hJSyvV8LGx62IOZrF-jhZXLPuwtpKX9Jd8kMv/s1600/step-2-fsredir-root-on-d.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Creating a directory named fsredir as defined in the picture above for root</span></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCRhyphenhyphenTgPjb9FIP06ZVzQSsDr-D3GuWTLWLJunxPHfYVQNQGRxqWRPVfHFFskaCqvgizTSRPXjacOFnLN3VZFudW9E4IUTrBH9wF0zjNH8GFKpjdUL82_r17NwckSX1mNUMnSulEZ2w5jy7/s1600/step-3-put-some-content.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCRhyphenhyphenTgPjb9FIP06ZVzQSsDr-D3GuWTLWLJunxPHfYVQNQGRxqWRPVfHFFskaCqvgizTSRPXjacOFnLN3VZFudW9E4IUTrBH9wF0zjNH8GFKpjdUL82_r17NwckSX1mNUMnSulEZ2w5jy7/s1600/step-3-put-some-content.png" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Putting some files on <b>D:\fsredir</b></span></td></tr>
</tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUtMl2VFvGg041gBsEx5a_KIQUoRpVt3hdwitCrStw9YNOa5wJmJc6ECjBjUU2X29-9E-R1cyOrDzy80YCTqf_iVg9RAyeZSKN4hrJGKto3gEkKabRgJHqBCZC1nB0fmjC8tOqFpW5cw12/s1600/step-4-browse-c.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="371" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUtMl2VFvGg041gBsEx5a_KIQUoRpVt3hdwitCrStw9YNOa5wJmJc6ECjBjUU2X29-9E-R1cyOrDzy80YCTqf_iVg9RAyeZSKN4hrJGKto3gEkKabRgJHqBCZC1nB0fmjC8tOqFpW5cw12/s640/step-4-browse-c.png" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">As you can see, test.txt now appears in <b>C:\</b> too :) Double clicking it will opened notepad and read file contents originated from <b>D:\fsredir\test.txt</b> while notepad still thinks that file is on <b>C:\test.txt</b></span></td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"><br />
</td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"><br />
</td></tr>
</tbody></table><br />
I will upload the driver later, so stay tuned :)Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-5131032816041063469.post-11038741252605263042010-08-16T15:50:00.006+08:002010-08-16T16:52:16.289+08:00FLV Audio ExtractorMy simple audio extractor write based on <a href="http://osflash.org/flv">http://osflash.org/flv</a>.<br />
Using converter can be slow and may lower the quality of converted file or can increase file size but with same quality. Extract the audio will take out original audio file from *.flv files. This process doesn't require you to upload and download audio file because all process will take places in your computer.<br />
<br />
<b>Features:</b><br />
Extract mp3 audio from flv files. (FLV to MP3 converter)<br />
<br />
<a name='more'></a><br />
<br />
<object align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" height="400" id="FLVExtractor" width="550"> <param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="http://www.fileden.com/files/2007/4/16/989124/FLVExtractor.swf" /><param name="menu" value="false" /><param name="wmode" value="transparent" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://www.fileden.com/files/2007/4/16/989124/FLVExtractor.swf" menu="false" wmode="transparent" quality="high" bgcolor="#ffffff" width="550" height="400" name="FLVExtractor" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" ></embed> </object>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-5131032816041063469.post-56229795934300488292010-08-16T12:16:00.008+08:002012-07-22T23:19:24.443+08:00How to make a simple virus/malware scannerMaking a working antivirus is a very hard thing because of several reason:<br />
<ol>
<li>You need to get virus/malware sample which is not easy to get.</li>
<li>Most virus infect the executable file and some use polymorphism making it harder to detect.</li>
<li>Most antivirus use heuristics scan which analyze the file and if the file look suspicious it will flag it and ask the user what to do. This is hard to implement and poor heuristics scan can result many false-positive.</li>
<li>Need a driver which will monitor the system like file read/write.</li>
<li>etc...</li>
</ol>
<br />
Today, I'm going to show you how to make a simple malware scanner (not antivirus) in MSVC2008 C/C++ which use hash to compare file with database. This methods only works on some kind of malware, eg. worm, trojan, or any file which doesn't change itself because we will hash the whole file content.<br />
<br />
<a name='more'></a><br />
<br />
First, let's draft how our malware scanner will work:<br />
<ul>
<li style="background-color: #ea9999;">The scanner will scan by hashing the file and comparing the hash with hash list in database using MD5.</li>
<li style="background-color: #ea9999;">The scanner will only scan file size that below 50MB and will skip some file types like .txt/.rtf</li>
<li style="background-color: #ea9999;">The scanner start scanning and firstly it will scan for all process and its module (dlls) and terminate it if found as malware.</li>
<li>Then the scanner will scan startup folder and registry entry in all possible startup places and if found, delete registry and file. For example</li>
<ul>
<li>C:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</li>
<li>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run</li>
</ul>
<li style="background-color: #ea9999;">Search the local harddrive and delete malware if found.</li>
</ul>
This tutorial covers only highlighted text.<br />
<br />
Now, let's start. Get eicar.com from here: <a href="http://www.eicar.org/anti_virus_test_file.htm">http://www.eicar.org/anti_virus_test_file.htm</a> <i>(eicar is antivirus test file)</i><br />
Open Microsoft Visual Studio and Create a New Project, name it anything you like for you scanner. (I named it as ScannerTutorial)<br />
For this tutorial, we will create a <b>console </b>project and use Multi-Byte character set.<br />
<br />
<br />
Now you have empty console project. Get MD5 from here <a href="http://sourceforge.net/projects/libmd5-rfc/">http://sourceforge.net/projects/libmd5-rfc/</a><br />
Add md5.c and md5.h to your project.<br />
<br />
<br />
Then Right-click on your project name (ScannerTutorial) in Solution Explorer, Click Add\Class... and select C++ Class.<br />
Write CFileScanner in Class name and click Finish<br />
<br />
The <span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">CFileScanner<span style="font-family: inherit;"> </span></span>will have the following methods:<br />
<ul style="font-family: "Courier New",Courier,monospace;">
<li>BOOL ScanFile(LPCSTR lpFileName, BOOL bDelete</li>
<li><span style="color: blue;">void </span>ScanFolder(LPCSTR lpFolderName);</li>
<li><span style="color: blue;">void </span>ScanProcess();</li>
</ul>
and 2 members<br />
<ul style="font-family: "Courier New",Courier,monospace;">
<li>vector <<span style="color: blue;">char</span>*> m_vDatabase; // Hash database</li>
<li>vector <<span style="color: blue;">char</span>*> m_vExcludedExt; // Excluded extension</li>
</ul>
<div style="color: #38761d;">
<br /></div>
<pre><code><span style="color: #38761d;"><span style="color: #38761d;">/*</span>
<span style="color: #38761d;"> Scan for a single file</span>
<span style="color: #38761d;"> lpFileName Filename to scan (full path)</span>
<span style="color: #38761d;"> bDelete Delete file if found infected</span>
<span style="color: #38761d;"> Return Value</span>
<span style="color: #38761d;"> TRUE File is infected</span>
<span style="color: #38761d;"> FALSE File is clean</span>
<span style="color: #38761d;">*/</span></span>BOOL CFileScanner::ScanFile(LPCSTR lpFileName, BOOL bDelete)
{
<span style="color: #38761d;">// Get file extension</span>
<span style="color: blue;">const char </span>*lpExt = lpFileName;
<span style="color: blue;">for </span>(<span style="color: blue;">unsigned int </span>i=0; i<strlen(lpFileName); i++) {
<span style="color: blue;">if </span>(lpFileName[i] == <span style="color: #990000;">'.'</span>)
lpExt = lpFileName + i + 1;
}
<span style="color: #38761d;">// Exclude excluded file extension</span>
<span style="color: blue;">for </span>(size_t i=0; i<m_vExcludedExt.size(); i++) {
<span style="color: blue;">if </span>(_stricmp(lpExt, m_vExcludedExt[i]) == 0)
<span style="color: blue;">return </span>FALSE;
}
HANDLE hFile = CreateFile(lpFileName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
<span style="color: blue;">if </span>(hFile == INVALID_HANDLE_VALUE)
<span style="color: blue;">return </span>FALSE; <span style="color: #38761d;">// Error, cannot open file. Return FALSE</span>
<span style="color: #38761d;">// Get file size and proceed if file is below 50MB</span>
DWORD dwFileSize = GetFileSize(hFile, NULL);
<span style="color: blue;">if </span>(dwFileSize > 52428800) <span style="color: #38761d;">// </span><a href="http://www.google.com/search?q=50megabyte+to+bytes" style="color: #38761d;">http://www.google.com/search?q=50megabyte+to+bytes</a>
<span style="color: blue;">return </span>FALSE; <span style="color: #38761d;">// More than 50MB</span>
<span style="color: #38761d;">// Start hash</span>
md5_state_t state;
md5_byte_t digest[16];
<span style="color: blue;">char </span>buffer[1024];
<span style="color: blue;">char </span>szHash[16*2 + 1];
DWORD dwRead, dwTotal = 0;
md5_init(&state);
<span style="color: blue;">do </span>{
ReadFile(hFile, buffer, 1024, &dwRead, NULL);
md5_append(&state, (<span style="color: blue;">const </span>md5_byte_t *)buffer, dwRead);
dwTotal += dwRead;
} <span style="color: blue;">while </span>(dwTotal < dwFileSize);
md5_finish(&state, digest);
<span style="color: #38761d;">// Convert hash to hex</span>
<span style="color: blue;">for </span>(<span style="color: blue;">int </span>di = 0; di < 16; ++di)
sprintf(szHash + di * 2, <span style="color: #990000;">"%02x"</span>, digest[di]);
CloseHandle(hFile); <span style="color: #38761d;"> // Close file handle</span>
<span style="color: #38761d;">// End hash</span>
<span style="color: #38761d;">// Compare md5 with database</span>
<span style="color: blue;">for </span>(size_t i=0; i<m_vDatabase.size(); i++)
{
<span style="color: blue;">if </span>(strcmp(szHash, m_vDatabase[i]) == 0)
{
// Write output to console
printf(<span style="color: #990000;">"Found: %s\n"</span>, lpFileName);
// Delete file
<span style="color: blue;">if </span>(bDelete) DeleteFile(lpFileName);
<span style="color: blue;">return </span>TRUE; <span style="color: #38761d;">// We found matched hash with database</span>
}
}
<span style="color: #38761d;">// Default return value</span>
<span style="color: blue;">return </span>FALSE;
}</code></pre>
<br />
as you can see the function above, first, it will compare the file extension and then it hash the file content and compare the hash with the database, if the file hash found then it will delete the file. :)<span style="font-size: small;"></span><br />
Now let's see next function<br />
<br />
<pre><code><span style="color: #38761d;">/*
Scan drive/folder and its subfolder
lpFolderName Folder to scan (full path)
Return Value
None
*/</span><span style="color: blue;">void </span>CFileScanner::ScanFolder(LPCSTR lpFolderName)
{
WIN32_FIND_DATA tFindData;
HANDLE hFind;
<span style="color: blue;">char </span>szFolder[MAX_PATH]; <span style="color: #38761d;">// Folder with trailing backslash</span>
<span style="color: blue;">char </span>szFind[MAX_PATH]; <span style="color: #38761d;">// Folder name with wildcat</span>
vector <<span style="color: blue;">char</span>*> vFolder; <span style="color: #38761d;">// Store subfolder. Used to scan subfolder</span>
<span style="color: #38761d;">// If file, just scan</span>
<span style="color: blue;">if </span>(!(GetFileAttributes(lpFolderName) & FILE_ATTRIBUTE_DIRECTORY)) {
ScanFile(lpFolderName, TRUE);
<span style="color: blue;">return</span>;
}
<span style="color: #38761d;">// Copy folder name to szNewFolder and add trailing backslash if neccessary</span>
strcpy(szFolder, lpFolderName); <span style="color: #38761d;">// Copy string to szFolder</span>
<span style="color: blue;">if </span>(szFolder[strlen(szFolder) - 1] != <span style="color: #990000;">'\\'</span>)
strcat(szFolder, <span style="color: #990000;">"\\"</span>); <span style="color: #38761d;">// Add trailing backslash</span>
<span style="color: #38761d;">// Add wildcat</span>
strcpy(szFind, szFolder); <span style="color: #38761d;">// Copy szFolder</span>
strcat(szFind, <span style="color: #990000;">"*"</span>); <span style="color: #38761d;">// Add wildcat</span>
hFind = FindFirstFile(szFind, &tFindData);
<span style="color: blue;">if </span>(hFind == INVALID_HANDLE_VALUE)
<span style="color: blue;">return</span>;
<span style="color: blue;">do </span>{
<span style="color: #38761d;">// Directory, copy to vFolder</span>
<span style="color: blue;">if </span>(tFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
<span style="color: #38761d;">// File name is not . or ..</span>
<span style="color: blue;">if </span>(!strcmp(tFindData.cFileName, <span style="color: #990000;">"."</span>) == 0 &&
!strcmp(tFindData.cFileName, <span style="color: #990000;">".."</span>) == 0)
{
<span style="color: #38761d;">// Find maximum length with null string</span>
<span style="color: blue;">unsigned int </span>nLen = strlen(szFolder) + strlen(tFindData.cFileName) + 1;
<span style="color: #38761d;">// Create a new string</span>
<span style="color: blue;">char </span>*lpFolder = <span style="color: blue;">new char</span>[nLen];
<span style="color: blue;">if </span>(lpFolder == NULL) <span style="color: blue;">return</span>;
<span style="color: #38761d;">// Construct path</span>
strcpy(lpFolder, szFolder);
strcat(lpFolder, tFindData.cFileName);
<span style="color: #38761d;">// Add to vector array for later processing</span>
vFolder.push_back(lpFolder);
}
}
<span style="color: blue;">else</span>
{
<span style="color: #38761d;">// Find maximum length with null string</span>
<span style="color: blue;">unsigned int </span>nLen = strlen(szFolder) + strlen(tFindData.cFileName) + 1;
<span style="color: #38761d;">// Create a new string</span>
<span style="color: blue;">char </span>*lpFile = <span style="color: blue;">new char</span>[nLen];
<span style="color: blue;">if </span>(lpFile == NULL) <span style="color: blue;">return</span>;
<span style="color: #38761d;">// Construct path</span>
strcpy(lpFile, szFolder);
strcat(lpFile, tFindData.cFileName);
<span style="color: #38761d;">// Scan this file</span>
ScanFile(lpFile, TRUE);
<span style="color: #38761d;">// Free memory</span>
<span style="color: blue;">delete </span>[]lpFile;
}
} <span style="color: blue;">while </span>(FindNextFile(hFind, &tFindData) != 0);
<span style="color: #38761d;">// We are done scanning this folder</span>
FindClose(hFind);
<span style="color: #38761d;">// Now, let's scan subfolder</span>
<span style="color: blue;">for </span>(size_t i=0; i<vFolder.size(); i++)
{
<span style="color: blue;">if </span>(vFolder[i] != NULL) {
ScanFolder(vFolder[i]); <span style="color: #38761d;">// Call this function</span>
<span style="color: blue;">delete </span>[]vFolder[i]; <span style="color: #38761d;">// Free memory</span>
}
}
}</code></pre>
<br />
Firstly, the function will get the target attributes, if it recognizes it as a file, then it calls ScanFile() function and return.<br />
Then, it will call FindFirstFile() function to start listing file/folder in the directory and continue using FindNextFile(). When the folder is found, it will add folder path + folder name into vector array. You may noticed that I excluded "." and ".." from being added to array. If you didn't know, single dot, "." means current directory while double dot, ".." mean previous directory. You can open Command Prompt and try to change dir cd to ./..<br />
If we include both ./.., we will end up in infinite loop.<br />
<br />
<pre><code>
<span style="color: blue;">void </span>CFileScanner::ScanProcess()
{
DWORD dwPIDs[1024], cbNeeded, cProcesses;
<span style="color: #38761d;">// Enumerate running processes</span>
<span style="color: blue;">if </span>(!EnumProcesses(dwPIDs, sizeof(dwPIDs), &cbNeeded))
<span style="color: blue;">return</span>;
<span style="color: #38761d;">// Calculate how many process identifiers were returned.</span>
cProcesses = cbNeeded / sizeof(DWORD);
<span style="color: blue;">for </span>(unsigned int i=0; i<cProcesses; i++)
{
HMODULE hMods[1024];
DWORD cbNeeded;
HANDLE hProcess;
<span style="color: #38761d;">// Get a list of all the modules in this process</span>.
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, dwPIDs[i]);
<span style="color: blue;">if </span>(NULL != hProcess)
{
<span style="color: blue;">if</span>(EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
{
<span style="color: blue;">for </span>(<span style="color: blue;">unsigned int </span>i = 0; i<(cbNeeded / sizeof(HMODULE)); i++ )
{
<span style="color: blue;">char </span>szModName[MAX_PATH];
<span style="color: #38761d;">// Get the full path to the module's file.</span>
<span style="color: blue;">if </span>(GetModuleFileNameEx(hProcess, hMods[i], szModName, MAX_PATH))
{
<span style="color: #38761d;">// Scan file and if found, don't delete it because the file is in use</span>
<span style="color: blue;">if </span>(ScanFile(szModName, FALSE))
{
<span style="color: #38761d;">// Terminate current process first, so we can delete file</span>
TerminateProcess(hProcess, 0);
<span style="color: #38761d;">// Delete the file</span>
DeleteFile(szModName);
<span style="color: #38761d;">// Continue to next process</span>
<span style="color: blue;">goto </span>SKIP;
}
}
}
}
SKIP:
<span style="color: #38761d;">// Close process handle</span>
CloseHandle(hProcess);
}
}
}</code></pre>
<br />
The above function has problem with Windows 64 bit. It will only list 32bit process name and modules. The above function simply enumerate all processes run in windows and get all modules or dlls that is loaded with the process. The first module will be always the process name and doesn't need to call GetModuleBaseName() API function.<br />
<br />
At the constructor of this class, you can init this 2 member variables<br />
<br />
<pre><code>CFileScanner::CFileScanner(<span style="color: blue;">void</span>)
{
<span style="color: #38761d;">// Fill database (use lower case)</span>
m_vDatabase.push_back("44d88612fea8a8f36de82e1278abb02f"); <span style="color: #38761d;">// eicar.com hash</span>
m_vDatabase.push_back("7e28c727e6f5c43179254e2ccb6ffd3a"); <span style="color: #38761d;">// Some new folder.exe worm</span>
m_vExcludedExt.push_back(<span style="color: #990000;">"txt"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"ini"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"inf"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"doc"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"rtf"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"cfg"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"zip"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"rar"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"tar"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"gz"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"bz2"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"jpg"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"jpeg"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"png"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"bmp"</span>);
m_vExcludedExt.push_back(<span style="color: #990000;">"gif"</span>);
}</code></pre>
<br />
Now your CScanFile is complete and you may now call your class in main function like below<br />
<pre><code>CFileScanner oScan;
oScan.ScanProcess();
oScan.ScanFolder(<span style="color: #990000;">"C:\\"</span>);</code></pre>
<br />
Here is complete MSVC 2008 tutorial file: <a href="http://www.mediafire.com/file/v829qqrwe4ndk01/ScannerTutorial.zip">Download</a><br />
Happy coding :)Unknownnoreply@blogger.com60tag:blogger.com,1999:blog-5131032816041063469.post-67734733228931214542010-08-16T06:59:00.003+08:002010-08-20T07:10:53.288+08:00Recover Corrupted User Registry HiveEverytime I start my computer, my folder settings and folder view reset itself to default. I set it back and do it everyday and after next reboot, it reset folder settings back to default again. After opening Events Viewer, I found out that my user registry corrupted in and registry recovery occured on each boot.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3F_29Oe5UtBiJRLIExBfFn8y6KDqiWHSBvy6BjLiAJBbCHXyGdZRwU5R2EaxEzdgW-ncKZnaIIAr0jrLImlxevrrHOH0kI47MgHuObTl90D48MVWDOH8VOM6DQsCXdfjsNrX604qLLwl6/s1600/reg_corrupt.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="257" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3F_29Oe5UtBiJRLIExBfFn8y6KDqiWHSBvy6BjLiAJBbCHXyGdZRwU5R2EaxEzdgW-ncKZnaIIAr0jrLImlxevrrHOH0kI47MgHuObTl90D48MVWDOH8VOM6DQsCXdfjsNrX604qLLwl6/s400/reg_corrupt.JPG" width="400" /></a></div>It says<span style="color: black;">,</span><br />
<span style="color: #990000;">Event 5, Kernel-General:</span><br />
<span style="color: #990000;">{Registry Hive Recovered} Registry hive (file): '\??\C:\Users\<username>\ntuser.dat' was corrupted and it has been recovered. Some data might have been lost.</span><br />
<br />
<a name='more'></a><br />
<br />
Folder settings is stored in user registry and perhaps thats the reason why my folder settings & folder view reset itself.<br />
<br />
Today tutorial is how to Recover Corrupted User Registry Hive yourself so you <b>wont lose any computer settings</b>. It's possible only if you can still login with your profile. If you are not able to login to your profile or got message saying <span style="color: #cc0000;">Your user profile was not loaded correctly! You have been logged on with a temporary profile</span>, run checkdisk first.<br />
<ul><li>First step is to create a new temporary blank account and name it temp and set it as Administrator. Then click Create Account</li>
</ul><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIMMRNHuaT5jemGDMIkOjBigY9PJsE39ZRYvUggXXqW_eCm1CFZRak0-XVf3FtRRCAhWzY9CMbtD4EtGT1iDfkGBXUpRoDPtWMZ3WScKAbLNqAIL4BQltT5f_WUkHdLh2YijzmE-aSFX2S/s1600/create_acc.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="205" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIMMRNHuaT5jemGDMIkOjBigY9PJsE39ZRYvUggXXqW_eCm1CFZRak0-XVf3FtRRCAhWzY9CMbtD4EtGT1iDfkGBXUpRoDPtWMZ3WScKAbLNqAIL4BQltT5f_WUkHdLh2YijzmE-aSFX2S/s400/create_acc.JPG" width="400" /></a></div><ul><li>Then Logout your current account and Login with new temporary account. Wait until preparing is complete.</li>
<li><b>Second step</b>. Open my computer or any folder, Click Organize\Folder and Search options.</li>
</ul><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgWsV4KQ_cMIJ83TVtPt4yPASxt7ygUk2VoEjC6Fg-cuI8bzD3p67ET6mQoOtrlBIF5n3gVj0l5Nu4ybO9n5gawT20PbFrG2ncMno95nAorTfwsU-iWYidpekfsKTzXxEKH4BrieE8FR8/s1600/foldersetting.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIgWsV4KQ_cMIJ83TVtPt4yPASxt7ygUk2VoEjC6Fg-cuI8bzD3p67ET6mQoOtrlBIF5n3gVj0l5Nu4ybO9n5gawT20PbFrG2ncMno95nAorTfwsU-iWYidpekfsKTzXxEKH4BrieE8FR8/s320/foldersetting.JPG" /></a></div><ul><li>Click view and </li>
<ul><li>Select Show Hidden files, folders, or drive,</li>
<li>Untick Hide protected operating system files</li>
</ul>
<li>After that, run Registry Editor as administrator. Type regedit.exe in search box and right-click Run As Administrator.</li>
<li>Click HKEY_LOCAL_MACHINE<span style="background-color: #f4cccc;"><span style="background-color: white;"> to select and highlight it</span></span><i><span style="background-color: #f4cccc;"><span style="background-color: white;"> </span>(Not expand)</span></i> and click Load Hive on File menu (File\Load Hive)</li>
<li>Browse to C:\Users\YourUsername\NTUSER.dat and name it as corrupt</li>
</ul><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixlh2mi9mDCa58qkgtnMHToGZuSO1DwC-AsmxF_CkJqk2T49xzx_ngSmOqNzTBgUfEwlIWfX2NXpcT-yGD5M_c-J2AqzR-DAQTTZXSDvCwQHEEAWvNXMIrVjxNdoqU1rIeSIhLCZmqHzTH/s1600/corruptload.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixlh2mi9mDCa58qkgtnMHToGZuSO1DwC-AsmxF_CkJqk2T49xzx_ngSmOqNzTBgUfEwlIWfX2NXpcT-yGD5M_c-J2AqzR-DAQTTZXSDvCwQHEEAWvNXMIrVjxNdoqU1rIeSIhLCZmqHzTH/s320/corruptload.JPG" /></a></div><ul><li>Click corrupt <i><span style="background-color: #f4cccc;">(Not expand)</span></i> and then File\Export... Save to desktop as corrupt.reg</li>
<li>Click File\Unload Hive.</li>
<li>Now logout from your temporary profile and login back into your corrupted profile.</li>
<li>Go to C:\Users\temp\ and copy NTUSER.DAT to C:\ (If you didn't see it, repeat second step)</li>
<li>Logout and login temp account, start regedit.exe again.</li>
<li>Click File\Load Hive and browse to C:\NTUSER.DAT (that you copied from your C:\Users\temp account) and name it as corrupt</li>
<li>Expand corrupt and delete everything under it, some entry cannot be deleted. You can fix it by changing permission or just leave it. I just leave it.</li>
</ul><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNEdF6MOZ8eBgZ3Gv8sS_gcQAMDYKhPfPu2FKfv6sAapCeJYHFQzku-Hhpze0mN7cU12nr_k5go4Mh723_aDuh3L0z-HfROxc1ZcQxgz69o9wYO1gbv8Af69dIIAlayT2Ipc0f6jnGenG/s1600/deletedreg.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGNEdF6MOZ8eBgZ3Gv8sS_gcQAMDYKhPfPu2FKfv6sAapCeJYHFQzku-Hhpze0mN7cU12nr_k5go4Mh723_aDuh3L0z-HfROxc1ZcQxgz69o9wYO1gbv8Af69dIIAlayT2Ipc0f6jnGenG/s320/deletedreg.JPG" /></a></div><div style="text-align: center;"><i><span style="font-size: x-small;">(Picture shows deleted registry child and some entry that cannot be deleted)</span></i></div><ul><li>After everything is done, click corrupt.reg that you save earlier on desktop</li>
<li>Now click corrupt to highlight it and Click File\Unload Hive. Then close registry editor.</li>
<li>After that copy your C:\NTUSER.DAT to C:\Users\YourUserName\NTUSER.DAT and replace it.</li>
<li>You may find many other NTUSER.DAT* like ntuser.dat.LOG1, ntuser.dat.LOG2, NTUSER.DAT{GUID}.TxR.0.regtrans-ms, etc, you can delete that.</li>
<li>Login to your user account back.</li>
<li> After login to your account, open registry editor.</li>
<li>Right-Click at HKEY_CURRENT_USER, Permissions and Remove unknown group or username, then click add button</li>
<li>Click advanced and then click Find Now</li>
<li>Find your current username and click ok</li>
<li>Done</li>
</ul>Unknownnoreply@blogger.com12tag:blogger.com,1999:blog-5131032816041063469.post-88655006603578247852010-08-15T08:05:00.023+08:002011-02-07T00:35:59.964+08:00File Redirection using driver (fsredir)Here is my File Redirection (fsredir) that I write to solve problem with WinPE 3.0<br />
This driver also works on normal windows.<br />
<br />
This is my first driver and it is based on Simrep Minifilter Sample by Microsoft.<br />
<br />
Download Here: <a href="http://www.fileserve.com/file/QCMUp3c">http://www.fileserve.com/file/QCMUp3c</a><br />
<i>(Tested with windows 7 and WinPE 3.0 only)</i><br />
<br />
Forum post: <a href="http://www.boot-land.net/forums/index.php?showtopic=12289">http://www.boot-land.net/forums/index.php?showtopic=12289</a><br />
<br />
<b>What does file redirection do?</b><br />
<a name='more'></a><b></b><br />
To answer this, lets see what is WinPE:<br />
Windows PE is a lightweight version of windows and was originally to deploy windows but useful to create rescue disk too. Not everything we have in windows is included in WinPE and it will fail to load some applications. Example is application that was written and compiled with VisualBasic 6.0 depends on msvbvm60.dll but msvbvm60.dll is not included and missing from WinPE. We can simply inject all dependencies and dlls into WIM Image but side-effect is the wim image will getting larger and larger and will give you error <b>Ramdisk device creation failed due to insufficient memory</b>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbaiE8KtIAvmqt3seVLVPVc7gA0-SnQuAz3E3wWcdJ92HTInvb2c43exkRc6n7tJ63YJGByOBVsCjtDbiD7c_h4eGfsr79F3tKJhlw-tZOAvPaADEjnqSo1KfWqJHNPeFUoTTLixI9vGFX/s1600/insufficientramdisk.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="47" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbaiE8KtIAvmqt3seVLVPVc7gA0-SnQuAz3E3wWcdJ92HTInvb2c43exkRc6n7tJ63YJGByOBVsCjtDbiD7c_h4eGfsr79F3tKJhlw-tZOAvPaADEjnqSo1KfWqJHNPeFUoTTLixI9vGFX/s400/insufficientramdisk.JPG" width="400" /></a></div><br />
This is because WinPE create a new ramdisk and put all wim image contents into ramdisk with drive letter <b>x:\</b>. We simply want to keep Wim image small so it will fit into memory and other application can use the rest of unused memory. Here how fsredir help us:<br />
Instead of storing file into wim image, we can simply use our pendrive/harddisk/etc to store file <b>outside the image </b>while WinPE still thinking our file is in <b>x:</b> drive<br />
<ul><li>When computer boot/or new media storage device attached, fsredir will find fsredir.marker on each device root directory and load it when found. Lets say your fsredir.marker is located on <b>E:\fsredir.marker</b></li>
<li>The content of fsredir.marker represent the location of x:\ in your device. It can be blank or changed. Lets say fsredir.marker contain this: <b>\MyWinPe</b></li>
<li>When for example, application tried to load x:\windows\system32\msvbvm60.dll but file is not there, fsredir will try to search msvbvm60.dll on your drive which contain fsredir.marker in <b>E:\MyWinPe\Windows\System32\msvbvm60.dll</b>. If<b> </b>your<b> </b>fsredir.marker has no content. It will search in E:\Windows\System32\msvbvm60.dll<b><br />
</b></li>
<li>If fsredir found the file, it will redirect the request to open that file into new location.</li>
<li>Your application load :)</li>
</ul><b>Installation </b>(Inserting the driver into wim image)<b>:</b><br />
1) Inserting the driver into wim image:<br />
<ul><li>Download the driver above and Extract all the content into new folder</li>
<li>Mount your wim image by using imagex or dism (eg imagex /mountrw PATH_TO_WIM 1 PATH_TO_MOUNT_DIR) Lets say PATH_TO_MOUNT_DIR is <b>C:\WinPE\Mount\</b> <i>(Tutorial can be found <a href="http://4sysops.com/archives/windows-7-dism-how-to-mount-manage-and-service-wim-images/">here</a> or search using googles)</i></li>
<li>Copy \file\fsredir.inf to C:\WinPE\Mount\Windows\inf</li>
<li>Copy \file\fsredir.sys to C:\WinPE\Mount\Windows\system32\drivers</li>
<li>Copy \file\fsredir.marker to your pendrive or other external drive (outside, not in folder or subfolder)</li>
</ul>2) Installing the driver<br />
<ul><li>Open regedit.exe as administrator</li>
<li>Click HKEY_LOCAL_MACHINE and goto menu File\Load Hive</li>
<li>Browse and open <b>C:\WinPE\Mount\Windows\System32\config\SYSTEM</b></li>
<li>Name it as WINPE</li>
<li>Double-click fsredir.reg</li>
<li>Click HKEY_LOCAL_MACHINE\WINPE and go to menu File\Unload Hive</li>
<li>Close Registry editor.</li>
</ul>3) Modifying fsredir.marker and add files<br />
<ul><li>By default, fsredir.marker contain <b>\fsredir</b>, you can change this to other path that will be <i>merged</i> with x:\, make sure to include slash \ in front of the path</li>
<li>Example to put files into system32 folder</li>
<ul><li>If your fsredir.marker contain a path (e.g. <b>\fsredir</b>)</li>
<ul><li>Create a new folder in pendrive and name it fsredir. Open the folder and make a new folder windows and open your windows folder and create a new folder again and name it system32 (?:\fsredir\windows\system32)</li>
<li>Now you can start copying files into <b>\fsredir\windows\system32\</b> folder</li>
</ul><li>If you want to put your files in other path, you can simply change in fsredir.marker</li>
</ul></ul><b>Installing driver in normal windows:</b><br />
Installing this driver in windows is easy.<br />
Copy fsredir.marker to appropriate location and right-click fsredir.inf and choose Install.<br />
<br />
<ul></ul>Limitation:<br />
<ul><li>FindFile API will not list the redirected files</li>
</ul><ul></ul>Unknownnoreply@blogger.com11