在學習逆向工程的過程中,有時將 ELF 檔(執行檔),有些丟進 IDA 後只剩下 sub_401000
、loc_80483F4
這種沒有特殊意義的編號,這就是程式經過了 strip 處理,藉由 strip 我們可以刪除可執行檔中的以下資訊:
因此經過 strip
的程式,檔案大小會變小,可讀的資訊也會變少,但依然可以正常執行
縮小檔案大小
在嵌入式系統、IoT 裝置這類空間有限的環境,strip 後能省下幾百 KB ~ 幾 MB
提升安全性
checkLicense()
、verifyPassword()
函式名稱,破解就變得非常簡單。sub_xxx
,分析難度就會提升為發佈版本的標準做法
在 Linux 中,我們可以用 file
指令來檢查:
file 檔案
例如:
test_program: ELF 64-bit LSB executable, x86-64, dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0,
not stripped
test_program: ELF 64-bit LSB executable, x86-64, dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0,
stripped