
\chapter*{Preface}

This book is the documentation of the University of Queensland 
Binary Translation (UQBT) framework. I  developed this framework over
the years with help from colleagues and students, who had input into 
the design and implementation of the system.

The UQBT project was started in 1996 by myself, Cristina Cifuentes, 
when prompted by colleagues at Sun Microsystems Laboratories 
about the possibility of working with binaries (executable programs), 
and transforming them into binaries for another machine.   
I had input from Mike Van Emmerik and Norman Ramsey in determining 
the shape of the project. 

Cristina's and Mike's prior experience with the {\bf dcc} decompilation 
project had shown that users were often interested on applying
the technology to binaries that run on machines and 
operating systems different to those it was designed for.
Our standard reply was ``you can write it yourself, 
just get the API for the new binary-file format and also code in the 
new instruction set for the machine of interest; oh, and remember that
the current IR is not machine-independent, so you will need some 
tweeking''.  Clearly, this did not help users.  The lesson we learned 
was that we could write a framework in such a way that we could 
support different machines and operating system conventions in a 
more generic way.
It's similar to the situation with compilers; you don't need to write $n$
compilers to support $n$ target machines. We wanted to be able to support
$n$ source machines and $m$ target machines without having to write
$n*m$ translators, or even $n$ front ends and $m$ back ends.

Norman was interested in using formal descriptions of machine properties
in order to write assemblers and disassemblers, as well as other tools. 
With Norman's help, we thought it would be ideal to be able to understand 
how to create a binary translation framework that separated machine 
dependent from machine independent concerns. We would use specification
files for the 
machine dependent concerns and support generic, machine independent 
analyses in the framework.  Norman and Mary Fern\'{a}ndez had written 
the New Jersey Machine Code (NJMC) toolkit, which supports the 
SLED (Specification Language for Encoding and Decoding) language. 
It is a language for describing the syntax of machine instructions, that is, 
the mappings between bits and instructions.  Both Norman and 
I were interested in also describing the semantics of machine instructions. 
Norman was interested in the use of formal descriptions for tools 
such as compilers, debuggers, emulators and binary translators.  
I was mainly interested in parameterizing the machine and operating 
system conventions in such a way that we could write a binary translator 
system without having to reimplement it each time we have a binary 
for a different machine or OS. 

While at the University of Queensland (1996-1999) I was a full time 
academic, while Mike was a full time research assistant. 
The UQBT system was built by stages, with the help of several students.  
Mike and I spent our Australian summers (Dec-Feb) working with 
students who were keen to learn and try out new things.   
We worked with: Shane Sendall throughout 1997, Shane and Doug Simon 
during the summer of 97/98, David Ung throughout 1998, Ian Walters, 
Shawn Coyne and Trent Waddington during the summer of 98/99, 
Doug Simon and Trent Waddington through most part of 1999, Ian 
Walters throughout 1999, and Simon Long during the summer of 99/00, 
as well as the summer of 00/01 and part of the 2001 year. 

While at Sun Microsystems Laboratories (1999-2001) I was initially 
visiting on sabbatical leave, subsequently, I joined the staff of the 
Labs and continued some work in this framework.  Brian Lewis joined 
me at the Labs and contributed towards the backends.  Brian and I 
worked with several interns: Sameer Gulrajani and Pavan Kumar during 
the US summer of 2000, Manel Fern\'{a}ndez during the first months 
of 2001 and Bernard Wong during the summer of 2001.  Nathan Keynes 
migrated us to \texttt{configure} during May.  Other work in this area 
was in the form of a dynamic retargetable binary translation system, 
which is documented in the Walkabout document.

The documentation in this book is not fully up-to-date, it reflects when 
parts of the system were developed and the state of that part at that 
point in time.  We have tried to update key sections to make the 
document useful to others.  I know my students have used it ``as 
is'', but have also relied on the source code comments of course, as 
well as email communication.  
Another resource for documentation are the papers that have been written
about the system, all are publicly available at 
\url{http://www.csee.uq.edu.au/csm/uqbt.html}, along with forthcoming  
technical reports that summarize our experiences with the development 
of this system (forthcoming in early 2002). 

We hope you find the UQBT framework useful for ideas or experiments 
in the areas of binary translation, binary rewriting or manipulation, 
code obfuscation, binary or assembly migration via decompilation, and more. 
We have certainly enjoyed working with this system. 

Enjoy! 


{\small
\begin{flushright}
Cristina Cifuentes \\
Mountain View, California \\
27 Nov 2001
\end{flushright}
}

