<?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>Tadas Vilkeliskis</title>
	<atom:link href="http://tadas.vilkeliskis.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tadas.vilkeliskis.com</link>
	<description></description>
	<lastBuildDate>Wed, 25 Aug 2010 07:00:52 +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>I am not dead, but only trying something new!</title>
		<link>http://tadas.vilkeliskis.com/2010/08/i-am-not-dead-but-only-trying-something-new/</link>
		<comments>http://tadas.vilkeliskis.com/2010/08/i-am-not-dead-but-only-trying-something-new/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:24:53 +0000</pubDate>
		<dc:creator>Tadas</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[startup]]></category>

		<guid isPermaLink="false">http://tadas.vilkeliskis.com/?p=48</guid>
		<description><![CDATA[It&#8217;s been a while since my last post. A few things (small) has changed in my life since then, including the type of information I consume which shifted drastically. I am a very technology oriented person and this makes me kinda geeky by definition. All my friends know that I am good with computers and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post. A few things (small) has changed in my life since then, including the type of information I consume which shifted drastically.</p>
<p>I am a very technology oriented person and this makes me kinda geeky by definition. All my friends know that I am good with computers and programming. For those who don&#8217;t know me, do you think it&#8217;s because I study hard at college? No, it&#8217;s because in my childhood I was so attracted to computers that video games were not cutting it anymore, so I found programming and I got hooked. I read so many books and articles on programming and that&#8217;s what made me so good at it. However, now I try to read technical material as little as possible, and it&#8217;s not because I don&#8217;t want to grow, it&#8217;s because I changed my priorities and I have to grow in a different area of interest.</p>
<p>My current area of interest is business. Why did I made such a change? Let&#8217;s go back to one of my dreams first. About four years ago when I entered the university to study computer science, I thought that college is the last step I have to take, and after I graduate great job awaits me at a big company. Does this sound familiar to you? The main reason why I switched from one topic to another is that I don&#8217;t like following rules, and a big company will have a huge rule book. So, I changed my dream of becoming a good programmer at a big company to becoming a business owner. For this to work I have to totally change my environment. I can&#8217;t remember what I read but I memorized the following quote: spend one hour every day on a topic of your interest and after five years you will be a master of that specific topic. So, I started with exposing myself to business related information: books, twitter streams, magazines etc.</p>
<p>During the summer I read three books whose titles I would like to share with you.</p>
<ul>
<li><em>Getting Real: The smarter, faster, easier way to build a successful web application</em> by 37signals.</li>
<li><em>REWORK</em> by Jason Fried and David Heinemeier Hansson.</li>
<li><em>Linchpin: Are you indispensable?</em> by Seth Godin.</li>
</ul>
<p>All these books are business books. Let&#8217;s start with <em><a href="http://gettingreal.37signals.com/">Getting Real</a></em> and <em><a href="http://37signals.com/rework/">REWORK</a></em>. <em>REWORK</em> actually is a revamped and extended version of Getting Real. If you are planning to buy one of these get <em>REWORK</em>. In <em>REWORK</em> authors talk about common mistakes that startups do. If you are familiar with <a href="http://37signals.com/">37signals</a> practices you know that they go for simplicity and clarity in both their applications and business environment. If you are like me and know nothing about business you must read it &#8212; it will completely change the way you think about starting a business (especially web/software).  I was working for a startup this summer and was able to see some of the mistakes that were covered in REWORK. For example, we had meetings twice a week where we had to update our status because there was some higher power involved in the company. The length of a meeting ranged from one to three hours which is a complete waste of time, and <em>REWORK</em> nicely explains why &#8220;meetings are toxic&#8221;. Read this book!</p>
<p><em><a href="http://www.sethgodin.com/sg/">Linchpin</a></em> is another great book. It&#8217;s main purpose is to make the reader unleash the artist within. As the author says: we&#8217;ve been brainwashed. We are constantly being brainwashed by our friends, family, school, colleagues who say that we have to follow the rules in order to secure our future. The book tries to engrave the exact opposite on the reader&#8217;s mind. In order to secure your future you have to become an artist: you have to take an extra step that makes your work flawless or brings joy to people. The reason for taking this step is that it&#8217;s the only thing that keeps you in your job or makes you a competitor of huge companies who have power to deliver goods fast and at low cost. <em>Linchpin</em> is a very inspirational book.</p>
<p>I hope you will be able to read these books. They are really worth your time. I have a few more books on my reading list which I am planning to cover here after I finish reading them. I also found this very interesting site called <a href="http://thestartupdigest.com/">StartupDigest</a>. If you subscribe you will receive an email once in a while with upcoming startup events in your area. Maybe I will meet you in one of these! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://tadas.vilkeliskis.com/2010/08/i-am-not-dead-but-only-trying-something-new/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a personal virtual machine for code obfuscation purposes</title>
		<link>http://tadas.vilkeliskis.com/2010/01/creating-a-personal-virtual-machine-for-code-obfuscation-purposes/</link>
		<comments>http://tadas.vilkeliskis.com/2010/01/creating-a-personal-virtual-machine-for-code-obfuscation-purposes/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 00:44:13 +0000</pubDate>
		<dc:creator>Tadas</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[obfuscation]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[virtual machine]]></category>

		<guid isPermaLink="false">http://tadas.vilkeliskis.com/?p=7</guid>
		<description><![CDATA[When talking about the protection of intellectual property, virtual machines and custom instruction set can play a very important role in the field. One of the ways to protect your algorithm from curious eyes is to use code obfuscation techniques. These can range from a simple instruction reordering to a more sophisticated control flow modifications [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When talking about the protection of intellectual property, virtual machines and custom instruction set can play a very important role in the field. One of the ways to protect your algorithm from curious eyes is to use code obfuscation techniques. These can range from a simple instruction reordering to a more sophisticated control flow modifications and added layer of custom instruction set, or a combination of both. Recently I&#8217;ve watched a video about virtual machines for code obfuscation from <a href="http://recon.cx/">RECON</a> video <a href="http://www.archive.org/details/RECON2008">archives</a>. The speaker said that his implementation is available for download at his website for those who want to experiment; however, I could not find it so I&#8217;ve decided to implement my own compiler and virtual machine (vm).</p>
<p style="text-align: justify;">The code of the compiler and testing version of the vm is available for download from <a href="http://github.com/tadasv/vms/">github</a>. I am not going to explain how they are implemented but I will explain how one can create his custom instruction set by extending the compiler and how to write code that compiler understands.</p>
<p style="text-align: justify;">The compiler was written in python because it makes the work with text and strings trivial. There are three files: compiler.py, vmc.py and myis.py. The compiler.py is basically the class that provides all the logic: lexical analysis, compiling, linking, etc. The parser in the compiler does not support comments. So, if you are going to write anything longer than my factorial example you may get lost in the code. The compiler only supports 7 types of tokens where each token is separated by a white space:</p>
<ul>
<li>instruction &#8211; an instruction (see myis.py instructions variable).</li>
<li>register &#8211; a register (see myis.py registers variable).</li>
<li>@register &#8211; a register that holds memory address and will be dereferenced by the virtual machine.</li>
<li>immediate &#8211; an immediate value. Syntax: int(&lt;number&gt;) where &lt;number&gt; can be a number in any format supported by python.</li>
<li>label &#8211; a label. Syntax &lt;name&gt;:</li>
<li>reference &#8211; any name that does not fall under the instruction and register categories. Usually a label without a colon.</li>
<li>string &#8211; a sequence of bytes. Syntax str(&lt;string&gt;) where &lt;string&gt; is any string supported by python.</li>
</ul>
<p style="text-align: justify;">A sample program that computes factorial can be found at github with the rest of the code; the syntax should become more clear by looking at it. However, you should be aware when using int() and str(); whatever will be inside the parenthesis is going to be evaluated by the python interpreter. Furthermore, int() and str() cannot take an argument with white space. For example, instead of str(&#8220;hello world&#8221;) you should use str(&#8220;hello\x20world&#8221;).</p>
<p style="text-align: justify;">First let&#8217;s look how one can extend the instruction set by modifying myis.py.</p>
<pre style="overflow: scroll;">registers = ["eax", "ebx", "ecx", "edx", "esp", "ebp", "esi", "edi"]
instructions = {
    "push"  : [{"opcode" : 0x00, "format" : "&lt;cc", "params" : ["reg"]}],
    "pop"   : [{"opcode" : 0x01, "format" : "&lt;cc", "params" : ["reg"]}],
    "mov"   : [{"opcode" : 0x02, "format" : "&lt;ccI", "params" : ["reg", "imm"]},
               {"opcode" : 0x03, "format" : "&lt;ccc", "params" : ["reg", "reg"]},
               {"opcode" : 0x04, "format" : "&lt;ccc", "params" : ["reg", "@reg"]},
               {"opcode" : 0x05, "format" : "&lt;ccc", "params" : ["@reg", "reg"]},
               {"opcode" : 0x06, "format" : "&lt;ccI", "params" : ["reg", "ref"]}
],
...
}</pre>
<p style="text-align: justify;">Above you can see an excerpt from myis.py which contains two variables: registers and instructions. The registers variable is a list containing all valid registers that tokenizer will recognize. If the order of registers is changed the compiler will generate different instruction opcodes because it refers to registers by their position in the array. The instruction variable is a map table (dictionary in python terms) where each keyword is a name of an instruction mapping to a list that contains one or more dictionaries. Each inner dictionary has three keys:</p>
<ul>
<li>opcode &#8211; an opcode number.</li>
<li>format &#8211; an instruction encoding format. See <a href="http://docs.python.org/library/struct.html">python struct</a>.</li>
<li>params &#8211; a list of parameters (in exact order) the instruction takes. Valid values are: reg, @reg, ref, imm, str. See tokens above for more details.</li>
</ul>
<p style="text-align: justify;">Sometimes an instruction can have multiple dictionaries as mov does in the above example. This should be only the case when instruction can take different set of arguments; then the compiler will iterate through till it finds the right match. There is also a special instruction defined in the myis.py &#8211; emit. The emit takes a string as an argument and emits bytes into the code. This can be useful if you want to make code overlap, reserve space for variables, or just manually inject bytes in the code. When using references as arguments the address of the reference will be translated to an offset relative to the instruction pointer. Simply by modifying myis.py you can introduce new instructions to the compiler; then write the code and compile it with vmc.py.</p>
<p style="text-align: justify;">Once you have the bytecode the final step is to write a vm that will read it and execute the encoded instructions. Among the source files I have included a very basic sample vm that will execute the factorial program. The implementation is pretty straightforward.</p>
<p style="text-align: justify;">Hopefully I have covered everything and didn&#8217;t miss any parts of the compiler&#8217;s logic. The source code I provide is highly experimental and it should have tons of bugs; nevertheless, it should give a good starting base to those who would like to write their own compiler and a vm.</p>
]]></content:encoded>
			<wfw:commentRss>http://tadas.vilkeliskis.com/2010/01/creating-a-personal-virtual-machine-for-code-obfuscation-purposes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world! One more time&#8230;</title>
		<link>http://tadas.vilkeliskis.com/2009/08/hello-world/</link>
		<comments>http://tadas.vilkeliskis.com/2009/08/hello-world/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 11:48:36 +0000</pubDate>
		<dc:creator>Tadas</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://tadas.vilkeliskis.com/?p=1</guid>
		<description><![CDATA[This is probably my third attempt to create and maintain a personal website. There are a few notes that I would like to make. First of all, the web page will be entirelly in English, so please don&#8217;t laugh too much if I&#8217;ll write something silly. Next thing—no comments. I chose to disable comments since [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This is probably my third attempt to create and maintain a personal website. There are a few notes that I would like to make. First of all, the web page will be entirelly in English, so please don&#8217;t laugh too much if I&#8217;ll write something silly. Next thing—no comments. I chose to disable comments since I don&#8217;t really see any real use of them. Just a waste of space and incoming spam. For those who want to contact me, you can do that by picking up a contact method from the About page.</p>
<p style="text-align: justify;">The website will be used to keep all things related to me in one place for easy access. At the moment there aren&#8217;t much of the stuff yet, but eventually there will. What concerns the blog, I am planning to keep it more technical, however personal things might also pop out.</p>
<p style="text-align: justify;">Finally, I hope you will find something useful here and don&#8217;t hesitate to drop me a line.</p>
<p><em>Edit: I switched to WordPress and decided to make comments open after looking at the trafic logs.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://tadas.vilkeliskis.com/2009/08/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
