Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Reverse Engineering: from Objective-C to Swift
Search
Hank Bao
April 23, 2016
Programming
480
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reverse Engineering: from Objective-C to Swift
逆向工程:从 Objective-C 到 Swift
2016年4月23日在 SwiftCon China 2016 上的分享
Hank Bao
April 23, 2016
Transcript
31 slides
逆向⼯程 从 OBJ-C 到 SWIFT @HANKBAO 瀑布IM
什么是逆向⼯程? Ӟᐿದᬦᑕ҅ܨӞᶱፓຽԾߝᬰᤈᭋݻړຉ݊Ꮈᑪ҅ᘒᄍ ᕩଚڊᧆԾߝጱ॒ቘၞᑕ̵ᕟᕢᕮ̵ۑᚆᚆᥢ໒ᒵᦡᦇᥝ ᔰ҅զګ֢ڊۑᚆፘᬪ݈҅֕ӧਠقӞጱԾߝ̶ — ᖌचጯᑀ
逆向⼯程的⽬标 ▸ ԟ ▸ ᦡᦇ ▸ ਫሿ ▸ ᓒဩ ▸
ᴻᲙ ▸ ಘ ▸ ൊկ
APP 插件
None
DEMO
DEMO: NON-FRAGILE LAYOUT
X86_64 调⽤约定 ▸ arg1: $rdi ▸ arg2: $rsi ▸ arg3:
$rdx ▸ arg4: $rcx ▸ arg5: $r8 ▸ arg6: $r9 ▸ ret1: $rax ▸ ret2: $rdx ▸ indirect: $rax (== $rdi)
OBJECTIVE-C 调⽤约定 ▸ arg1: $rdi -> self ▸ arg2: $rsi
-> _cmd ▸ arg3: $rdx ▸ arg4: $rcx ▸ arg5: $r8 ▸ arg6: $r9 ▸ ret: $rax
SWIFT REPL
DEMO: STRUCT
DEMO
SWIFT-DEMANGLE $ xcrun swift-demangle _TFV9DictSwift11QueryRecordg4termSS _TFV9DictSwift11QueryRecordg4termSS ---> DictSwift.QueryRecord.term.getter : Swift.String
DEMO
SWIFT NATIVE 调⽤约定 ▸ arg1: $rdi ▸ arg2: $rsi ▸
arg3: $rdx ▸ arg4: $rcx ▸ arg5: $r8 ▸ arg6: $r9 ▸ ret1: $rax ▸ ret2: $rdx ▸ ret3: $rcx ▸ indirect: $rax (== $rdi)
DEMO
DEMO
DEMO
DEMO
DEMO
DEMO
DEMO
DEMO
ᕑੰҘѺ
DEMO
DEMO
逆向⼯程理论基础 ▸ C / C++ / Objective-C / Swift ▸
Assembly (x86, x86_64, arm / thumb, arm64) ▸ ଘݣ ABI / ᇙਧ ABI ▸ ᖫᦲս۸ ▸ ֢ᔮᕹ
逆向⼯程⽅法和⼯具 ▸ ᶉாړຉ ▸ Hopper Disassembler ▸ IDA Pro ▸
otool ▸ class-dump ▸ ۖா᧣ᦶ ▸ lldb / gdb ▸ F-Script ▸ cycript
参考资料 ▸ Wikipedia ▸ System V Application Binary Interface (AMD64)
▸ Procedure Call Standard for the ARM 64-bit Architecture ▸ iOS ABI Function Call Guide ▸ The Swift ABI ▸ The Swift Calling Convention ▸ Friday Q&A
相关资源 ▸ https://github.com/apple/swift ▸ https://github.com/hankbao/DictObjc ▸ https://github.com/hankbao/DictSwift
THANKS Q & A
More Decks by Hank Bao
See All by Hank Bao
Notes on Gamification
hankbao
0
140
Functional Programming Practice in Swift
hankbao
4
120
Type-safe Programming Practice in Swift
hankbao
0
130
Other Decks in Programming
See All in Programming
LLM 101
dalinaum
0
540
小さなアプリを作って公開するまで
onozaty
0
240
はじめてのKubernetesコントリビューション
nasa9084
0
320
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
630
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
330
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
Skills Are the New npm [AAIF Bengaluru]
shivamsaraswat
0
120
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
700
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
610
Unsuck your backbone
ammeep
672
58k
Crafting Experiences
bethany
1
460
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
A better future with KSS
kneath
240
18k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
540
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k