hopper - cocoaheads€¦ · legit every day uses for hopper • do i need to check for changes...

Post on 27-Jul-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

HopperThe disassembler

(Not the great flight/hotel booking app)

! Hi

Felix Lapalme @lap_felix

iOS Developer @ Transit

• What is Hopper ? (With a machine code 101)

• What useful things can it do ?

• What less useful (but fun) things can it do ?

Overview

"

Compiled Languages 101

Code (Swift / Objective-C)

Compiler (LLVM)

Executable/Machine code (ARM, Intel x86)

We need Hopper to inspect this

part"Compiled Languages 101

Code (Swift / Objective-C)

Compiler (LLVM)

Executable/Machine code (ARM, Intel x86)

A Simple Program

… when opened with a text/hex editor

Anatomy of a CPU instruction(Add Immediate Instruction on MIPS32)

100000001000100000000101011110The processor reads this:

Anatomy of a CPU instruction(Add Immediate Instruction on MIPS32)

OP Code Address 1 Address 2 Immediate value001000 00001 00010 0000000101011110

In assembly:addi $r1, $r2, 350

In English:Add 350 to $r2 and put it in $r1

In Hopper

ASM Mode

In Hopper

Control Flow Graph

In Hopper

Control Flow Graph

In Hopper

Control Flow Graph

In Hopper

Pseudo Code

In Hopper

Hexadecimal Mode

Felix, this is cool but how is this useful ?

Legit every day uses for Hopper

• Do I need to check for changes before calling [some UIKit object setter]

• Is it really worth it to use -[UIStackView initWithArrangedSubviews] ?

• How does UIViewController calculate the frame of its initial view ?

(A non exhaustive list)

• How is UIKit disabling touch interactions during View Controller transitions ?

How is UIKit disabling touch interactions during View Controller transitions ?• From breakpoints, I see [UIPresentationController runTransitionForCurrentState] is called

How is UIKit disabling touch interactions during View Controller transitions ?• From breakpoints, I see [UIPresentationController runTransitionForCurrentState] is called • I look at that method in Hopper

Not very legit uses for Hopper(Demo)

Thank you!

top related