Stack Trace Utility - RetroGuard Documentation


Prev   Contents   Next

If a user of your software finds an error, it can be useful to have them email a stack trace. The utility RGtrace has been provided to convert obfuscated stack traces to unobfuscated form. This is only possible using the RetroGuard log output from the original obfuscation process, so this log file should be archived carefully.

One complexity of de-obfuscating the stack trace is the massive method-name overloading that occurs during RetroGuard obfuscation. While a great way to deter reverse engineering of your software, method overloading means that an obfuscated method name often maps back to several unobfuscated methods in that class. The RGtrace tool lists all possible unobfuscated methods, with each possible method name enclosed by braces in the output.

The command for running RGtrace has the form,

java RGtrace LOGFILE [INPUT-FILE [OUTPUT-FILE]]
where:
  • LOGFILE is the log file from the obfuscation;
  • INPUT-FILE is an obfuscated stack trace (defaults to stdin);
  • OUTPUT-FILE is the filename for the unobfuscated stack trace (defaults to stdout).
If LOGFILE cannot be read, execution is terminated with a warning message.

Including Line Numbers in Stack Traces

To make debugging easier, it is useful to leave line number information in each obfuscated class. This is done by preserving the LineNumberTable attributes and the SourceFile attribute. Note that line numbers will not be printed in stack traces unless the SourceFile attribute is present. However, SourceFile normally contains the unobfuscated name of the class, which is undesirable for security reasons. The following script line can be used to retain the LineNumberTable attributes and add a dummy SourceFile attribute containing only a constant string:

.option LineNumberDebug


Prev   Contents   Next
 Copyright © 1998-2007 Retrologic Systems.
 All rights reserved.