pwndbg installation problems
Normal Installation
1 |
|
Problem I
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3-venv : Depends: python3.8-venv (>= 3.8.2-1~) but it is not going to be installed
Depends: python3 (= 3.8.2-0ubuntu2) but 3.10.4-0ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
- 如果遇到這種的問題,就直接分析setup.sh是crash在哪邊,照理說應該是跟python的版本有關係,想我的狀況是原本安裝python3的version是3.10,而不是3.8,所以最直接的做法是修改setup.sh file,在第23行的地方修改一下,直接指定安裝的版本,另外
# original sudo apt-get install -y git gdb gdbserver python3-dev python3-venv python3-pip python3-setuptools libglib2.0-dev libc6-dbg
# revised sudo apt-get install -y git gdb gdbserver python3-dev=3.8.2-0ubuntu2 python3-venv=3.8.2-0ubuntu2 python3-pip python3-setuptools libglib2.0-dev libc6-dbg
- 另外如果gdb吃的python版本不是3.8,就需要直接指定,也就是在第172行的地方新增版本
$ PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))') $ PYVER="3.8" # 直接指定,上面那行不要刪掉
然後安裝python3.8
1
$ sudo apt install python3.8
- 如果還是不行就強制把python3的版本改成3.81
1
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
此時應該會看到
dpkg -l|grep python
中,python3的結果應該是3.8.2-0ubuntu2
- 另外如果gdb吃的python版本不是3.8,就需要直接指定,也就是在第172行的地方新增版本
- 如果都不行,就全部砍掉2,語法如下,理論上應該就沒剩多少了,如果查看python會發現沒有這個command
1
2
3$ sudo apt-get remove --auto-remove python3.10 $ sudo apt-get remove --auto-remove python3. $ dpkg -l|grep python
- 此時應該就可以正常安裝了
$ ./setup.sh
.
Problem II
1 |
|
碰到這個問題的前提是已經安裝好了(setup的部分完成),那就直接安裝python3-distutils就好了
1 |
|
Problem III
如果是沒有Pwngdb
的folder的話就直接拿已經安裝好的電腦,然後複製整個資料夾到~/
就好了
Problem IV
如果下gdb發現沒有使用任何plugin就要檢查.gdbinit的檔案怎麼寫,例如我的文件有gef和pwndbg,如果要使用其中一種,另外一個就要全部註解,才不會出錯
1 |
|
到最後安裝的結果就會如下 :::spoiler Complete Result
1 |
|
:::