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

<channel>
	<title>Mate Varga</title>
	<atom:link href="http://www.matevarga.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matevarga.com</link>
	<description>Words. You are reading them.</description>
	<lastBuildDate>Wed, 11 Aug 2010 11:58:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Oh. Hello there.</title>
		<link>http://www.matevarga.com/oh-hello-there/</link>
		<comments>http://www.matevarga.com/oh-hello-there/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:52:20 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=124</guid>
		<description><![CDATA[Let this post mark the beginning of yet another probable lapse in updates which are soon to follow! I suppose since I went through all this effort to create this blog/website, I may as well take a few moments to update it, right? &#8230;Hello? Hey wait a minute, there is nobody here&#8230; Nonetheless, I thought [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-125" title="Sup" src="http://www.matevarga.com/wp-content/uploads/2010/08/Sup.jpg" alt="Sup" width="133" height="133" /> Let this post mark the beginning of yet another probable lapse in updates which are soon to follow! I suppose since I went through all this effort to create this blog/website, I may as well take a few moments to update it, right? &#8230;Hello? Hey wait a minute, there is nobody here&#8230;</p>
<p>Nonetheless, I thought that since I&#8217;m here anyway, I may as well give a brief summary of what is going on and what I have planned &#8211; albeit not very exciting plans. If you&#8217;re still reading this, I suggest you take up a hobby. I digress&#8230;</p>
<p><span id="more-124"></span></p>
<h2>The Past</h2>
<p>While my original plan involved writing a <a title="Help me out here, Google" href="http://www.google.com/search?q=1+crap+ton+%3D+%3F+shit+loads" target="_blank">crap ton</a> of technical articles and creating other content-related thingies, I had diverged slightly&#8230;and fell off the face of the planet. I had try to revive my motivation by posting a &#8220;Haha, how about them content?&#8221; post back in February but things/life kind of got in the way (I apologize, Internet). I had silently buried the existence of this website to the back of my mind thinking, no&#8230;<em>believing</em> it would update itself automatically. Imagine my surprise when I found that wasn&#8217;t how blogs work at all&#8230;</p>
<p>Sometime around the middle of March, I had joined <a href="http://www.tivo.com" target="_blank">TiVo</a> as a Sr. Software Engineer and had been spending a lot of my personal time warming up to their rather complex build and development environment. Also, due to things like NDAs and mechanical heat-seeking lawyer grenades, work isn&#8217;t something I can blog too much about. Like, I can&#8217;t tell you about things such as the <em>Make Dinner</em> feature we&#8217;re&#8230;oh&#8230;oops&#8230;</p>
<h2>The Present</h2>
<p>Now that things are mellowing out a bit, I&#8217;ve been doing a bit of weekend/after-work tinkering again. While I admit that I&#8217;ve been a bit disorganized with what I&#8217;ve been focusing on, my plan is to create a workflow that I can start following. One of those tasks will involve dedicating time to updating my blog &#8211; hopefully with actual content and not just &#8220;hah, yeah&#8230;I&#8217;ll write content someday&#8230;you&#8217;ll see&#8230;&#8221;</p>
<p>Okay, I may have also played a few video games on the weekend. (Replaying Half Life 1/2).</p>
<h2>The Future</h2>
<p>Sometime between now and the <em><strong>Great Robot War</strong></em>, I plan to do the following:</p>
<ul>
<li>Create a workflow which will allow me to organize my personal time.</li>
<li>Document what I&#8217;ve been working on in my blog (I may have said this before&#8230;).</li>
<li>[write step 3].</li>
</ul>
<p>My first project which I plan to document here will be Elixir &#8211; my virtual/theoretical CPU architecture. I&#8217;ve already written the datasheet (which I&#8217;ve been cleaning up a bit recently) and I&#8217;ll be posting updates about my progress with the assembler and compiler.</p>
<p>Anyway, here&#8217;s to me maybe, possibly updating this blog and doing what I said I will. Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/oh-hello-there/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Not Dead Yet</title>
		<link>http://www.matevarga.com/not-dead-yet/</link>
		<comments>http://www.matevarga.com/not-dead-yet/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 00:51:43 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=114</guid>
		<description><![CDATA[Okay, so I may not have written any updates since&#8230;err&#8230;November, but I&#8217;m here to try and get the ball rolling again. My original plan was to write a technical article or a tutorial every week, but too many obligations/problems got in the way. Now with things settling down (kind of), I&#8217;m going to give this [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-115" title="not-dead-yet" src="http://www.matevarga.com/wp-content/uploads/2010/02/not-dead-yet.png" alt="not-dead-yet" width="117" height="110" />Okay, so I may not have written any updates since&#8230;err&#8230;November, but I&#8217;m here to try and get the ball rolling again. My original plan was to write a technical article or a tutorial every week, but too many obligations/problems got in the way. Now with things settling down (kind of), I&#8217;m going to give this blog another go.</p>
<p>I doubt that anybody besides people <a href="http://www.google.com/search?source=ig&amp;hl=en&amp;rlz=1G1GGLQ_ENUS307&amp;=&amp;q=Mate+Varga&amp;aq=f&amp;aqi=g-s1g3g-s1g5&amp;oq=">Googling</a> my name will read this, the least I can do now is show some signs of life.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/not-dead-yet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Fonts into Windows Forms</title>
		<link>http://www.matevarga.com/embedding-fonts-into-windows-forms/</link>
		<comments>http://www.matevarga.com/embedding-fonts-into-windows-forms/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 14:41:09 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[Winforms]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=90</guid>
		<description><![CDATA[This article discusses how to embed custom fonts into any .NET Windows Forms application and then use them as a regular System.Drawing.Font object in any control.]]></description>
			<content:encoded><![CDATA[<p>When it comes to fonts, most Windows Forms applications can get by using the default ones installed onto the user&#8217;s system. Generally, this means Microsoft Sans Serif, Ariel, Courier New or even Verdana. However, there may be some scenarios where an application requires a custom font that isn&#8217;t likely available on the user&#8217;s system &#8211; and installation isn&#8217;t an option.</p>
<h1>Download Example</h1>
<ul>
<li><a href="http://rsx.matevarga.com/downloads/articles/custom-embedded-fonts/custom-fonts-source.zip" target="_blank">Visual Studio 2005 Project</a> (ZIP File: 33,789 bytes)</li>
<li><a href="http://rsx.matevarga.com/downloads/articles/custom-embedded-fonts/custom-fonts-binary.zip" target="_blank">Example Binary</a> (ZIP File: 19,414 bytes)</li>
</ul>
<h1>Refresher: Resources</h1>
<p>You can embed just about anything into an application&#8217;s resource area, and fonts are no exception. Once added, the resources are readily accessible (read-only) from the application&#8217;s strongly-typed Properties.Resource class generated for you by the compiler. The resource class nativity supports strings, images, icons, audio, files and any other binary data (like fonts) and will allow you to access it through .NET&#8217;s System.Drawing.Bitmap, System.String, System.IO.Stream and System.Byte[] types. You can read more about adding and editing resources on MSDN from <a title="MSDN : Adding and Editing Resources (Visual C#)  " href="http://msdn.microsoft.com/en-us/library/7k989cfy%28VS.80%29.aspx" target="_blank">here</a>.</p>
<p>Since .NET does not make the connection between a font file and System.Drawing.Font object for you, there is a bit of work required so that we can turn the resources into a usable font.</p>
<h1>System.Drawing.Font</h1>
<p>In .NET 2.0, the System.Drawing.Font object has 13 different constructors. You will very quickly realize that none of them accept a file path or a byte array of a font file (which is what we currently have from the resources class). Upon closer inspection of the Font class, you will also realize some static functions allowing you to create a font instance from a device context, Windows handle or from a Logical GDI structure &#8211; all of which is of no use to us.</p>
<p>The problem is that the Font class can only access fonts which have been &#8220;installed&#8221; on the user&#8217;s system. This means that Windows needs to have the font registered internally for it to be accessible to applications. What we need to do is to get our font, in the application resources, temporarily &#8220;registered&#8221; with Windows. Luckily, Windows has a Win32 function (in gdi32.dll) called <a title="MSDN : AddFontMemResourceEx" href="http://msdn.microsoft.com/en-us/library/dd183325%28VS.85%29.aspx" target="_blank">AddFontMemResourceEx </a>which allows us to do just that.</p>
<h1>Registering the Font</h1>
<p>Since .NET does not natively have the functions we need to call, we&#8217;re going to need to import them from the gdi32 DLL by using P/Invoke. We&#8217;re going to be using AddFontResourceEx to register the font, and then RemoveFontMemResourceEx when we&#8217;re ready to clean up (discussed later).</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Runtime.InteropServices</span><span style="color: #008000;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;gdi32&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> IntPtr
 AddFontMemResourceEx<span style="color: #000000;">&#40;</span>IntPtr pbFont,
 <span style="color: #FF0000;">uint</span>   cbFont,
 IntPtr pdv,
 <span style="color: #000000;">&#91;</span><span style="color: #0600FF;">In</span><span style="color: #000000;">&#93;</span> <span style="color: #0600FF;">ref</span> <span style="color: #FF0000;">uint</span> pcFonts<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #000000;">&#91;</span>DllImport<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;gdi32&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span><span style="color: #0600FF;">return</span><span style="color: #008000;">:</span> MarshalAs<span style="color: #000000;">&#40;</span>UnmanagedType.<span style="color: #FF0000;">Bool</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">extern</span> <span style="color: #FF0000;">bool</span>
 RemoveFontMemResourceEx<span style="color: #000000;">&#40;</span>IntPtr fh<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>In our Windows Forms application, the best place to initialize the custom font(s) is from the class constructor of the main form used in the application. From here, we&#8217;re going to need to do a couple of things:</p>
<ul>
<li>Create a new System.Drawing.Text.PrivateFontCollection instance which will store our dynamically-loaded font(s).</li>
<li>Tell the garbage collector to pin down the font&#8217;s binary data in memory so Windows can access it from outside our .NET managed bubble.</li>
<li>Add the font handle to our private font collection (in memory).</li>
<li>Register the font with Windows using the AddFontMemResourceEx function call.</li>
</ul>
<p>The following code demonstrates the above description:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Drawing</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Drawing.Text</span><span style="color: #008000;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #008080; font-style: italic;">/* Member Variables */</span>
<span style="color: #0600FF;">private</span> PrivateFontCollection m_PFC<span style="color: #008000;">;</span>
<span style="color: #0600FF;">private</span> GCHandle              m_pFont<span style="color: #008000;">;</span>
<span style="color: #0600FF;">private</span> IntPtr                m_hFont<span style="color: #008000;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #008080; font-style: italic;">// Somewhere called from the form constructor...</span>
m_PFC <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> PrivateFontCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #FF0000;">int</span>  rsxLen  <span style="color: #008000;">=</span> Properties.<span style="color: #0000FF;">Resources</span>.<span style="color: #0000FF;">ClientFont</span>.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
     m_pFont <span style="color: #008000;">=</span> GCHandle.<span style="color: #0000FF;">Alloc</span><span style="color: #000000;">&#40;</span>Properties.<span style="color: #0000FF;">Resources</span>.<span style="color: #0000FF;">MyFont</span>, GCHandleType.<span style="color: #0000FF;">Pinned</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     m_PFC.<span style="color: #0000FF;">AddMemoryFont</span><span style="color: #000000;">&#40;</span>m_pFont.<span style="color: #0000FF;">AddrOfPinnedObject</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, rsxLen<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #FF0000;">uint</span> rsxCnt  <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">/* We're only installing one font. */</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// This is where we do the actual &quot;registration&quot; to get the font handle</span>
m_hFont      <span style="color: #008000;">=</span> AddFontMemResourceEx<span style="color: #000000;">&#40;</span>m_pFont.<span style="color: #0000FF;">AddrOfPinnedObject</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,
                                    <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">uint</span><span style="color: #000000;">&#41;</span>rsxLen, IntPtr.<span style="color: #0000FF;">Zero</span>, <span style="color: #0600FF;">ref</span> rsxCnt<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>In this example, we&#8217;re just going to register a single font called MyFont from the application resources class. To add multiple fonts, we would just need to create a font handle to each font we wish to add, create a pinned GC handle to it, add it to the private font collection and register it using AddFontMemResourceEx. Lather, rinse, repeat.</p>
<h1>Creating the Font</h1>
<p>Now that Windows knows about our custom font, all we have to do now is create a System.Drawing.Font instance of it so we can use it in our form controls (and whatever else). The private font collection allows us to iterate over all the System.Drawing.FontFamily objects available from the font(s) we&#8217;ve added. It is important to note that since not all fonts support all font styles (Regular, Bold, Italic, etc), we have to make sure the font we&#8217;re going to create supports the style we wish to use &#8211; otherwise, we&#8217;ll end up with a default fallback font.</p>
<p>The following code demonstrates how we can create a font we registered from the previous example:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">...
&nbsp;
<span style="color: #008080; font-style: italic;">/* Member Variables */</span>
<span style="color: #0600FF;">private</span> Font m_Font<span style="color: #008000;">;</span>
&nbsp;
...
&nbsp;
<span style="color: #0000FF;">FontFamily</span> ff <span style="color: #008000;">=</span> m_PFC.<span style="color: #0000FF;">Families</span><span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">/* I know, bad practice. */</span>
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>ff.<span style="color: #0000FF;">IsStyleAvailable</span><span style="color: #000000;">&#40;</span>FontStyle.<span style="color: #0000FF;">Regular</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    m_Font <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Font<span style="color: #000000;">&#40;</span>ff, 7f, FontStyle.<span style="color: #0000FF;">Regular</span>, GraphicsUnit.<span style="color: #0000FF;">Point</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">else</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// ...cry...</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now that we have an instance of System.Drawing.Font, we can pass this into any control and presto-chango, our font should show up:</p>
<p><img class="aligncenter" title="Application Screenshot" src="http://rsx.matevarga.com/downloads/articles/custom-embedded-fonts/screenshot.png" alt="" width="385" height="300" /></p>
<h1>Clean Up</h1>
<p>Before the application exits, it is important to properly dispose of any unmanaged handles we were using. Remember the RemoveFontMemResourceEx function mentioned earlier? This is where will will be using it. The following example demonstrates the very simple clean-up process:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> Dispose<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">bool</span> disposing<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #008080;">#region Release Managed</span>
    <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>disposing <span style="color: #008000;">&amp;&amp;</span> <span style="color: #000000;">&#40;</span>components <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        components.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080;">#region Release Unmanaged</span>
    m_PFC.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    m_pFont.<span style="color: #0000FF;">Free</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    RemoveFontMemResourceEx<span style="color: #000000;">&#40;</span>m_hFont<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span>disposing<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>First we dispose of all the managed components (as usual) and then we clean up the objects we allocated for the font(s). We just dispose of the private font collection, the GC handle to the font data and finally remove the font handle from memory (unregistration). Not much to it at all.</p>
<h1>Credits</h1>
<p>Barcode Font: Anke Arnold &#8211; <a href="http://www.anke-art.de" target="_blank">www.anke-art.de</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/embedding-fonts-into-windows-forms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox Gone Wild</title>
		<link>http://www.matevarga.com/firefox-gone-wild/</link>
		<comments>http://www.matevarga.com/firefox-gone-wild/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 14:08:13 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=66</guid>
		<description><![CDATA[After spending the better half of two days scraping a rootkit off my fiancee&#8217;s system, I think I need to reevaluate my position on Firefox being the safest browser ever. While browsing some fairly innocuous sites (artsy sites she frequents), she somehow managed to infect her entire system &#8211; in a matter of seconds &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-thumbnail wp-image-67 alignleft" title="Firefox Hurts" src="http://www.matevarga.com/wp-content/uploads/2009/11/firefox_hurts-150x150.png" alt="Firefox Hurts" width="111" height="111" /> After spending the better half of two days scraping a rootkit off my fiancee&#8217;s system, I think I need to reevaluate my position on <em>Firefox being the safest browser ever</em>. While browsing some fairly innocuous sites (artsy sites she frequents), she somehow managed to infect her entire system &#8211; in a matter of seconds &#8211; with some very nasty malware. This is what we call, drive-by-downloading &#8211; simply visiting an infected website and utterly compromising your system.</p>
<p><span id="more-66"></span></p>
<h1>Firefox, Not So Safe</h1>
<p>As Firefox becomes more prevalent, so do the exploits. Going back a few years, it wasn&#8217;t hard to entice us all with a browser that did such nifty tricks as stopping pop-up advertisements, not being so laughably exploitable and just plain performing faster. There were a few performance and security hiccups along the way, but overall, we were happy.</p>
<p>Early on, exploiting Firefox was left to hacker conferences where large bearded men with Linux laptops wrote complex proof-of-concept hacks to break through the boundaries of <strong>Firefox</strong> and <strong>System</strong>. Fundamentally, however, even the average user was safe from himself with Firefox. As popularity grew, malware authors began to take notice.</p>
<p>Browser development is akin to operating system development. It is terribly complex and tedious to develop. Just breaking into the market is difficult enough &#8211; even as I write this, a television somewhere is playing a Google Chrome ad. As complexity grows, so do the vulnerabilities &#8211; and someone, somewhere will have time/incentive/moral ambiguity to find and exploit them. The more eyes you have searching, the faster this process becomes.</p>
<p>Unfortunately, Firefox wasn&#8217;t written by cybernetic foxes from future. No, they were written by fallible humans who have had gone to bed at 5am the previous night because they had ran <a title="Oh Lawl" href="http://www.youtube.com/watch?v=5ilGGP9BDZs">out of coffee</a>. As a result, bugs and vulnerabilities are bound to occur. And while the Mozilla team are very good about releasing frequent patches, there always seem to be something else.</p>
<h1>The Infection</h1>
<p>The latest Firefox exploits I&#8217;ve seen come from JavaScript, Java and sometimes obscure things you wouldn&#8217;t expect like GIFs, PDFs and Flash. The malware my fiancee&#8217;s system encountered, however, likely came from a JavaScript exploit. Although I am uncertain of the exact means her machine became infected, the immediate sign was unmistakable:</p>
<p style="text-align: center;"><img class="size-full wp-image-68  aligncenter" title="ANG Antivirus (Malware)" src="http://www.matevarga.com/wp-content/uploads/2009/11/ang_antivirus.jpg" alt="ANG Antivirus (Malware)" width="520" height="362" /></p>
<p>A program that suddenly appears on the screen claiming to be a virus scanner&#8230;<em>which you didn&#8217;t install</em>&#8230;is a pretty good indication you&#8217;re system has been compromised. But, as it turns out, this was just one of the many <em>friends </em>the original virus invited to join the party. Overall, her system became infected with 18 different virus and virus traces, according to the initial <em><strong>real </strong></em>malware scanner used.</p>
<h1>So, what now?</h1>
<p>Short of ripping out the network card and ceremoniously launching it into the sun, the best thing to do now is to enact some preventive measures. But finding the balance between crippling the user experience and not doing enough is a difficult task indeed. What are the options?</p>
<p>Disable Java. This is simple enough and not all too inconvenient as not too many sites directly use Java to serve content. If there is a site I know that requires it, and it is a site I trust, it is easy enough to turn it back on.</p>
<p>While tempting, disabling JavaScript is out of the picture. Thanks to Web 2.0, there are very few sites (especially community and media-heavy) that will work (properly, if at all) without JavaScript. The alternative is to install the [terribly inconvenient] <a title="No Script Plug-In" href="https://addons.mozilla.org/en-US/firefox/addon/722">NOSCRIPT</a> Firefox plug-in. Even though it is better than nothing, there are still ways around it as it too has vulnerabilities.</p>
<p>If you&#8217;re good at staying away from the seedier parts of the Internet, you still have to worry about well-known sites being compromised either by getting entirely hacked or having one of their ad networks compromised or going rogue. To further secure your browser, <a title="Flash Block Plug-In" href="https://addons.mozilla.org/en-US/firefox/addon/433">Flashblock</a> will disable any Flash animation until you click on it (which is also good for getting rid of some truly annoying and sometimes noisy ads).</p>
<p>With those plug-ins (and some common sense), you&#8217;re likely in good shape. By diminishing the ability for client-side execution of just about <em>anything</em> (which mostly includes Java, JavaScript and Flash), you&#8217;re chances of picking up drive-by-downloaded malware also diminish. If you absolutely must visit a questionable site, use a virtual machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/firefox-gone-wild/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Full Speed Ahead!</title>
		<link>http://www.matevarga.com/full-speed-ahead/</link>
		<comments>http://www.matevarga.com/full-speed-ahead/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 00:32:54 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=58</guid>
		<description><![CDATA[It would appear, I&#8217;m (just about) ready to go public. Now with the site template coding and skinning out of the way, I should now be able to focus entirely on content. I&#8217;ll be passing around the URL on a limited-release basis to get some feedback about the looks, navigation and any browser bugs. From [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-59" title="Hard Work" src="http://www.matevarga.com/wp-content/uploads/2009/11/HardWork.jpg" alt="Hard Work" width="159" height="106" />It would appear, I&#8217;m (just about) ready to <em>go public</em>. Now with the site template coding and skinning out of the way, I should now be able to focus entirely on content. I&#8217;ll be passing around the URL on a limited-release basis to get some feedback about the looks, navigation and any browser bugs. From my own testing (FF 3.5, IE6, 7, 8), I think this site should work with the majority of browsers out there &#8211; it is <a title="The W3C Markup Validation Service" href="http://validator.w3.org/check/referer" target="_blank">W3C complaint</a> after all (not that it means anything to IE).</p>
<p><span id="more-58"></span></p>
<h1>Topic Hierarchy</h1>
<p>I wanted to partition the blog into different top-level categories where each category is tied to the page being viewed. You&#8217;re currently reading this post under the &#8220;Home&#8221; category&#8217;s General topic group. If you were to switch to the projects or articles page, you&#8217;ll only see the posts under their respective top-level category pages (Projects &amp; Articles). So, this makes the site map look somewhat like this:</p>
<p style="padding-left: 30px;"><strong>Home:</strong> Typical blogging topics, such as general, news, politics, technology, etc.<br />
<strong>Projects:</strong> Project &#8220;micro-blogs&#8221; for each project I&#8217;m working on.<br />
<strong>Articles:</strong> My professional opinion/insights into the various technical topics I&#8217;ll be writing about.</p>
<h1>Demographic</h1>
<p>Primarily, this is a technically-oriented blog. As such, I <em>will</em> be posting a lot of heavy-duty technical information aimed at software engineers. With that said, this is also my personal blog, so I will be posting about not-so-technical opinions and articles here (including politics). Buyer beware, I&#8217;m liberal-minded and I share many of the views of my fellow liberal, left-wing thinkers &#8211; not saying I don&#8217;t have an open mind, though. So, if you like any of these kinds of topics:</p>
<ul>
<li>Computer Technology (Hardware, Software).</li>
<li>Software Engineering.</li>
<li>Robotics.</li>
<li>Politics.</li>
<li>Lime-Jello.</li>
</ul>
<p>&#8230;you may like this site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/full-speed-ahead/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Welcome Aboard!</title>
		<link>http://www.matevarga.com/welcome-aboard/</link>
		<comments>http://www.matevarga.com/welcome-aboard/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 13:57:08 +0000</pubDate>
		<dc:creator>Máté Varga</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.matevarga.com/?p=1</guid>
		<description><![CDATA[Welcome Aboard, Internet User! You have reached the website of Máté Varga (as you may have noticed from the prominently displayed point-55 font in the header! Take a look. I&#8217;ll wait). If you&#8217;re reading this NOW, you&#8217;ve probably arrived here by Googling my name. If you&#8217;re reading this in the future, well, you have a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="Welcome Aboard!" src="http://www.matevarga.com/wp-content/uploads/2009/11/RMSTitanic-300x210.gif" alt="Welcome Aboard!" width="143" height="99" />Welcome Aboard, Internet User! You have reached the website of Máté Varga (as you may have noticed from the prominently displayed point-55 font in the header! Take a look. I&#8217;ll wait). If you&#8217;re reading this NOW, you&#8217;ve probably arrived here by Googling my name. If you&#8217;re reading this in the future, well, you have a very impressive set of skills.</p>
<p>I&#8217;ve created this website for three reasons: 1) Enhance the Googability of my name for employment, fame, fortune and free candy, 2) have a place where I can write articles that, maybe, some people may find useful, and 3) have a place to share my projects.</p>
<p>Well, now that we have become acquainted, Internet User, hopefully my efforts will prove to bring you back for more. Or something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.matevarga.com/welcome-aboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
