<?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>Dennis Theurer</title>
	<atom:link href="http://www.dennistheurer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dennistheurer.com</link>
	<description></description>
	<lastBuildDate>Sun, 28 Nov 2010 22:35:07 +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>My First Publication</title>
		<link>http://www.dennistheurer.com/2010/10/my-first-publication/</link>
		<comments>http://www.dennistheurer.com/2010/10/my-first-publication/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 17:56:42 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=128</guid>
		<description><![CDATA[It is official, I published my first conference paper: Theurer, D.; Kennedy, M.; Venkataraman, H. and Muntean, G.M. “Analysis of individual energy consuming components in a wireless handheld device”, in Proceedings of China Ireland International Conference on Information Technology (CIICT 2010), Wuhan, China, Oct. 8-9, 2010. This paper is the result of my research of [...]]]></description>
			<content:encoded><![CDATA[<p>It is official, I published my first conference paper:</p>
<p><strong>Theurer, D.</strong>; Kennedy, M.; Venkataraman, H. and Muntean, G.M. “Analysis of individual energy consuming components in a wireless handheld device”, in <em>Proceedings of China Ireland International Conference on Information Technology (CIICT 2010)</em>, Wuhan, China, Oct. 8-9, 2010.</p>
<p>This paper is the result of my research of my <a href="http://www.dennistheurer.com/2010/08/summer-research-internship-2010/">summer internship</a>. I would like to thank my supervisors for their great support! Unforunately funding did not allow me to attend the conference in China myself. I prepared the presentation slides and Mr. Zhenhui Yuan, a PhD student in DCU, who attended the conference was so kind to present my paper. Thanks a lot!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2010/10/my-first-publication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer Research Internship 2010</title>
		<link>http://www.dennistheurer.com/2010/08/summer-research-internship-2010/</link>
		<comments>http://www.dennistheurer.com/2010/08/summer-research-internship-2010/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 16:30:45 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Internship]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=101</guid>
		<description><![CDATA[This summer I was given the opportunity to take part in a summer research internship called Online Dublin Computer Science Summer School (ODCSSS or Odysseus). It is a joint programme by the Dublin City University (DCU) and University College of Dublin (UCD) and funded by the Science Foundation Ireland. During ten weeks of work in [...]]]></description>
			<content:encoded><![CDATA[<p>This summer I was given the opportunity to take part in a summer research internship called Online Dublin Computer Science Summer School (ODCSSS or Odysseus). It is a joint programme by the Dublin City University (DCU) and University College of Dublin (UCD) and funded by the Science Foundation Ireland. During ten weeks of work in DCU I gained first-hand experience in research.</p>
<p><span id="more-101"></span></p>
<div id="attachment_111" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-odcsss" href="http://www.dennistheurer.com/wp-content/uploads/nexusone-e1290359212402.jpg"><img class="size-thumbnail wp-image-111" title="nexusone" src="http://www.dennistheurer.com/wp-content/uploads/nexusone-150x112.jpg" alt="" width="150" height="112" /></a><p class="wp-caption-text">Energy measurements on a Nexus One using an Arduino</p></div>
<p>My project involved measuring the energy consumption of a Nexus One phone and breaking it down into individual components. The analysis will then help to implement an algorithm for video streaming that will assure that a video stream can be played before battery depletion and to maximize the ratio of quality to energy consumption.</p>
<p>I suppose many students will face the decision of whether to go into industry or pursue research. Industry appears to promise better and more stable incomes but research seems to be more interesting in that your research projects can be diverse and in an area of your interest. You enjoy a greater freedom over both your work schedule as well as the content of your work. This of course comes with responsibilities to make progress and deliver results.</p>
<div id="attachment_114" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-odcsss" href="http://www.dennistheurer.com/wp-content/uploads/odcsss-e1290359711708.jpg"><img class="size-thumbnail wp-image-114" title="odcsss" src="http://www.dennistheurer.com/wp-content/uploads/odcsss-150x112.jpg" alt="" width="150" height="112" /></a><p class="wp-caption-text">Me during poster presentations</p></div>
<p>The greatest challenge I faced in my internship was the fact that rather than looking for an answer to a predefined question, the question itself was not always clear. This left me at times confused over what is the next step as the path of project was not laid out for me but I had to discover it for myself. Another challenge is presenting and defending your project in front of an audience. I left the internship in good spirits, being awarded a certificate for giving one of the five best final presentations and a prize for the best overall project.</p>
<div id="attachment_117" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-odcsss" href="http://www.dennistheurer.com/wp-content/uploads/certificate-e1290360473104.jpg"><img class="size-thumbnail wp-image-117 " title="certificate" src="http://www.dennistheurer.com/wp-content/uploads/certificate-150x106.jpg" alt="" width="150" height="106" /></a><p class="wp-caption-text">Best Overall Project</p></div>
<p>Overall, I gained a good impression of research that, I am sure, will assist me in my decision for the route I take after my graduation. I can definitely recommend such an internship to anyone who is seriously considering going into research. For the next summer I am aiming for an industry internship so that I can be sure to make the right choice.</p>
<p>I would like to thank Gabriel Muntean for organizing this internship and Martin Kennedy, my supervisor, for his great guidance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2010/08/summer-research-internship-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Award</title>
		<link>http://www.dennistheurer.com/2010/05/website-award/</link>
		<comments>http://www.dennistheurer.com/2010/05/website-award/#comments</comments>
		<pubDate>Mon, 17 May 2010 20:29:33 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=217</guid>
		<description><![CDATA[The website I created for the Japanese Society of Trinity College Dublin (TCD) was awarded the Website of the Year award in the Society of the Year Awards 2010. The central societies committee of TCD annually awards prizes to the university&#8217;s societies in a few categories, one of them being for the best website. I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dennistheurer.com/wp-content/uploads/award.jpg" rel="lightbox"><img src="http://www.dennistheurer.com/wp-content/uploads/award-116x150.jpg" alt="" title="award" width="116" height="150" class="alignright size-thumbnail wp-image-214" /></a> The <a href="http://www.dennistheurer.com/work/web-development/japanese-society/">website</a> I created for the Japanese Society of Trinity College Dublin (TCD) was awarded the <em>Website of the Year</em> award in the <em>Society of the Year Awards 2010</em>. The central societies committee of TCD annually awards prizes to the university&#8217;s societies in a few categories, one of them being for the best website.</p>
<p>I was aiming for this award when I was asked to create the website by the Japanese Society. Given all the effort it took I am happy that the website is appreciated like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2010/05/website-award/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer 09: Vacation Japan</title>
		<link>http://www.dennistheurer.com/2009/11/summer-09-vacation-japan/</link>
		<comments>http://www.dennistheurer.com/2009/11/summer-09-vacation-japan/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 11:48:20 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Japan]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=177</guid>
		<description><![CDATA[After my work camp I spent another five weeks travelling around Japan. Eriko, a friend from college, was so kind to let me stay with her and her parents for a week in Hiratsuka which is not far from Tokyo. During that week I often visited Tokyo, sometimes alone, sometimes with friends I made in [...]]]></description>
			<content:encoded><![CDATA[<div class="float"><div id="attachment_178" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan001.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan001-150x112.jpg" alt="" title="japan001" width="150" height="112" class="size-thumbnail wp-image-178" /></a><p class="wp-caption-text">Shibuya, Tokyo</p></div> <div id="attachment_179" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan002.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan002-150x112.jpg" alt="" title="japan002" width="150" height="112" class="size-thumbnail wp-image-179" /></a><p class="wp-caption-text">Shibuya at night</p></div> <div id="attachment_181" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan005.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan005-150x112.jpg" alt="" title="japan005" width="150" height="112" class="size-thumbnail wp-image-181" /></a><p class="wp-caption-text">Shinjuku, Tokyo</p></div> </div>
<p>After my <a href="http://www.dennistheurer.com/2009/11/summer-09-work-camp-japan/">work camp</a> I spent another five weeks travelling around Japan. Eriko, a friend from college, was so kind to let me stay with her and her parents for a week in Hiratsuka which is not far from Tokyo. During that week I often visited Tokyo, sometimes alone, sometimes with friends I made in the work camp. Eriko guided me around Kamakura and Enoshima. Before I would leave for a journey by myself, we visited Hakone where we watched fireworks during the Bon festival.</p>
<p><span id="more-177"></span></p>
<div class="float"> <div id="attachment_180" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan003.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan003-150x112.jpg" alt="" title="japan003" width="150" height="112" class="size-thumbnail wp-image-180" /></a><p class="wp-caption-text">Enoshima near Kamakura</p></div> <div id="attachment_183" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan008.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan008-150x112.jpg" alt="" title="japan008" width="150" height="112" class="size-thumbnail wp-image-183" /></a><p class="wp-caption-text">If you look close, you can see Mt Fuji far in the distance</p></div> <div id="attachment_184" class="wp-caption alignleft" style="width: 122px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan009.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan009-112x150.jpg" alt="" title="japan009" width="112" height="150" class="size-thumbnail wp-image-184" /></a><p class="wp-caption-text">Fireworks! (Hakone)</p></div> </div>
<p>For the following two weeks I used a Japan Rail Pass to travel the west of Japan. I did not know where my trip would take me as I hadn&#8217;t planned it but I would decide my next destinations about two days in advance. Like this I was flexible and could follow recommendations I got from other tourists and locals. My first stop was Nagoya. After an evening of exploring Nagoya by myself I met two nice Koreans in the hostel and we spent the following day sightseeing.</p>
<p>My next stop was Kyoto. From the first moment Kyoto impressed me a lot. Compared to other cities it seems to be the most popular tourist destination and there are times when I saw more foreigners than Japanese in the streets. Beside all the temples and shrines (which I tried to rush through in one day), I will remember Kyoto for its beautiful and atmospheric alleys. I can absolutely understand why it is so highly recommended to every Tourist! Taking a stroll at night through the dark alleys made me feel like being in a different world. The occasional Maiko crossing your way is the icing on the cake!</p>
<div class="float"> <div id="attachment_185" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan010.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan010-150x112.jpg" alt="" title="japan010" width="150" height="112" class="size-thumbnail wp-image-185" /></a><p class="wp-caption-text">Nagoya castle</p></div> <div id="attachment_186" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan011.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan011-150x112.jpg" alt="" title="japan011" width="150" height="112" class="size-thumbnail wp-image-186" /></a><p class="wp-caption-text">Kyoto</p></div> <div id="attachment_187" class="wp-caption alignleft" style="width: 122px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan012.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan012-112x150.jpg" alt="" title="japan012" width="112" height="150" class="size-thumbnail wp-image-187" /></a><p class="wp-caption-text">Maiko in Kyoto</p></div> </div>
<p>Osaka, the next stop on my trip, doesn&#8217;t quite captivate with beauty like Kyoto, but nevertheless left a very good impression. I really enjoyed how lively the city is, especially during the night. Before my vacation I decided that I definitely want to spend a night in a capsule hotel and so I did. And it was pretty great! The only downside is that unlike a hostel it is very difficult to meet people. Everything is fairly anonymous and it&#8217;s full of old business men. Luckily I was approached my a very friendly old Japanese man when I visited the Osaka castle (who unfortunately couldn&#8217;t speak any English) and he guided me around the city.</p>
<div class="float"> <div id="attachment_191" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan016.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan016-150x112.jpg" alt="" title="japan016" width="150" height="112" class="size-thumbnail wp-image-191" /></a><p class="wp-caption-text">Osaka at night</p></div> <div id="attachment_188" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan013.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan013-150x112.jpg" alt="" title="japan013" width="150" height="112" class="size-thumbnail wp-image-188" /></a><p class="wp-caption-text">Capsule hotel in Osaka</p></div> <div id="attachment_190" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan015.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan015-150x112.jpg" alt="" title="japan015" width="150" height="112" class="size-thumbnail wp-image-190" /></a><p class="wp-caption-text">Temple in Osaka</p></div> </div>
<p>After visiting Nara I decided that I had seen enough shrines and temples and instead followed a recommendation that I got from a guy I met in a bar in Osaka and made a day trip to Shirahama. That was exactly what I needed for a change: 35°C, sun, the sea and white sand imported from Australia. And so I took it easy before I continued my journey further west to Hiroshima.</p>
<div class="float"> <div id="attachment_189" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan014.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan014-150x112.jpg" alt="" title="japan014" width="150" height="112" class="size-thumbnail wp-image-189" /></a><p class="wp-caption-text">Okonomiyaki in Osaka</p></div> <div id="attachment_192" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan017.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan017-150x112.jpg" alt="" title="japan017" width="150" height="112" class="size-thumbnail wp-image-192" /></a><p class="wp-caption-text">Somewhere in Nara</p></div> <div id="attachment_193" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan018.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan018-150x112.jpg" alt="" title="japan018" width="150" height="112" class="size-thumbnail wp-image-193" /></a><p class="wp-caption-text">Beach in Shirahama</p></div> </div>
<p>In Hiroshima I met Kaori, a friend from college, and she guided me around the city. Her mother also took us to Miyajima (Itsukushima) to see the famous shrine as well as to the Kintai bridge in Iwakuni where we saw the white snakes in Kikko park.</p>
<div class="float"> <div id="attachment_194" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan019.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan019-150x112.jpg" alt="" title="japan019" width="150" height="112" class="size-thumbnail wp-image-194" /></a><p class="wp-caption-text">Hiroshima</p></div> <div id="attachment_195" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan020.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan020-150x112.jpg" alt="" title="japan020" width="150" height="112" class="size-thumbnail wp-image-195" /></a><p class="wp-caption-text">Itsukushima Shrine</p></div> <div id="attachment_196" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan021.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan021-150x112.jpg" alt="" title="japan021" width="150" height="112" class="size-thumbnail wp-image-196" /></a><p class="wp-caption-text">Kintai Bridge</p></div> </div>
<p>My final stop before making my way back to Tokyo was Beppu. I never heard of it before but a tourist in a hostel recommended it to me and as my rail pass was about to expire soon I had to choose between visiting Nagasaki and Beppu and went with the more exotic choice. I spent two nights there and visited some hot springs including a mud bath and the &#8220;sea hell&#8221;.</p>
<div class="float"> <div id="attachment_197" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan022.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan022-150x112.jpg" alt="" title="japan022" width="150" height="112" class="size-thumbnail wp-image-197" /></a><p class="wp-caption-text">Kikko Park in Iwakuni</p></div> <div id="attachment_198" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan023.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan023-150x112.jpg" alt="" title="japan023" width="150" height="112" class="size-thumbnail wp-image-198" /></a><p class="wp-caption-text">Sea hell in Beppu</p></div> <div id="attachment_199" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan025.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan025-150x112.jpg" alt="" title="japan025" width="150" height="112" class="size-thumbnail wp-image-199" /></a><p class="wp-caption-text">Hot spring with nice view</p></div> </div>
<p>After spending another night in Kyoto and visiting Osaka again where I had a good time with a German friend of mine I went back to Tokyo and finally met Hideo, a college friend and house mate, with whom I would spend my remaining two weeks. Together with another college friend and house mate Declan we would set off for many great adventures.</p>
<div class="float"> <div id="attachment_244" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan030.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan030-150x112.jpg" alt="" title="japan030" width="150" height="112" class="size-thumbnail wp-image-244" /></a><p class="wp-caption-text">Declan, Hideo and me on the top of Mt Fuji</p></div> <div id="attachment_201" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan028.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan028-150x112.jpg" alt="" title="japan028" width="150" height="112" class="size-thumbnail wp-image-201" /></a><p class="wp-caption-text">Sunrise!</p></div> <div id="attachment_202" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-jpn" href="http://www.dennistheurer.com/wp-content/uploads/japan029.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/japan029-150x112.jpg" alt="" title="japan029" width="150" height="112" class="size-thumbnail wp-image-202" /></a><p class="wp-caption-text">A meal in a Ryokan</p></div> </div>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2009/11/summer-09-vacation-japan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer 09: Work Camp Japan</title>
		<link>http://www.dennistheurer.com/2009/11/summer-09-work-camp-japan/</link>
		<comments>http://www.dennistheurer.com/2009/11/summer-09-work-camp-japan/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 21:23:42 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Japan]]></category>
		<category><![CDATA[Work camp]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=144</guid>
		<description><![CDATA[Far, far away in the hills of the Fukushima prefecture in Japan lies the village called Showa-mura that created many lasting memories for me. After spending one day in Tokyo the contrast could not have been bigger when I arrived in the village far off any cities and surrounded by rice fields and forest. Ten [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_149" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/showamura-e1290375468124.jpg"><img class="size-thumbnail wp-image-149 " title="showamura" src="http://www.dennistheurer.com/wp-content/uploads/showamura-150x112.jpg" alt="" width="150" height="112" /></a><p class="wp-caption-text">Showa-mura, Fukushima</p></div>
<p>Far, far away in the hills of the Fukushima prefecture in Japan lies the village called Showa-mura that created many lasting memories for me. After spending one day in Tokyo the contrast could not have been bigger when I arrived in the village far off any cities and surrounded by rice fields and forest. Ten days I would spend there together with a small group of foreigners like me and Japanese who all decided to do voluntary work.</p>
<p><span id="more-144"></span></p>
<div id="attachment_152" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/workcampgroup-e1290375829615.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/workcampgroup-150x100.jpg" alt="" title="workcampgroup" width="150" height="100" class="size-thumbnail wp-image-152" /></a><p class="wp-caption-text">The group of volunteers</p></div>
<p>Showa-mura suffers the fate of many villages in Japan: the youth moves to the cities leaving the elderly behind and without anybody to take over their farms. Without knowing any specifics about the Japanese pension system, many of the elderly seem to continue working past the retirement age and struggle to take care of their farm work. In order to help the locals and to give young people from the cities an insight into the life in the countryside, yearly work camps are organized. The labour of voluntary workers participating in the work camps is offered to the locals for a cheap price or even for free if the people in need are past a certain age. While for some of them the work is a great help, others are simply happy to have some young people around to talk to. The group of volunteers in my case consisted of 5 foreigners (including me) and 4 Japanese. Especially for us foreigners the trip to the Japanese countryside allowed us to experience Japan in a way that not every tourist has the opportunity to.</p>
<div id="attachment_153" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/cuttinggrass-e1290375986819.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/cuttinggrass-150x112.jpg" alt="" title="cuttinggrass" width="150" height="112" class="size-thumbnail wp-image-153" /></a><p class="wp-caption-text">Practice using the grass cutters</p></div>
<p>In exchange for their efforts the participants in the work camp are provided with free board and lodging. We stayed in a school building that due to the lack of children in the village was no longer in use. Apart from the work some social events were held including a visit to a hot spring, a museum, a wonderful lake surrounded by mountains as well as meetings with locals. Everybody was extremely friendly and happy to have us young people around and I truly enjoyed the Japanese hospitality.</p>
<div id="attachment_156" class="wp-caption alignright" style="width: 160px"><a href="http://www.dennistheurer.com/wp-content/uploads/junsai-e1290376356433.jpg" rel="lightbox-a"><img src="http://www.dennistheurer.com/wp-content/uploads/junsai-150x112.jpg" alt="" title="junsai" width="150" height="112" class="size-thumbnail wp-image-156" /></a><p class="wp-caption-text">A junsai field</p></div>
<p>The work was of agricultural nature. Specifically, this included cutting grass, transporting and cutting wood, weeding rice fields and planting <a rel="lightbox" href="http://www.dennistheurer.com/wp-content/uploads/junsai2-e1290376156939.jpg">junsai</a>. A typical work day would start from around 6 am and last six hours until 12 pm when the heat would make it difficult to work in the fields. The work was pretty hard indeed but as the volunteers consisted mostly of girls I should not complain. However, after a job done the appreciation by the locals and the good feeling of accomplishment you are left with are absolutely worth all the sweat.</p>
<div id="attachment_159" class="wp-caption alignright" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/ricefield-e1290376614799.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/ricefield-150x100.jpg" alt="" title="ricefield" width="150" height="100" class="size-thumbnail wp-image-159" /></a><p class="wp-caption-text">Weeding in a rice field (photo by Elsa Caron)</p></div>
<p>I made some great memories during my time in the work camp and I would absolutely do it again. In fact, I really want to do another work camp if I get another opportunity. I deliberately went with a short camp of only ten days because I was afraid I wouldn&#8217;t like it and at least ten days are easy to pass. And indeed they passed quickly, way to quickly in fact, and so my next camp should certainly be longer, maybe a month. I can wholeheartedly recommend participating in a camp to anyone who is interested. Just do it!</p>
<div class="float"> <div id="attachment_163" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/school-e1290377757195.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/school-150x112.jpg" alt="" title="school" width="150" height="112" class="size-thumbnail wp-image-163" /></a><p class="wp-caption-text">Bedroom in the school building</p></div> <div id="attachment_162" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/house-e1290377719286.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/house-150x112.jpg" alt="" title="house" width="150" height="112" class="size-thumbnail wp-image-162" /></a><p class="wp-caption-text">A Japanese house and garden</p></div> <div id="attachment_164" class="wp-caption alignleft" style="width: 160px"><a rel="lightbox-a" href="http://www.dennistheurer.com/wp-content/uploads/workcampgroup2-e1290377838382.jpg"><img src="http://www.dennistheurer.com/wp-content/uploads/workcampgroup2-150x100.jpg" alt="" title="workcampgroup2" width="150" height="100" class="size-thumbnail wp-image-164" /></a><p class="wp-caption-text">Our attempt at making a human pyramid</p></div> </div>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2009/11/summer-09-work-camp-japan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gateway to your code</title>
		<link>http://www.dennistheurer.com/2005/11/gateway-to-your-code/</link>
		<comments>http://www.dennistheurer.com/2005/11/gateway-to-your-code/#comments</comments>
		<pubDate>Sat, 05 Nov 2005 19:06:44 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=69</guid>
		<description><![CDATA[Note: this tutorial is a few years old. Please don&#8217;t expect me to answer any questions or give out code. What is this tutorial about? In this tutorial I want to show you how to modify another application to call a function in your injected DLL. I use the game Ragnarok Online as an example. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note: </strong>this tutorial is a few years old. Please don&#8217;t expect me to answer any questions or give out code.</p>
<h3>What is this tutorial about?</h3>
<p>In this tutorial I want to show you how to modify another application to call a function in your injected DLL. I use the game Ragnarok Online as an example. I want a function in my DLL to be called when I open a shop in the game. In my <a title="Calling a function of another program" href="http://www.dennistheurer.com/programming/calling-a-function-of-another-program/">last tutorial</a> you can see how I found the piece of code that is executed when a shop is opened.<br />
<span id="more-69"></span></p>
<h3>The method</h3>
<p>This is how it will work when we are finished:</p>
<ol type="1">
<li>At the address that you specify we jump to our code.</li>
<li>There we will call our &#8220;event&#8221; function.</li>
<li>Then we will execute the original code that we had to replace for the jump to our code&#8230;</li>
<li>&#8230;and finally jump back.</li>
</ol>
<p>Here is a simple flash that illustrates the method I just described.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="tut2_1" /><param name="bgcolor" value="#FFFFFF" /><param name="src" value="/upload/tut2_1.swf" /><embed type="application/x-shockwave-flash" width="400" height="200" src="/upload/tut2_1.swf" bgcolor="#FFFFFF" name="tut2_1"></embed></object></p>
<p>Now these are the steps I follow to code it.</p>
<ol type="1">
<li>Allocate memory for the gateway.</li>
<li>Write a call to your function into the allocated space.</li>
<li>Copy the piece of code where you want to create the link to your gateway into the allocated memory.</li>
<li>Write a jump back to the address after the link.</li>
<li>Create the link to the gateway.</li>
</ol>
<p>This was the short version, there is a lot you have to take care of as it is very critical to modify memory. One wrong command or wrong address will crash the application.</p>
<h3>The code</h3>
<p>I will give you my code for the gateway right away and explain it then.</p>
<p>The code is pretty easy but it is very important that you really get how the whole thing works.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> SetJumpgate <span style="color: #008000;">&#40;</span>BYTE <span style="color: #000040;">*</span>targetAdd, BYTE <span style="color: #000040;">*</span>funcAdd, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">int</span> len<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	BYTE <span style="color: #000040;">*</span>myAdd <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>BYTE<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #0000dd;">malloc</span><span style="color: #008000;">&#40;</span>len<span style="color: #000040;">+</span><span style="color: #0000dd;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	DWORD origProt<span style="color: #008080;">;</span>
	VirtualProtect<span style="color: #008000;">&#40;</span>targetAdd, len, PAGE_READWRITE, <span style="color: #000040;">&amp;</span>origProt<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	myAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE8</span><span style="color: #008080;">;</span>
	<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>funcAdd <span style="color: #000040;">-</span> myAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
	myAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000dd;">memcpy</span><span style="color: #008000;">&#40;</span>myAdd, targetAdd, len<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	myAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> len<span style="color: #008080;">;</span>
&nbsp;
	myAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE9</span><span style="color: #008080;">;</span>
	<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>targetAdd <span style="color: #000040;">+</span> len <span style="color: #000040;">-</span> myAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
&nbsp;
	targetAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE9</span><span style="color: #008080;">;</span>
	<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>targetAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span> <span style="color: #000040;">-</span> len <span style="color: #000040;">-</span> targetAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
	targetAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
&nbsp;
	<span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>len <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">5</span><span style="color: #008000;">&#41;</span>
		<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> len <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
			targetAdd<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0x90</span><span style="color: #008080;">;</span>
&nbsp;
	VirtualProtect<span style="color: #008000;">&#40;</span>targetAdd, len, origProt, <span style="color: #000040;">&amp;</span>origProt<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<h3>Explanation</h3>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">BYTE <span style="color: #000040;">*</span>myAdd <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>BYTE<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #0000dd;">malloc</span><span style="color: #008000;">&#40;</span>len <span style="color: #000040;">+</span> <span style="color: #0000dd;">10</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Here we allocate memory for the gateway (see step 1).</p>
<p>Remember: we want to write a call to our function (length 5), the code we are going to replace (length <code>len</code>) and a jump back (length 5) into the memory. Thus the length has to be 10 for the calls + <code>len</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">DWORD origProt<span style="color: #008080;">;</span>
VirtualProtect<span style="color: #008000;">&#40;</span>targetAdd, len, PAGE_READWRITE, <span style="color: #000040;">&amp;</span>origProt<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Now we are preparing to read/write at our target address. We save the original protection in <code>origProt</code> to restore it later.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">myAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE8</span><span style="color: #008080;">;</span>
<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>funcAdd <span style="color: #000040;">-</span> myAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
myAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span></pre></div></div>

<p>This is the call to our function (see step 2). The first byte <code>0xE8</code> is the opcode for a CALL command. The four following bytes are the offset to our function. Finally we jump 5 bytes forward so we won&#8217;t overwrite what we have just written.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000dd;">memcpy</span><span style="color: #008000;">&#40;</span>myAdd, targetAdd, len<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
myAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> len<span style="color: #008080;">;</span></pre></div></div>

<p>Here we copy the original code that we are going to replace into our allocated memory after the call (see step 3).</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">myAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE9</span><span style="color: #008080;">;</span>
<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>targetAdd <span style="color: #000040;">+</span> len <span style="color: #000040;">-</span> myAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span></pre></div></div>

<p>And now the jump back to our target address (see step 4). This is similar to the CALL we have already written with the difference of the first byte being <code>0xE9</code> this time which is the opcode for a JMP.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">targetAdd<span style="color: #008000;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0xE9</span><span style="color: #008080;">;</span>
<span style="color: #000040;">*</span><span style="color: #008000;">&#40;</span>DWORD<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>targetAdd <span style="color: #000040;">+</span> <span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span>DWORD<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#40;</span>myAdd <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span> <span style="color: #000040;">-</span> len <span style="color: #000040;">-</span> targetAdd<span style="color: #008000;">&#41;</span> <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span>
targetAdd <span style="color: #000040;">+</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span></pre></div></div>

<p>This is the jump to our allocated memory/gateway (see step 5).</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">if</span> <span style="color: #008000;">&#40;</span>len <span style="color: #000080;">&gt;</span> <span style="color: #0000dd;">5</span><span style="color: #008000;">&#41;</span>
	<span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> len <span style="color: #000040;">-</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span>
		targetAdd<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #000080;">=</span> <span style="color: #208080;">0x90</span><span style="color: #008080;">;</span>
&nbsp;
VirtualProtect<span style="color: #008000;">&#40;</span>targetAdd, len, origProt, <span style="color: #000040;">&amp;</span>origProt<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>The jump to our gateway has the length of 5 bytes. If the original code at the target address is longer than 5 byte our jump won´t replace the whole code and some garbage is left over. So we have to fill it with <code>0x90</code> which is the opcode for NOP (no operation). If we don&#8217;t do this, the program might crash. Finally we restore the protection.</p>
<h3>Usage</h3>
<p>Please note that the code you want to replace must have <strong>at least</strong> the size of 5 bytes!</p>
<p>You can call the function like this:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">SetJumpgate<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span>BYTE<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #208080;">0x004A42C2</span>, <span style="color: #008000;">&#40;</span>BYTE<span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span>OnOpenShop, <span style="color: #0000dd;">6</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>This is how my <code>OnOpenShop</code> looks like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> OnOpenShop <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	__asm
	<span style="color: #008000;">&#123;</span>
		pushfd
		pushad
	<span style="color: #008000;">&#125;</span>
&nbsp;
	AddChat<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;Opening a shop eh?&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
	__asm
	<span style="color: #008000;">&#123;</span>
		popad
		popfd
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>You need the asm there because you would change the stack of the game otherwise and that would lead to a crash.</p>
<p>And this is my result:</p>
<p><a href="http://www.dennistheurer.com/upload/tut2_2.jpg" target="_blanc"><img class="alignnone size-medium wp-image-35" title="tut2_2" src="http://www.dennistheurer.com/upload/tut2_2-300x225.jpg" alt="" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2005/11/gateway-to-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling a function of another program</title>
		<link>http://www.dennistheurer.com/2005/09/calling-a-function-of-another-program/</link>
		<comments>http://www.dennistheurer.com/2005/09/calling-a-function-of-another-program/#comments</comments>
		<pubDate>Fri, 02 Sep 2005 19:05:06 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=67</guid>
		<description><![CDATA[Note: this tutorial is a few years old. Please don&#8217;t expect me to answer any questions or give out code. What is this tutorial about? In this tutorial I want to show you how to call a function of another program or game and how to get the address of this function. The tutorial is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note: </strong>this tutorial is a few years old. Please don&#8217;t expect me to answer any questions or give out code.</p>
<h3>What is this tutorial about?</h3>
<p>In this tutorial I want to show you how to call a function of another program or game and how to get the address of this function. The tutorial is written for people who have little to no assembly knowledge.<br />
<span id="more-67"></span></p>
<h3>Requirements</h3>
<p>For this tutorial you need to know how to inject a dll into a process. If you don’t know it, there are many tutorials about that (just google for them) or you can simply download an injector and read about how it works later. There are also plenty of websites and forums that deal with game hacking and things like that which can be very helpful.</p>
<p>You will also need a disassembler. I use ollydbg that you can download <a href="http://www.ollydbg.de/" target="_blank">here</a> for free.</p>
<h3>Finding the address of the function</h3>
<p>This is definitely the hardest part. For this tutorial I chose the game Ragnarok Online and the function I want to call is the one to write text into the chat. Either open up ollydbg and load the exe of the game there or start the game and attach ollydbg to it.</p>
<p>It should look like this:</p>
<p><a href="http://www.dennistheurer.com/upload/tut1_1.gif"><img class="alignnone size-medium wp-image-38" title="tut1_1" src="http://www.dennistheurer.com/upload/tut1_1-300x234.gif" alt="" width="300" height="234" /></a></p>
<p>Press F9 to start the game.</p>
<p>So I know that when I open a shop the following lines are always written into the chat:</p>
<p><a href="http://www.dennistheurer.com/upload/tut1_2.jpg"><img class="alignnone size-medium wp-image-39" title="tut1_2" src="http://www.dennistheurer.com/upload/tut1_2-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>In ollydbg right click and select <em>Search for-&gt;All referenced text strings</em>.</p>
<p>Search for the string that is written into the chat and double click it.</p>
<p><a href="http://www.dennistheurer.com/upload/tut1_3.gif"><img class="alignnone size-medium wp-image-40" title="tut1_3" src="http://www.dennistheurer.com/upload/tut1_3-300x234.gif" alt="" width="300" height="234" /></a></p>
<p>If you are not sure that the piece of code you found is called when you open the shop then you could right click on the address and set a breakpoint there.<br />
This time it is so obvious that it isn’t needed.</p>
<p>Let’s have a look at the code:</p>
<pre>004A455A  |. 68 5CE96400    PUSH rag.0064E95C
004A455F  |. 50             PUSH EAX
004A4560  |. E8 134C1600    CALL rag.00609178
004A4565  |. 83C4 08        ADD ESP,8
004A4568  |. 8D8D 50FEFFFF  LEA ECX,DWORD PTR SS:[EBP-1B0]
004A456E  |. 6A 00          PUSH 0
004A4570  |. 68 FFFF9600    PUSH 96FFFF
004A4575  |. 51             PUSH ECX
004A4576  |. 6A 01          PUSH 1
004A4578  |. B9 70806900    MOV ECX,rag.00698070
004A457D  |. E8 2E7D0100    CALL rag.004BC2B0
004A4582  |. EB 20          JMP SHORT rag.004A45A4</pre>
<p>In case you aren’t familiar with this: the first row is the address, the second the opcode and the third the assembler commands.</p>
<p>For those who hardly know any assembly like me I will try to explain what the lines of code do. At <code>004A455A</code> the string at memory address <code>0064E95C</code> is added to the stack. The next line adds the value of EAX to the stack. This is done to pass them to the function that is called at <code>004A4560</code>. In assembly the parameters are added to the stack in reversed order.</p>
<pre>C++:	MyFunction(arg1, arg2);
ASM:	PUSH arg2
	PUSH arg1
	CALL MyFunction</pre>
<p>So we basically have a function here that takes two parameters, the second one being the string that is written into the chat:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">SomeFunction<span style="color: #008000;">&#40;</span>parameter1, <span style="color: #FF0000;">&quot;text&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Let’s have a look at another piece of code:</p>
<pre>004A452B  |. 50             PUSH EAX
004A452C  |. 68 98E96400    PUSH rag.0064E998 ; ASCII "Current Zeny : %s Z"
004A4531  |. 51             PUSH ECX
004A4532  |. E8 414C1600    CALL rag.00609178
004A4537  |. 83C4 20        ADD ESP,20
004A453A  |. 8D95 50FEFFFF  LEA EDX,DWORD PTR SS:[EBP-1B0]
004A4540  |. B9 70806900    MOV ECX,rag.00698070
004A4545  |. 6A 00          PUSH 0
004A4547  |. 68 FFFF7800    PUSH 78FFFF
004A454C  |. 52             PUSH EDX
004A454D  |. 6A 01          PUSH 1
004A454F  |. E8 5C7D0100    CALL rag.004BC2B0
004A4554  |. 8D85 50FEFFFF  LEA EAX,DWORD PTR SS:[EBP-1B0]</pre>
<p>Again the function at <code>00609178</code> is called. By having a look at the PUSHes we see that 3 parameters are passed. So we know that the function can take a variable number of parameters. I set a breakpoint at <code>004A4532</code> and open a shop. In the <em>Registers</em> part of ollydbg I see that EAX has the value of ASCII 500.<br />
So the code in C++ should look like this.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> s1 <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;Current Zeny : %s Z&quot;</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">char</span><span style="color: #000040;">*</span> s2 <span style="color: #000080;">=</span> <span style="color: #FF0000;">&quot;500&quot;</span><span style="color: #008080;">;</span>
SomeFunction<span style="color: #008000;">&#40;</span>parameter1, s1, s2<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Doesn’t this look familiar to you? Yes, it looks like the function <code>sprintf()</code>.</p>
<pre>Desc:     Write formatted data to a string
Buffer:   Storage location for output
Format:   Format-control string
Argument: Optional arguments
Return:   Number of bytes stored in buffer</pre>
<p>Now we know that the function <code>00609178</code> is not the one we search for but formats the string that is written into the chat.</p>
<p>We skip the next 3 lines of code and see that starting at <code>004A4545</code> 4 values are added to the stack and a function is called after that.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">Function<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>, EDX, <span style="color: #208080;">0x78FFFF</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>You can right click on <code>CALL rag.004BC2B0</code>, select Follow and set a breakpoint there. Unfortunately the debugger stops there every frame, so if it is the function to add text to the chat it has to serve some other purpose as well. Let’s check the parameters. What&#8217;s the value of EDX? A few lines before at <code>004A453A</code> we see</p>
<p><code>004A453A  |. 8D95 50FEFFFF  LEA EDX,DWORD PTR SS:[EBP-1B0]</code></p>
<p>This command loads the address of EBP-1B0 into EDX. We need to know the value of EBP to get the address. Set a breakpoint on that command and open a shop. The debugger stops at that line.</p>
<p>At the registers part you see that EBP has a value of 0012FA28. We subtract 1B0 and get the value 12F878 which is the address of the string &#8220;Current Zeny : 500 Z&#8221;.</p>
<p>Now we know that EDX points to the string which is written into the chat window and we have all parameters of the function.</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;">AddChat<span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span>, <span style="color: #FF0000;">&quot;text&quot;</span>, <span style="color: #208080;">0x78FFFF</span>, <span style="color: #0000dd;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span></pre></div></div>

<p>Let’s call the function in our injected DLL. You could do this in C++ only; I did it with assembly because it was less work. This is how your function could look like:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> AddChat <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span>text<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>pChat <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #208080;">0x004BC2B0</span><span style="color: #008080;">;</span>
	__asm
	<span style="color: #008000;">&#123;</span>
		mov ecx, text
		push <span style="color: #0000dd;">0</span>
		push <span style="color: #208080;">0x96FFFF</span>
		push ecx
		push <span style="color: #0000dd;">1</span>
		call <span style="color: #008000;">&#91;</span>pChat<span style="color: #008000;">&#93;</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Let’s test it to see if it works. Ingame I call <code>AddChat ("test");</code> and the game crashes&#8230; huh? Ok, this time I start the game with my dll injected but also attach ollydbg to it. Again I crash the game with my code but this time ollydbg stops at the line of code that is responsible for the crash:</p>
<p><code>004BC6E9  8B11  MOV EDX,DWORD PTR DS:[ECX]</code></p>
<p>The address is <code>004BC6E9</code> so it’s in the function we call starting at <code>004BC2B0</code>. In Ollydbg we can see that ECX has a value of <code>00000020</code>. Now the error message: <code>Access violation when reading [00000020]. </code>Of course, <code>00000020</code> doesn’t exist. ECX for some reason has a wrong value.</p>
<p>We could follow the code backwards and see where the value comes from but I preferred to compare my code with the one in Ragnarok. The only difference I see is that line:</p>
<p><code>004A4540  |. B9 70806900    MOV ECX,rag.00698070</code></p>
<p>The function we call must somehow work with the value of ECX and because we don’t set it to the correct value it crashes.</p>
<p>So we add the line to our code:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>pChat <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #208080;">0x004BC2B0</span><span style="color: #008080;">;</span>
<span style="color: #0000ff;">void</span> <span style="color: #000040;">*</span>pSomething <span style="color: #000080;">=</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #000040;">*</span><span style="color: #008000;">&#41;</span><span style="color: #208080;">0x00698070</span><span style="color: #008080;">;</span>
__asm
<span style="color: #008000;">&#123;</span>
	mov ecx, text
	push <span style="color: #0000dd;">0</span>
	push <span style="color: #208080;">0x96FFFF</span>
	push ecx
	push <span style="color: #0000dd;">1</span>
	mov ecx, <span style="color: #008000;">&#91;</span>pSomething<span style="color: #008000;">&#93;</span>
	call <span style="color: #008000;">&#91;</span>pChat<span style="color: #008000;">&#93;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>The value for ECX is not static so we need to get it from <code>00698070</code> as well. Let’s see if it works now:</p>
<p><a href="http://www.dennistheurer.com/upload/tut1_4.jpg"><img class="alignnone size-medium wp-image-41" title="tut1_4" src="http://www.dennistheurer.com/upload/tut1_4-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>As you can see it works! :-)</p>
<p>Thanks for reading my tutorial.</p>
<p>Credits go to many people from the game-deception forums where I learned much of this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2005/09/calling-a-function-of-another-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ragnarok Client Tool</title>
		<link>http://www.dennistheurer.com/2005/08/ragnarok-client-tool/</link>
		<comments>http://www.dennistheurer.com/2005/08/ragnarok-client-tool/#comments</comments>
		<pubDate>Thu, 04 Aug 2005 20:41:26 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dennistheurer.com/?p=223</guid>
		<description><![CDATA[Note: This article is a few years old. The program that this article is about is outdated and not available anymore. Please don&#8217;t ask me for the source code. This was my first project to be released to the public. The program was a 3rd party program for the game Ragnarok Online. I haven&#8217;t really [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong> This article is a few years old. The program that this article is about is outdated and not available anymore. Please don&#8217;t ask me for the source code.<a href="http://www.dennistheurer.com/upload/rct_1.gif" target="_blanc"><img class="alignright size-thumbnail wp-image-45" title="rct_1" src="http://www.dennistheurer.com/upload/rct_1-150x150.gif" alt="" width="150" height="150" /></a></p>
<p>This was my first project to be released to the public. The program was a 3rd party program for the game Ragnarok Online.</p>
<p>I haven&#8217;t really made it to get advantages in the game but to learn about DLL injection and network programming. There were two different versions using two different methods.</p>
<p><span id="more-223"></span></p>
<h3>Version one</h3>
<p><a href="http://www.dennistheurer.com/upload/rct_2.jpg" target="_blanc"><img class="alignright size-thumbnail wp-image-46" title="rct_2" src="http://www.dennistheurer.com/upload/rct_2-150x150.jpg" alt="" width="150" height="150" /></a>Ragnarok Online had to be changed to connect to your local machine using the port RCT was listening on. As soon as the connection was established, RCT connected to the real Ragnarok server pretending to be the Ragnarok Online client. Then it forwarded packets from each side to the other.<br />
It was important to modify specific packets containing ip addresses to keep Ragnarok Online to connect to RCT instead of the server.<br />
Using this method it was possible to intercept, modify and view every packet which gives a lot of possibilities. But furthermore you could send your own packets to both the client and the server. Given this option you could do nearly everything.</p>
<p><a href="http://www.dennistheurer.com/upload/rct_3.jpg" target="_blanc"><img class="alignright size-thumbnail wp-image-47" title="rct_3" src="http://www.dennistheurer.com/upload/rct_3-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><strong>Here is a list of features:</strong></p>
<ul>
<li>Display monster&#8217;s HP below each monster</li>
<li>Show gained exp after each kill and calculation how many you have to kill until level up</li>
<li>Calculate routes through maps and display them with &#8220;Safety Walls&#8221;</li>
<li>Show walking paths of the monster you have attacked last making vertical firewalls easier</li>
<li>Communication between IRC and Ragnarok Online</li>
</ul>
<p><a href="http://www.dennistheurer.com/upload/rct_6.jpg" target="_blanc"><img class="alignright size-thumbnail wp-image-48" title="rct_6" src="http://www.dennistheurer.com/upload/rct_6-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p><strong>Example: monster HP</strong></p>
<p>I used a database containing all information about the monsters and made RCT notice every packet about a monster.<br />
To display the HP I used the health bars of party members and because you can&#8217;t attach them to monsters I had to send fake packets to Ragnarok Online to make it think that at the very same position as the monster there is an invisible player. Fortunately you can make invisible characters (yes invisible GMs are noticed by your client, they just don&#8217;t show up!) and thus I could attach the HP bar to them. I then subtracted all damage the monster received because the server doesn&#8217;t send the actual HP but you have to calculate it on your own. This has some minor problems like miscalculation if the monster hadn&#8217;t had full HP when it came on your screen.</p>
<h3>Version two</h3>
<p><a href="http://www.dennistheurer.com/upload/rct_5.gif" target="_blanc"><img class="alignright size-thumbnail wp-image-49" title="rct_5" src="http://www.dennistheurer.com/upload/rct_5-150x150.gif" alt="" width="150" height="150" /></a>Version two used a more complex but more reliable system: DLL injection. Because I didn&#8217;t know anything about it, I used the DLLs that the Kore bot uses. Although I got the basic functions to work there were still serious problems: When I sent a packet to Ragnarok Online, the game lagged for a second making it impossible to play. My packets however were received successfully but I never found a way to fix this problem. But I thought of other features because I was at a point where you kill monsters way too fast or partied all the time making the monster HP completely useless.</p>
<p>Here are some examples of features I implemented in the different versions of RCT (which were all private):<br />
<a href="http://www.dennistheurer.com/upload/rct_4.jpg" target="_blanc"><img class="alignright size-thumbnail wp-image-50" title="rct_4" src="http://www.dennistheurer.com/upload/rct_4-150x150.jpg" alt="" width="150" height="150" /></a></p>
<ul>
<li>WoE warning system (^^): this is one weird feature you might think. As soon as someone who is not from your guild enters a castle the program makes a loud sound.<br />
Yes, there is a use for this. You can watch TV and do WoE at the same time! :)</li>
<li>EXP monitor: EXP/h, time until level up, EXP gained in one session and a nice diagram</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dennistheurer.com/2005/08/ragnarok-client-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

