HaRET

HaRET - What is it?

HaRET is short for Hardware Reverse Engineering Tool. HaRET has several different purposes, including:

  • Enables you to boot Linux from within Windows Mobile
  • Access and output information on low level device hardware

This tool is required for you if you have a Windows Mobile based device. HaRET is extremely useful for kernel developers that need to know memory locations for accessing the device's hardware.

There is also another companion tool called "haretconsole." This is what enables developers to connect to the handheld and communicate over a USB connection. This allows them to watch input and output of registers on the device without having to press any other keys on the device and interfering with the information they want to see. This means that all the commands can be run from a separate computer and all of the output can be saved outside of the device. The haretconsole tool can be thought of as a client that connects to the actual HaRET process that is run on the handheld.

More information can be found at the following websites:

HaRET - Where do I get it?

HaRET comes as a single executable file and can be downloaded from http://handhelds.org/~koconnor/haret/. At the time this was written HaRET 0.5.1 was the most recent stable version.

Please note that there are many different files that will be displayed when you click on the link above. The files that are listed with a date, such as haret-20080510.exe are unstable versions and it is not recommended that you download these files.

At the bottom of the page there are also a few files named haretconsole-0.X.X.tar.gz. These packages provide the haretconsole tool. You should get the version that corresponds to the version of the executable you download.

HaRET - How do I install it?

HaRET is not installed like most other programs, especially for Windows Mobile devices. HaRET is a single executable file and can just be copied to any directory on the handheld; it does not need to be installed via ActiveSync.

HaRET console is a different story. You do not need HaRET console but it is a good tool to use. To enable you to connect to the HaRET process on the handheld you need to run HaRET console (or telnet) which will communicate with the HaRET process over a USB connection. This allows you to run all the documented methods for HaRET and see the output from the device.

In order to use HaRET console you will need a machine with python installed. To actually connect to the device you will more than likely need a Linux machine.

To install the HaRET console do the following:

  • Download the haretconsole package from the link provided above that corresponds to your version of HaRET
  • Extract the package
    • If you are using Windows I suggest you find a Linux machine but if not I suggest ExtractNow (http://www.extractnow.com) to unpack the tar.gz file
  • To run it go to the folder you just extracted it to and run python console <yourdeviceIP>

 

HaRET - How do I use it?

There are 2 significant things you can do with HaRET: boot a Linux kernel or view hardware information

To boot a Linux kernel you will need to do the following:

  • Create a file called startup.txt
  • The startup.txt file tells HaRET what files to use to boot Linux
  • To tell HaRET what file your kernel is put set KERNEL "yourkernel" in the startup.txt file
  • There are several other options that can be set using this file. For more information see ...
  • After setting all the parameters you like type bootlinux at the end of the file
  • Place the startup.txt file in the same folder as HaRET.exe on your handheld and click on HaRET.exe. This will start HaRET and boot your kernel using the information provided in the startup.txt file

To run HaRET and watch hardware information, do the following:

  • You first need to setup a network between you and your handheld
  • After setting up the connection you will need to start HaRET on your handheld by clicking on the haret.exe file. This will bring up a window with a button labeled "Listen." This will start HaRET and listen for connections on port 9999.
  • You now need to connect to HaRET from your other computer. The simplest way to do this is to type telnet 9999
    • You may also use haretconsole. This requires that you download some extra files and that you have Python installed (see above).
  • Once you have connected to your handheld you can run lots of commands that will give you information about what's going on inside your device.
  • For more information on the commands available see http://handhelds.org/cgi-bin/cvsweb.cgi/~checkout~/haret/docs/haret.html and http://handhelds.org/moin/moin.cgi/HaRET_20Documentation
  • Figure 1 shows output of commands that were run using HaRET console. The listings at the bottom show processes running on the device.

HaRET Console example

Figure 1 - HaRET Console