> ## Content Index
> Fetch the complete content index at: https://blog.hacking.pub/llms.txt
> Use this file to discover other available public pages before exploring further.

# edb  安装小记
- URL: https://blog.hacking.pub/2016/11/03/edb-an-zhuang-xiao-ji/
- Published: 2016-11-03T13:16:27.000Z
- Updated: 2016-11-23T06:01:52.000Z
- Author: chainhelen
- Tags: edb, ollydbg, boost, qt, git, github, 逆向

#### 发现神器

逆向工具ollydbg对于64位支持不好，而且只是windows下而已。发现神器edb，linux下qt编写而成。  
[github地址](https://github.com/eteran/edb-debugger?ref=blog.hacking.pub)，我当前系统是xubuntu 15.04 64位系统。

#### 安装

下载qt，qt[官网地址](https://www.qt.io/download-open-source/?ref=blog.hacking.pub#section-2)，下载.run文件，然后./xxx.run，安装图形界面安装即可。或者

```
sudo apt-get install qt-sdk

```

下载edb源码

```
git clone git@github.com:eteran/edb-debugger.git

```

安装命令如下：

```
$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./edb

```

###### 问题１

但是我在cmake ..的时候报错，如下： 

![错误](http://image.hacking.pub/s/acuskbwb5fgwjn7/boostheaderfiles.png?dl=0)

没有boost头文件，安装boost完美解决

```
$ sudo apt-get install libboost-all-dev

```

###### 问题２

然后..... 新的错误，[线索戳这](http://www.capstone-engine.org/documentation.html?ref=blog.hacking.pub) 

![capstone](http://image.hacking.pub/s/yzlz97i3y2zkwtd/capstone.png?dl=0) 

```
//如果仅仅安装二进制，我们选这种就可以了
sudo apt-get install libcapstone2
//如果需要安装开发
sudo apt-get install libcapstone-dev

```

###### 问题３

还是有问题，报错如下。FindQt5Core.cmake找不到。

```
CMake Warning at CMakeLists.txt:38 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any
  of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.

-- Configuring done

```

解决命令如下

```
sudo apt-get install qt5-default

```

###### 问题4

```
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26 (find_package):
  Could not find a package configuration file provided by "Qt5XmlPatterns"
  with any of the following names:

    Qt5XmlPatternsConfig.cmake
    qt5xmlpatterns-config.cmake

  Add the installation prefix of "Qt5XmlPatterns" to CMAKE_PREFIX_PATH or set
  "Qt5XmlPatterns_DIR" to a directory containing one of the above files.  If
  "Qt5XmlPatterns" provides a separate development package or SDK, be sure it
  has been installed.
Call Stack (most recent call first):
  src/CMakeLists.txt:26 (find_package)

```

解决命令

```
sudo apt-get install libqt5xmlpatterns5-dev

```

###### 问题５

```
  Could not find a package configuration file provided by "Qt5Svg" with any
  of the following names:

    Qt5SvgConfig.cmake
    qt5svg-config.cmake

```

解决问题

```
apt install libqt5svg5-dev

```

###### 问题６

```
CMake Error at src/CMakeLists.txt:198 (add_executable):
  Cannot find source file:
    qjson4/QJsonArray.h

```

[线索](https://github.com/eteran/edb-debugger/issues/449?ref=blog.hacking.pub)，子模块的问题，tar.gz和.zip等格式的源码上传github后，包含在其中的子模块就不见了。  
重新[下载](https://github.com/eteran/edb-debugger/releases?ref=blog.hacking.pub)源码的tgz格式，重新编译。

#### 成功安装

cmake 成功后，直接make即可。

![edb](http://image.hacking.pub/s/o8emg07t5nhrk4h/edb.png?dl=0)  
![edb_main](http://image.hacking.pub/s/rzotdwupf63jh38/edb_main.png?dl=0)

#### 实例

###### 1\. 编写代码如下，gcc编译

```
#include <stdio.h>

int main() {
    printf("hello world\n");
    return 0;
}

```

###### 2\. F3 热键 打开文件

![start_edb](http://image.hacking.pub/s/kkk30ot3p86bcub/start.png?dl=0)

###### 3\. F8 跟踪代码

一直到0040052a的地方，鼠标右击选中，选择Follow Constant In Dump  
此时注意Data Dump的窗口

![dump](http://image.hacking.pub/s/x530677dxpv84e0/smart_dump.png?dl=0)

###### 4\. 修改输出字符串

在Data Dump的窗口，右击"hello world"的第一个出现的"l"，选择 edit bytes，修改字节为B

![edit_bytes](http://image.hacking.pub/s/leea237iw4d9if6/smart_dump3.png?dl=0)

###### 5\. F9 运行

可以得到结果

![output](http://image.hacking.pub/s/qja2evnipm46nmu/smart_dump4.png?dl=0)

**未经同意，禁止转载**  
[本文地址 http://blog.hacking.pub/2016/11/03/edb-an-zhuang-xiao-ji/](https://blog.hacking.pub/2016/11/03/edb-an-zhuang-xiao-ji/)