Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Reverse Engineering: from Objective-C to Swift
Search
Hank Bao
April 23, 2016
Programming
2
440
Reverse Engineering: from Objective-C to Swift
逆向工程:从 Objective-C 到 Swift
2016年4月23日在 SwiftCon China 2016 上的分享
Hank Bao
April 23, 2016
Tweet
Share
More Decks by Hank Bao
See All by Hank Bao
Notes on Gamification
hankbao
0
120
Functional Programming Practice in Swift
hankbao
4
110
Type-safe Programming Practice in Swift
hankbao
0
110
Other Decks in Programming
See All in Programming
CEDEC 2025 『ゲームにおけるリアルタイム通信への QUIC導入事例の紹介』
segadevtech
3
970
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
2.6k
物語を動かす行動"量" #エンジニアニメ
konifar
14
5.4k
CSC305 Summer Lecture 05
javiergs
PRO
0
110
AHC051解法紹介
eijirou
0
620
コーディングエージェント時代のNeovim
key60228
1
100
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
200
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
210
SOCI Index Manifest v2が出たので調べてみた / Introduction to SOCI Index Manifest v2
tkikuc
1
110
大規模FlutterプロジェクトのCI実行時間を約8割削減した話
teamlab
PRO
0
490
Laravel Boost 超入門
fire_arlo
1
120
CEDEC2025 長期運営ゲームをあと10年続けるための0から始める自動テスト ~4000項目を50%自動化し、月1→毎日実行にした3年間~
akatsukigames_tech
0
150
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
480
The Invisible Side of Design
smashingmag
301
51k
Bash Introduction
62gerente
614
210k
Gamification - CAS2011
davidbonilla
81
5.4k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
4 Signs Your Business is Dying
shpigford
184
22k
How to Ace a Technical Interview
jacobian
279
23k
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Docker and Python
trallard
45
3.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
890
Transcript
逆向⼯程 从 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