Self-modifying code is one of the major hurdles to binary translation. This dissertation describes a self-modifying code detector to prevent the binary translator from translating self-modifying code. In order to illustrate the usefulness of the binary translation framework, an optimizer that improves the load time of executable is designed and implemented in the framework.