O'Reilly logo

Hacking and Securing iOS Applications by Jonathan Zdziarski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Complicating Disassembly

A number of techniques and a number of myths exist about the complexity of the output object with and without certain compiler options. Using the right flags, object output can be made slightly more complicated for an attacker using disassembly on a low level to attack. If you’re following many of the techniques outlined in this chapter, chances are some of your code will likely be attacked on an assembly level, rather than merely manipulating the runtime environment. Compiling your code differently can muddy an attacker’s perspective on your application. Depending on what you want him to see, your application can be made to hide certain artifacts, such as mathematical calculations, by using different types of optimization. If used incorrectly and with the wrong assumptions, certain compiler modes can actually simplify your code, making it easier to read. This section explores the different optimizers and other compiler options, and what effect they have on your object code.

Optimization Flags

Usefulness: Varying

It is often believed that using heavy optimization can make your object code harder to read. By using these flags you’re giving the compiler permission to really mangle up your code at the benefit of speed (or size). But the optimizer doesn’t obfuscate your code as much as it’s advertised to; in fact, it can even make your code easier to understand in many cases. The optimizer isn’t there to obfuscate your code; it’s there to make things run faster. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required