# Kazma Reverse Engineering 課前準備
## 課程資源
- https://github.com/kazmatw/Kazma-Reverse-Engineering-Course
- 所有上課會用到的簡報跟檔案、作業都在以上的 REPO 中
- 使用方式是按下右上角的星星符號後,在終端機輸入以下的指令:
```bash=
git clone https://github.com/kazmatw/Kazma-Reverse-Engineering-Course.git
```
## 必要準備
- 安裝 IDA Free,不限平台(ARM 也行)
- 有其他版本的 IDA Free 則不用再次安裝!
- 首先到 https://hex-rays.com/ida-free

- 輸入你的信箱(拜託不要輸入我的),按下 request
- 去信箱收信,然後點下面這個按鈕
- 或是直接到這個網址:https://my.hex-rays.com/dashboard/download-center/9.0sp1/ida-free
- 然後到 Download center 下載 9.0sp1(security patches),按照你的平台下載對應的版本
- 到 Licenses 下載你的 key
- 接著可以參考安裝手冊,這邊以 mac arm64 做示範
- https://docs.hex-rays.com/getting-started/install-ida
- 解壓縮安裝檔,照著步驟做
- 把 `ida.hexlic` 丟到 `$HOME/.idapro` 再啟動 IDA
- 啟動後確定你的 `ida.hexlic` 位置是正確的
- 安裝完成!
- 準備 x86-64 Linux 環境
- Ubuntu is ok!
- 可以參考:https://hackmd.io/@SCIST/VM_doc
- 若安裝上有問題,也無法透過查詢資料解決,請盡快尋求助教協助
- 安裝 GEF 在你的 Linux 環境上
- pwndbg 或其他插件也可以
- https://github.com/hugsy/gef
- github 上面有安裝教學,如果失敗的話請找助教求救,以下方式擇一即可!
```bash# via the install script
## using curl
$ bash -c "$(curl -fsSL https://gef.blah.cat/sh)"
## using wget
$ bash -c "$(wget https://gef.blah.cat/sh -O -)"
# or manually
$ wget -O ~/.gdbinit-gef.py -q https://gef.blah.cat/py
$ echo source ~/.gdbinit-gef.py >> ~/.gdbinit
# or alternatively from inside gdb directly
$ gdb -q
(gdb) pi import urllib.request as u, tempfile as t; g=t.NamedTemporaryFile(suffix='-gef.py'); open(g.name, 'wb+').write(u.urlopen('https://tinyurl.com/gef-main').read()); gdb.execute('source %s' % g.name)
```
## 有時間可以看看
- 了解基本的 C 語言開發
- 編譯和執行
- 基本的資料型態
- 有/無號數 & 二補數
- 位元運算
- 常用函式:`printf()`、`scanf()` 等
- 指標、取址、陣列等
- 了解基本的 linux 指令
- 可以參考 Kazma Linux 課程前半段的指令介紹:
- https://github.com/kazmatw/Kazma-Linux-Course.git
- 使用方式是按下右上角的星星符號後,在終端機輸入以下的指令:
```bash=
git clone https://github.com/kazmatw/Kazma-Linux-Course.git
```