SWT fix for Java Protocol Analyzer

Hello Folks,

I am currently working on some reverse engineering of wireless protocols of home automation systems, and sooner or later you encounter the point where you need some kind of protocol analyzer to understand what the devices are exchanging in their communication. More infos on that will follow some time later, but now I would like to share a short advice/fix for a tool I found. It is called “Protocol Analyzer” and right, it can be used to understand the signals the devices are exchanging.

The tool is written in Java (yeah, I know, a little bit lame nowadays) but I expect it to be helpful for my work. You can find more information on that tool here on the developer’s web page: http://wiki.nethome.nu/doku.php/analyzer/start

Ok, now to my fix:

I am running Ubuntu 12.04 with Oracle Java 1.7 and following the instructions to get the tool running gave me the following error message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-gtk-3347 or swt-gtk in swt.library.path, java.library.path or the jar file
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Unknown Source)
at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
at nu.nethome.tools.protocol_analyzer.Main.go(Main.java:133)
at nu.nethome.tools.protocol_analyzer.Main.main(Main.java:164)

I checked the folder ~/.swt/lib/linux/x86_64/ and found all necessaries sym-links set, like described in a lot of forum posts dealing with a similar problem (e.g. http://askubuntu.com/questions/199622/cannot-load-swt-library-unsatisfiedlinkerror-no-swt-gtk-4233) while getting eclipse up and running. In my case the required swt-gtk-3347 was not available, I have installed swt-gtk-3470 instead.

I checked the analyzer.sh script and found that a delivered jar file was simply renamed from swt_linux32.jar to swt.jar and then the analyzer.jar is started with the current path added as library path (obviously using the rename jar file).

I have a 64Bit Linux and my swt-gtk version seams not to match. To fix that, I downloaded the latest swt files from http://download.eclipse.org/eclipse/downloads/drops4/R-4.2.2-201302041200/#SWT suitable for my system (Linux (x86_64/GTK 2)). I extracted the zip file and replaced the ProtocolAnalyzer/lib/swt.jar file with the one located in the downloaded zip from eclipse.

Now I am able to start up the analyzer by hand using

java -Djava.library.path=. -jar analyzer.jar

(same as the last command in the analyzer.sh script)

Well, now lets see how this program can be of use for my work 🙂

One thought on “SWT fix for Java Protocol Analyzer

  1. Thank you for all those details, but sorry, these things are far beyound my horizon. I am not the technican i should be to understand those things.

Comments are closed.