<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>deadhacker.com &#187; Reverse Engineering</title>
	<atom:link href="http://deadhacker.com/category/reverse-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://deadhacker.com</link>
	<description>research repository of nathan andrew fain / cyphunk</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:05:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='deadhacker.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>deadhacker.com &#187; Reverse Engineering</title>
		<link>http://deadhacker.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://deadhacker.com/osd.xml" title="deadhacker.com" />
	<atom:link rel='hub' href='http://deadhacker.com/?pushpress=hub'/>
		<item>
		<title>Speaking at 27c3 in Berlin, Dec 27-30</title>
		<link>http://deadhacker.com/2010/12/12/speaking-at-27c3-in-berlin-dec-27-30/</link>
		<comments>http://deadhacker.com/2010/12/12/speaking-at-27c3-in-berlin-dec-27-30/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 23:48:22 +0000</pubDate>
		<dc:creator>cyphunk</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://deadhacker.com/?p=314</guid>
		<description><![CDATA[Myself and Vadim Vygonets gave a talk on embedded analysis at the CCC 27c3 conference in Berlin 2010. The purpose of this talk was to explain and simplify hardware embedded analysis. We went over various tools mentioned at this blog. Full documentation/reference for the tools discussed can be found on the wiki. Full video of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=314&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Myself and <a href="http://www.vygo.net/vadik/">Vadim Vygonets</a> gave a <a href="http://events.ccc.de/congress/2010/Fahrplan/events/4011.en.html">talk on embedded analysis</a> at the CCC 27c3 conference in Berlin 2010. The purpose of this talk was to explain and simplify hardware embedded analysis. We went over various tools mentioned at this blog. Full documentation/reference for the tools discussed can be <a href="http://events.ccc.de/congress/2010/wiki/Embedded_Analysis">found on the wiki</a>. Full video of the lecture:</p>
<span style="text-align:center; display: block;"><a href="http://deadhacker.com/2010/12/12/speaking-at-27c3-in-berlin-dec-27-30/"><img src="http://img.youtube.com/vi/8Unisnu-cNo/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cyphunk.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cyphunk.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cyphunk.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=314&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://deadhacker.com/2010/12/12/speaking-at-27c3-in-berlin-dec-27-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cyphunk</media:title>
		</media:content>
	</item>
		<item>
		<title>Bincrowd communal reverse engineering framwork</title>
		<link>http://deadhacker.com/2010/03/25/bincrowd-communal-reverse-engineering-framwork/</link>
		<comments>http://deadhacker.com/2010/03/25/bincrowd-communal-reverse-engineering-framwork/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 21:03:28 +0000</pubDate>
		<dc:creator>cyphunk</dc:creator>
				<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://deadhacker.com/?p=242</guid>
		<description><![CDATA[Update: link to Halvar &#38; SP at Zynamics post and slides from CanSecWest Bincrowd, a project I had the pleasure of contributing to, has been released by Zynamics. Bincrowd simplifies the collaborative option in reverse engineering and brings it en masse. Any function a user has ever submitted documentation for can be found quickly in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=242&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>Update: link to Halvar &amp; SP at Zynamics <a href="http://blog.zynamics.com/2010/03/25/shareing-is-caring-announcing-the-free-bincrowd-community-server/">post and slides</a> from CanSecWest</em></p>
<p><a href="http://bincrowd.zynamics.com"></p>
<div id="attachment_255" class="wp-caption alignright" style="width: 310px"><a href="http://blog.zynamics.com/2010/03/25/shareing-is-caring-announcing-the-free-bincrowd-community-server/"><img class="size-medium wp-image-255" title="ShaREing is caring" src="http://cyphunk.files.wordpress.com/2010/03/picture-3.png?w=300&#038;h=224" alt="" width="300" height="224" /></a><p class="wp-caption-text">From Zynamics BinCrowd presentation</p></div>
<p>Bincrowd</a>, a project I had the pleasure of contributing to, has been released by <a href="http://zynamics.com">Zynamics</a>. Bincrowd simplifies the collaborative option in reverse engineering and brings it en masse. Any function a user has ever submitted documentation for can be found quickly in your target. It also introduces greater flexibility and reliability by adding additional signature methods for functions. Further, server access and clients for various disassemblers are free (ida client <a href="http://github.com/zynamics/bincrowd-plugin-ida">here</a>).</p>
<div><span id="more-242"></span></div>
<p>To fully understand how this could create an evolutionary step for software reverse engineering (RE) lets walk look at a typical RE session. You open your target in your favorite disassembler and find it<br />
has several hundred functions. If you are lucky you will have a signature database that matches the OS version, library versions and compiler version your target was built with.  This will let you find the system calls quickly, fiddling down the undocumented code you need to RE to a hundred or so functions. Once you have reverse engineered a function that is missing a signature you could create one for it but until now it has been difficult to share this with others. With Bincrowd you can share this information quickly for team based RE efforts or just for posterity sake.  If 10 years from now someone runs into similar code somewhere else this information becomes useful. Further, Bincrowd goes further by adding more flexible signature routines to the mix. Signatures often used today are based on the raw bytes of a compiled function. The added signatures in Bincrowd are based on the flow of the function instead. The flexibility this introduces means you might find details and signatures for functions that were compiled with a different version compiler, different version of libraries, different compiler and libraries entirely, different hardware architectures or even different OS&#8217;s. Research from Zynamics has been the ground breaking in this field.</p>
<p>My efforts on Bincrowd were supported by <a href="http://recurity-labs.com">Recurity-Labs</a>. Both Recurity-Labs and Zynamics are great companies to work with.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cyphunk.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cyphunk.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cyphunk.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=242&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://deadhacker.com/2010/03/25/bincrowd-communal-reverse-engineering-framwork/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cyphunk</media:title>
		</media:content>

		<media:content url="http://cyphunk.files.wordpress.com/2010/03/picture-3.png?w=300" medium="image">
			<media:title type="html">ShaREing is caring</media:title>
		</media:content>
	</item>
		<item>
		<title>JTAG Enumeration</title>
		<link>http://deadhacker.com/2010/02/03/jtag-enumeration/</link>
		<comments>http://deadhacker.com/2010/02/03/jtag-enumeration/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:10:34 +0000</pubDate>
		<dc:creator>cyphunk</dc:creator>
				<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://deadhacker.com/?p=201</guid>
		<description><![CDATA[Update: added section with references to all the OSS jtag tools I know of. Can be of assistance when debugging or adding features. Update: added user submitted voltage conversion board design for bidirectional i/o JTAGenum is an open source Arduino based hardware platform I built last year with three primary goals: [1. Given a large set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=201&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>Update: added section with references to all the OSS jtag tools I know of. Can be of assistance when debugging or adding features.<br />
Update: added user submitted voltage conversion board design for bidirectional i/o</em></p>
<p><a href="http://github.com/cyphunk/JTAGenum">JTAGenum</a> is an open source Arduino based hardware platform I built last year with three primary goals: [1. Given a large set of pins on a device determine which are JTAG lines 2. Enumerate the Instruction Register to find undocumented functionality 3. be easy to build and apply] The development of a device has various distinct stages handled by different people/companies that each assume the other has properly secured their part. The security of devices often rely on <a title="hiding things">obfuscation</a> which makes it dificult for any part of the chain to evaluate the security of the whole. This is a problem that JTAGenum helps address.<img title="More..." src="https://cyphunk.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /> This was built for personal research and while working on various projects at <a href="http://recurity-labs.com/">Recurity Labs</a>. Please feel free to <a href="mailto:cyphunk@gmail.com">contact me</a> with any questions, problems, targets or updates. I would be more than happy to share credit.<img title="More..." src="https://cyphunk.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p>Related work: There are two other tools for finding JTAG pins: <a href="http://www.c3a.de/wiki/index.php/JTAG_Finder">JTAGScan</a> presented by Benedikt Heinz (hunz) at <a href="http://ph-neutral.org/">ph-neutral</a> which inspired <a href="http://lekernel.net/blog/?p=319">Arduinull</a> by Sébastien Bourdeauducq (lekernel). JTAGenum is most similar to the latter with the added feature of finding undocumented functionality. Felix Domke (tmbinc) recently gave a lecture on enumarating undocumented JTAG instructions and anyone considering using JTAGenum would do well to check his <a href="http://events.ccc.de/congress/2009/Fahrplan/attachments/1435_JTAG.pdf">paper</a>(<a href="http://cyphunk.files.wordpress.com/2010/02/blackbox-jtag-reverse-engineering-tmbinc.pdf">cache</a>)/<a href="http://media.ccc.de/browse/congress/2009/26c3-3670-en-blackbox_jtag_reverse_engineering.html">lecture</a> from the <a href="http://events.ccc.de/congress/2009/wiki/Welcome">26c3</a>.</p>
<h1>About JTAG</h1>
<p><a title="Joint Test Action Group">JTAG</a> is a common hardware debugging interface. It is used throughout the development chain of a device. Layout designers and board manufactures that employ <a href="http://en.wikipedia.org/wiki/SMT_placement_equipment">pick-and-place</a> machines will use JTAG to test interconnectivity of components. <a title="Application-specific integrated circuit">ASIC</a> designers use it to test the internal state of the chips they build. Software developers often use it to load firmware onto the device and to debug software.</p>
<p>For a varity of reasons JTAG is often left in the final product. As such each stage of the development chain will attempt to <a title="hide">obfuscate</a> its existence or functionality. ASIC manufactures often build in added functionality (such as logic analysis tools) and avoid mentioning both extended and often basic functionality from their final documentation. Layout designers might remove JTAG pins from the board, spread their contacts throughout on the board, remove contacts and hide JTAG lines on inner layers of the board. As mentioned before, this can make it difficult for any one part of the development chain to evaluate the security of the device as a whole. If you are unfamiliar with the inner workings of JTAG skip to the <em>A bit more about JTAG</em> section for the basics.</p>
<h1><strong>Hardware</strong></h1>
<p>To use JTAGenum you need an arduino compatible microcontroller. <a href="http://arduino.cc/en/Main/Software">Arduino</a> is a simple development enviornment (IDE) for various microcontrollers. At the moment AVR and PIC variants are available and can be purchased anywhere from $10 to $50. JTAGenum has been tested on the official Arduino <a href="http://arduino.cc/en/Main/ArduinoBoardDuemilanove">Duemilanove</a>, Arduino Mega (see <a href="http://hackerspace.be/JTAG_pinout_detector">hackerspace.be </a>modifications), <a href="http://www.moderndevice.com/products/rbbb-kit">RBBB</a> clone and <a href="http://www.pjrc.com/teensy/index.html">Teensy++</a>. When picking your microcontroller platform consider two issues: 1. How many pins do you want to check on your target. 2. what voltage level does your target device require.  Concerning voltage most Arduinos work at 5 volts. Some are switchable but even those that are not can be modified. For example revision 1.0 of the Teensy++ with over 30 pins of i/o can be modified by hand to operate at 3.3 volts. I show where to cut lines and install a voltage regulator <a href="http://www.flickr.com/photos/deadhacker/4152517331/">over here</a> (<em>Update: Teensy++ version 2.0 has a spot on the pcb to install a 3.3v regulator</em>). For voltages other than 3.3v and 5v there are a <a href="http://chiphacker.com/questions/622/bi-directional-step-up-and-step-down-3-3v-5-etc">variety of solutions</a> that depend on if you need uni-directional or bi-directional support on your i/o lines. Alessandro provides schematics and<a href="http://blog.pmst.net/2012/01/shiftino-arduino-level-shifting-shield.html"> board/shield design</a> for bi-direction i/o voltage conversion.</p>
<p>When connecting the microcontroller to the pins of your target one thing to be aware of is possible cross-talk between wires. I&#8217;ve been using a patch cable from Amontec that has a lot of cross talk.  JTAGenum has a mode that helps check for this which I will get into more detail later.</p>
<h1>Usage</h1>
<p><a href="http://github.com/cyphunk/JTAGenum">Download the JTAGenum code</a> and open it in the Arduino IDE. The following needs to be changed in the code depending on your microcontroller:</p>
<ul>
<li>pins[] define which pins on the microcontroller are being used to connect to the target</li>
<li>pinname[] is a convenient way to map the pins to names which correspond to the names of pins on your target</li>
<li>IR_LEN defines the length of the JTAG instruction register. If you change this you should also add &#8217;0&#8242;s to each of the coresponding IR_** instruction definitions. You can find the IR_LEN in the documentation for your target. If you cannot find it just guess. (10 is the current value, 8 is also common)</li>
</ul>
<p>Upload the sketch to your microcontroller and open the serial console with a baud of 115200.  Sending a &#8216;h&#8217; to the console will print usage information that describes each function. Each function is enacted by sending the defined one character code:</p>
<h3>v &gt; verbose</h3>
<p>Toggles verbose output. At times verbose might present too much information or without it too little.</p>
<h3>l &gt; loopback check</h3>
<p>Find loopback pairs that will generate false-positives for other tests. After running you should remove any loopback pairs from your pins[]/pinnames[]. Looback pairs are found by sending a predetermined pattern[] to all possible pins while checking all pins for matching output.  Because the JTAG clock (TCK) and state (TMS) pins are NOT being stimulated the input/output pairs where the pattern is found represent loopbacks. NOTE: you should probably run this once with and without internal pull-up resistors set (&#8216;r&#8217;) to avoid problems of cross-talk which is discussed in detail later.</p>
<h3>s &gt; scan</h3>
<p>This routine is used to check all possible pins and find JTAG  clock, state, input and output pins lines (TCK,TMS,TDI,TDO). This is done by setting the JTAG state (TMS) into Shift_IR mode and then sending pattern[] to TDI and checking for it on TDO while clocking TCK. This check is run for every possible pin combination and it is important that you remove loopback pins before running. While this scan is meant to determine all of the JTAG pins required it is possible that the  TMS pin found is incorrect.  This depends on if the target uses the bypass register by default (described later). If an IDCODE register is present then bypass mode is not the default and you can assume that the pin this scan defines as TMS is correct.  Otherwise, only the TCK, TDI and TDO pins can be determined.  NOTE: run with pull-ups on (&#8216;r&#8217;) as any cross-talk might result in false-positives.</p>
<h3>y &gt; brute force IR search</h3>
<p>This will set the instruction register (IR) to all possible values and check the output. This can be used to find undocumented instructions and examine their results via the data register (DR). To run this scan you should have already determined the 4 JTAG pins and define pins[] as such: [0]=TCK [1]=TMS [2]=TDO [3]=TDI.  NOTE: run with pull-ups on (&#8216;r&#8217;) as any cross-talk might result in false-positives.</p>
<h3>x &gt; boundary scan</h3>
<p>This will return the state of all the pins on the target.  Actually it is not just the pins but the contents of the scan/sample register. This should be a rather large register and is defined in the code by SCAN_LEN+100. You can check your targets documentation and specify this or just leave it as a large number (currently 1800). To run this scan you should have already determined the 4 JTAG pins and define pins[] as such: [0]=TCK [1]=TMS [2]=TDO [3]=TDI.  NOTE: run with pull-ups on (&#8216;r&#8217;) as any cross-talk might result in false-positives.</p>
<h3>i &gt; idcode scan</h3>
<p>The JTAG standards specify that if an idcode register is present it should be set as the default data register (DR) and attached to output (TDO) by default. Meaning, regardless of the state of the JTAG chip (set with TMS line) and regardless of input being sent to the chip (TDI) by clocking the chip (TCK) it should return the contents of the idcode to the output (TDO). Hence, this routine iterates through all possible TCK,TDO pairs of pins, CLK&#8217;ing each bit along the way, and prints the output when there is any change (we assume an idcode will not be all 0&#8242;s or 1&#8242;s). You should examine the documentation of your target(s) to see if the idcode matches. NOTE: run with pull-ups on (&#8216;r&#8217;) as any cross-talk might result in false-positives.</p>
<h3>b &gt; shift_bypass</h3>
<p>Broken atm (need to add TCK enumeration). The JTAG standards specify that if and idcode register is NOT present on the chip then the bypass register (length of 1) should be the default DR. Essentially this means what is sent to the input (TDI) should come out on the output (TDI) with a one clock delay (TCK). It is important that you remove loopbacks before running this test otherwise the loopback pins will look like valid JTAG lines. NOTE: run with pull-ups on (&#8216;r&#8217;) as any cross-talk might result in false-positives.</p>
<h3>r &gt; set pull-up resistors &amp; cross-talk</h3>
<p>If like me the cables you use to connect between JTAGenum to your targets are flimsy or uninsulated you might run into issues of cross-talk whereby when one pin is transmitting a nearby pin picks up the transmission even though they are not connected. To avoid this you can turn on the internal pull-up resistors which will force the pin to a default state. If for some reason you continue to have sporadic issues run the following in sequence to check if the problem is the cable, target or other:</p>
<dl>
<dd>
<ol>
<li>Disconnect the cables between your target and JTAGenum. Disconnected them entirely from JTAGenum as well.</li>
<li>Run a loopback check (&#8216;l&#8217;) with pull-ups off. In this state the pins are in open mode and might fluctuate.  You&#8217;ll notice that as you move the microcontroller around, turn lights on and off or move other devices close to or away from it that the results change.</li>
<li>Turn on pull-ups (&#8216;r&#8217;) and run the test again. The results should now be consistent. If they aren&#8217;t, then let me know.</li>
<li>Now attach your cables to JTAGenum but not the target.  Run steps 2 and 3 again. Step 2 will give you a feel for how much inconsistency the cable may add. If the loopback check results in actual pattern matches then your cable has cross-talk. Step 3 should still result in a consistent state of either all high (1&#8242;s) or all low (0&#8242;s) and if it doesn&#8217;t then your cross-talk issues are such that all JTAGenum tests are going to be buggy at best. Feel free to give me an <a href="mailto:cyphunk@gmail.com">email</a>and I will happily try to help solve the problem.</li>
</ol>
</dd>
</dl>
<h1>Code references</h1>
<p>Examining code of various jtag scanning derivitives is probably the best way to modify JTAGenum however you want or when wanting to cross reference JTAG logic to debug a problem.</p>
<ul>
<li><a href="http://www.c3a.de/wiki/index.php/JTAG_Finder">JTAG Finder</a> &#8211; the microcontroller provides a pin protocol/interface to a C client running on the PC which does the actual scanning logic. This was one of the first (if not the) JTAG scanner.  It trades simplicty of code and protocol for efficiency and speed.</li>
<li><a href="http://nsa.unaligned.org/jrev.php">JRev</a> &#8211; Not meant for scanning pins to find JTAG. It does however implement some logic not in any of the JTAG scanners mentioned here.  In paticular, support for chain mapping, IR length detection and perhaps others I&#8217;m missing.</li>
<li><a href="http://lekernel.net/blog/?p=319">Arduinull</a> &#8211; The first simplified scanner running all in the microcontroller.</li>
<li><a href="http://hackerspace.be/JTAG_pinout_detector">JTAG pinout detector</a> &#8211; a port of Arduinull and JTAGenum for the Arduino Mega board.</li>
</ul>
<p>Additionally <a href="http://github.com/jal2/JTAGenum">Jal2</a> and <a href="http://new.hackerspace.be/JTAG_pinout_detector">Zoobab</a> have written their branches of JTAGenum.  I will try to merge their features to the JTAGenum branch as quickly as possible but if you run into problems or for general curiosity you can check their code.</p>
<h1>A bit more about JTAG</h1>
<p><a href="http://de.wikipedia.org/w/index.php?title=Datei:JTAG_Register.svg"><img class="alignright" style="background-color:#999;" title="JTAG Registers" src="http://cyphunk.files.wordpress.com/2010/02/500px-jtag_register-svg.png?w=300&#038;h=272" alt="" width="300" height="272" /></a></p>
<p>Basic understanding of how JTAG works will be helpful when using JTAGenum. There are 4 lines/pins: TDO=output, TDI=input, TCK=clock, TMS=state machine control.  Say you want to read the ID of the chip. First you would send the IDCODE instruction to the instruction register (IR). The JTAG controller then places the actual id code value of the chip in a data register which you could then read out. You would think that it would be enough to have one input line going to the IR and one output coming from the DR but JTAG also supports writing to the DR. As apposed to adding another input line specific to the DR instead JTAG works by moving the input and output lines between IR and DR. The TMS line is used to switch TDI/TDO to IR when you want to place an instruction and back to DR when you want to read or write data. With all operations, be it state change (TMS) reading (TDI) or writing (TDO), the clock line must be cycled once (TCK) for every bit or change. This was a brutal and drastic simplification but with that understood reading the Usage section should be comprehensible.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cyphunk.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cyphunk.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cyphunk.wordpress.com/201/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=deadhacker.com&amp;blog=31698&amp;post=201&amp;subd=cyphunk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://deadhacker.com/2010/02/03/jtag-enumeration/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cyphunk</media:title>
		</media:content>

		<media:content url="https://cyphunk.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" medium="image">
			<media:title type="html">More...</media:title>
		</media:content>

		<media:content url="https://cyphunk.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" medium="image">
			<media:title type="html">More...</media:title>
		</media:content>

		<media:content url="http://cyphunk.files.wordpress.com/2010/02/500px-jtag_register-svg.png?w=300" medium="image">
			<media:title type="html">JTAG Registers</media:title>
		</media:content>
	</item>
	</channel>
</rss>
