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
460
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
More Decks by Hank Bao
See All by Hank Bao
Notes on Gamification
hankbao
0
130
Functional Programming Practice in Swift
hankbao
4
110
Type-safe Programming Practice in Swift
hankbao
0
120
Other Decks in Programming
See All in Programming
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
390
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1.1k
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
320
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
130
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
320
自動化したのに回らないテスト運用の壁ーAI時代の品質責任と生産性
mfunaki
1
140
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
540
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
150
yield再入門 #phpcon
o0h
PRO
0
1.2k
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
110
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.8k
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
340
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
24k
Utilizing Notion as your number one productivity tool
mfonobong
4
550
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
630
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
780
Documentation Writing (for coders)
carmenintech
77
5.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
250
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
900
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
660
Thoughts on Productivity
jonyablonski
76
5.3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
Git: the NoSQL Database
bkeepers
PRO
432
67k
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