Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introducing Reverse Engineering @ YZU CS250
Search
racterub
June 15, 2020
Programming
0
220
Introducing Reverse Engineering @ YZU CS250
Introducing Reverse Engineering @ YZU CS250
racterub
June 15, 2020
Tweet
Share
More Decks by racterub
See All by racterub
IM620 Web Security
racterub
0
120
ITAC | Websec 3
racterub
0
240
ITAC | Websec 2
racterub
0
200
ITAC | Websec 1
racterub
0
240
ITAC | Linux Basics
racterub
0
110
ITAC | Jinja & Bootstrap
racterub
1
100
ITAC | Flask - Basic Flask
racterub
1
100
ITAC-Flask | Environment setup
racterub
1
77
Other Decks in Programming
See All in Programming
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.8k
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
160
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
240
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
500
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
140
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
130
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
430
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
270
tparseでgo testの出力を見やすくする
utgwkk
2
260
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
120
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.7k
Featured
See All Featured
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
22
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
20
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
23
Designing for Performance
lara
610
69k
From π to Pie charts
rasagy
0
86
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
120
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
580
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
980
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
40
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
510
Transcript
Introducing Reverse Engineering Racterub @ YZU CS250 1
About me • 元智 電機通訊學院英語學⼠班 ⼤⼀ • ⽬前主要玩的領域是資安 • 去年混分拿到了⺠⽣物聯網漏洞挖掘競賽第⼆期第三名
2
https://ppt.cc/f8C9Gx 有電腦的可以載⼀下 今天會有 lab 讓你們試試
工具包 • IDA Free 資料夾裡⾯選你的系統安裝就好了 Linux MacOS Windows
逆向? 你們熟悉的應該是 5
None
軟體逆向通常是夠過透 過組語來了解一支程式 的運行方式 7
今天有一題小 lab 這邊會先教一點 AMD64(x86-64) 的 東⻄ 8
X64 calling convention •這裡講的是 AMD64 不是 Intel 64 •Function 的參數是以這樣的順序排的
•RDI, RSI, RDX, RCX, R8, R9 •所以 function(123, 456) 時 •RDI => 123 •RSI => 456 9
Registers •R[A-D]X, RSI, RDI => 8 bytes •E[A-D]X, ESI, EDI
=> 4 bytes •[A-D]X, SI, DI => 2 bytes •AX -> AH AL => 1 bytes •RBP -> stack 底部 •RSP -> stack 頂部
Registers • RAX -> 0x1234567890abcdef • EAX -> 0x90abcdef •
AX -> 0xcdef • AH -> 0xcd • AL -> 0xef RAX = 0x1234 5678 90ab cdef 11
⼀個古老的例⼦ •++i v.s. i++ •在古老的時代,事實上 ++i 的效能會比較好 •這是由逆向程式後觀察組語發現的特性 •不過現在 MSVC
跟 glibc 大概都優化到差不多了 •(要調高優化) 12
#include <stdio.h> int main(int argc, char *argv[]) { int i=0;
printf("Original i: %d\n", i); printf("i++: %d\n", i++); printf("++i: %d\n", ++i); return 0; } 13
▲Compiled on Ubuntu 18.04 with GCC * gcc -no-pie test.c
-o test -g * (預設優化為 -O1) 14
逆向入門 15
逆向 • 硬體 ▲ Firmware analysis @ AIS3 2019 16
逆向 • 軟體 ▲IDA Pro 分析 x64 binary
C/C++ 的逆向? 18
C/C++ Reversing •當你將一隻由 C/C++ 撰寫得程式編譯之後不論你是 object file 還是 binary ,都可以拿來逆向
•通常不同平台、不同編譯器產出來的東⻄都不太一樣 •但是透過 disassembler/debugger 還是可以正常了解程式 的流程跟邏輯 19
C/C++ Reversing •動態分析 •GDB 20
C/C++ •靜態分析 •objdump 直接嗑組語 •IDA Pro, Ghidra, Radare2 •IDA Pro
是付費的,但是有出免費版 IDA Free 21
None
23
Lab 24
https://ppt.cc/fttGHx 只需要對 demo_linux 逆向就好 25
其他語言的逆向 26
其他語⾔的逆向 • Python • Python 有⼀個功能是可以將 py 檔編譯檔 • 使⽤
uncompyle6 就可以把編譯檔還原出程式碼 • 雖然有時候會爛掉 27
其他語⾔的逆向 • Java • 透過 JAD 或是 JD-GUI 反編譯 ▲JD-GUI
反編譯的樣子
逆向可以幹嘛? 29
當你組員寫出了一個壞掉的程式作 業,然後程式碼也被刪掉了 那就逆向硬幹 30
當你組員寫出了一個壞掉的程式作 業,然後程式碼也被刪掉了 那就逆向硬幹 不過我猜這個情境發生的機率大概不高辣 31
▲https://github.com/Inndy/garena-authenticator ▲https://github.com/Inndy/twnhi-smartcard-agent 32
▲https://github.com/x43x61x69/Easy-Card 33
▲https://github.com/x43x61x69/Easy-Card/blob/ 8f981ff718480d5a67b7afdec9324559685607cb/bin/easycard.py 34
35
36
37
▲WannaCry 38
▲IDA Pro 分析 WannaCry 39
▲上一張組語轉成偽代碼的部分 40
Magisk Cydia 41 ▲越獄 / Root 所需要的漏洞也是由逆向而來的
逆向就是要了解程式碼 跟組合語言之間關係 42
要知道你的 code 編譯會⻑怎 樣,也要知道組合語言的邏 輯合起來會等同於什麼 code 43
跟你寫程式一樣,你寫 code 就要知道你的 code 運作的方式
QA? 45
https://ppt.cc/f7FKFx 46