otx @VERSION@ for Mac OS X 10.4 Tiger

otx is a Mach-O disassembler. It runs Apple's otool on a program and adds
what otool leaves out:

- the Objective-C method that each function is, as -(id)[Preferences init]
- the message that each call sends, as +[NSUserDefaults standardUserDefaults]
- instance variables by name and type
- C++ names, demangled
- names for functions without a symbol (Anon1, Anon2 and on)
- the offset of each instruction in its function
- the strings and numbers that instructions load

It reads PowerPC and Intel code, 32-bit and 64-bit. It is one Universal
program for PowerPC (G3, G4, G5) and Intel Macs:

  /Applications/otx.app
      the application
  /usr/local/bin/otx
      the command
  /usr/local/share/doc/otx-tiger
      this Read Me, the license, the patches, update-shell-profile.sh

otx needs Xcode Tools: it runs /usr/bin/otool, and /usr/bin/c++filt for C++
names. For a 64-bit program (ppc64 or x86_64) it runs /usr/bin/otool64,
which Xcode 2.5 has. The Installer does not install otx on a Mac without
/usr/bin/otool.

The application

Drop a program or an application on the otx window, or choose File > Open.
otx finds the program inside an application. In a Universal program, the
menu beside Thin chooses PowerPC or Intel. Click Save and choose where the
text goes: otx writes it and opens it in TextEdit. Preferences (in the otx
menu) sets what the text shows and which application opens it.

The command

The installer adds /usr/local/bin to the PATH in your shell profile
(~/.bash_profile for bash, the shell Tiger gives new accounts, or the
.bash_login or .profile you already have) and keeps the old profile beside
it as .otxsave. Open a new Terminal window. otx writes to its standard
output:

  otx /Applications/TextEdit.app > TextEdit.txt
      TextEdit, the half for this Mac
  otx -arch i386 /Applications/TextEdit.app > TextEdit-intel.txt
      the Intel half of a Universal program
  otx -b -d /usr/bin/true
      with logical blocks and the data sections
  otx
      the list of options

The version for Tiger

This is otx's last source, from the otx project's history to 2014
(github.com/0xced/otx), which still calls itself 0.16b. otx was built for
Intel Macs and Mac OS X 10.7 only from 2012 on. Five patches make it build
and work on Tiger again; they are in /usr/local/share/doc/otx-tiger:

- 0001: build with the Mac OS X 10.4u SDK and Xcode 2.5's GCC 4.0.
- 0002: find otool in /usr/bin. otx asked xcode-select, which Tiger does
  not have, and stopped.
- 0003: read 64-bit programs with otool64. Tiger's otool cannot.
- 0004: fix ppc64 and x86_64 on a PowerPC Mac. Two searches read half of
  each 64-bit address: every branch had the same wrong label.
- 0005: open the text in TextEdit after Save, not in BBEdit.

On Tiger, otool64 prints the jumps of x86_64 code as distances, not as
addresses (jne 0x00000009). otx's own comments on those lines are right.

It was built on a Power Mac G4 with Mac OS X 10.4.11 and Xcode 2.5. The
same files gave the same text on that G4 and on an Intel Mac with Tiger,
for PowerPC, Intel, ppc64 and x86_64 programs.

Uninstalling

Drag /Applications/otx.app to the Trash, and in Terminal:

  sudo rm /usr/local/bin/otx
  sudo rm -rf /usr/local/share/doc/otx-tiger
  sudo rm -rf "/Library/Receipts/otx @VERSION@.pkg"

If nothing else you use is in /usr/local/bin, take the "Setting PATH for
otx" lines out of your shell profile. otx keeps its preferences in
~/Library/Preferences/com.anon.otx.plist.

otx and the changes made for Tiger are in the public domain (License.txt).
The source of this build is in otx-@VERSION@-tiger-source.tar.gz on
tiger.v2core.com. This package was made on @DATE@.
