Skip to content

Commit 4522868

Browse files
committed
More documentation
1 parent 496d40a commit 4522868

File tree

1 file changed

+58
-32
lines changed

1 file changed

+58
-32
lines changed

documentation/Manual.md

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,42 @@ Binary Ninja Debugger Plugin (BNDP) is a plugin for Binary Ninja implementing de
77

88
# Installation
99

10-
Please refer to the "Installation Instructions" section from `BNDP_ROOT/README.md`.
10+
## Host Requirements
1111

12-
# Usage
12+
* Processor: [x86-64](https://en.wikipedia.org/wiki/X86-64)
13+
* OS: one of
14+
* MacOS: 64-bit 10.14 "Mojave" or 10.15 "Catalina"
15+
* Linux: 64-bit Ubuntu (most recent LTS or latest stable)
16+
* Windows: 64-bit 10
17+
* Python: 3.7.4
18+
* Binary Ninja: at least version 1.3.2085
19+
20+
## Plugin Acquisition and Installation
21+
22+
BNDP is a python package and is acquired via github (http://github.com/vector35/debugger), by the Plugin Manager from within Binary Ninja, or by ordinary file and directory copying.
23+
24+
It must be placed in the Binary Ninja plugin path, which varies based on platform. Please refer to [Using Plugins](https://docs.binary.ninja/getting-started.html#using-plugins) section within the [Getting Started Guide](https://docs.binary.ninja/getting-started.html) in the [Binary Ninja User Documentation](https://docs.binary.ninja/).
25+
26+
## Platform Specific Considerations
27+
28+
### Android Phones
29+
30+
BNDP can debug armv7 and aarch64 targets by communicating with an appropriate gdbserver. We assume familiarity with the Android software development kit (SDK), native development kit (NDK) and the [Android Debug Bridge](https://developer.android.com/studio/command-line/adb). The servers from NDK version r15c were tested:
31+
32+
```
33+
adb push ~/android-ndk-r15c/prebuilt/android-arm64/gdbserver/gdbserver /data/local/tmp/gdbserver_aarch64
34+
adb push ~/android-ndk-r15c/prebuilt/android-arm/gdbserver/gdbserver /data/local/tmp/gdbserver_armv7
35+
```
36+
37+
Connect your local machine's 31337 to the phone's 31337 with `adb forward tcp:31337 tcp:31337`.
38+
39+
From the phone, run the appropriate gdbserver on the binary, telling it to listen on 31337, eg: `./gdbserver_aarch64 :31337 ./hello_aarch64-android`.
40+
41+
### MacOS
42+
43+
Developer mode is required, so a dialogue may have to be affirmed upon first launch of `lldb` and `/usr/sbin` must be in path so that `DevToolsSecurity` can be executed.
44+
45+
# Use
1346

1447
## GUI Mode
1548

@@ -68,30 +101,35 @@ See `BNDP_ROOT/cli.py` for an interactive console debugger.
68101

69102
## Automated Tests
70103

71-
Enter `BNDP_ROOT/testbins` and build the test binaries with the appropriate call for your environment:
104+
### Build Environment Requirements
72105

73-
```
74-
make -f Makefile-linux
75-
make -f Makefile-macos
76-
nmake -f Makefile-win
77-
```
106+
Building the tests requires an assembler, compiler, and make utility:
78107

79-
Then execute `BNDP_ROOT/test.py`.
108+
| OS | assembler | compiler | make |
109+
| ------- | ---------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
110+
| MacOS | Nasm v2.14.02 | Clang 11.0.0 | GNU Make 3.8.1 |
111+
| Linux | Nasm v2.13.02 | GCC 7.5.0 | GNU Make 4.1 |
112+
| Windows | Nasm v2.14.03rc2 | Visual Studio 2017<br />Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26730 for x64 | nmake<br />Microsoft (R) Program Maintenance Utility Version 14.15.26730.0 |
80113

81-
## Platform Specific Considerations
114+
These versions are used during development but are likely flexible.
82115

83-
### Android
116+
### Build Steps
84117

85-
Get gdbserver onto the phone, pushing both architectures. The servers from NDK version r15c were tested:
118+
All builds use make (nmake for Windows) and a shell (“x64 Native Tools Command Prompt for VS 2017” for Windows). Change to the debugger/testbins directory and run make/nmake, specifying the appropriate Makefile:
86119

87-
```
88-
adb push ~/android-ndk-r15c/prebuilt/android-arm64/gdbserver/gdbserver /data/local/tmp/gdbserver_aarch64
89-
adb push ~/android-ndk-r15c/prebuilt/android-arm/gdbserver/gdbserver /data/local/tmp/gdbserver_armv7
90-
```
120+
| OS | steps |
121+
| ------- | ------------------------------------------------------------ |
122+
| MacOS | $ cd BNDP_ROOT/testbins<br />$ make -f Makefile-macos |
123+
| Linux | $ cd BNDP_ROOT/testbins<br />$ make -f Makefile-linux |
124+
| Windows | c:\\> cd BNDP_ROOT\\testbins<br />c:\BNDP_ROOT\testbins> nmake -f Makefile-win64 |
91125

92-
Connect your local machine's 31337 to the phone's 31337 with `adb forward tcp:31337 tcp:31337`.
126+
### Python Requirements
93127

94-
From the phone, run the appropriate gdbserver on the binary, telling it to listen on 31337, eg: `./gdbserver_aarch64 :31337 ./hello_aarch64-android`.
128+
The python package `colorama` is required and can be installed with: `pip3 install colorama`.
129+
130+
### Running
131+
132+
Simply execute `BNDP_ROOT/test.py`.
95133

96134
# Internals
97135

@@ -135,6 +173,8 @@ The stubs implemented by gdbserver and debugserver will not step over an address
135173

136174
## GDB vs. LLDB
137175

176+
The following differences were noted during development and are not an exhaustive list:
177+
138178
lldb has single reg reads with 'p' packet, but in gdb registers must be read in group with 'g' packet.
139179

140180
lldb can have its registers polled with 'qRegisterInfo' packet, but gdb uses only XML target description.
@@ -171,17 +211,3 @@ Monitoring, then mimicing behavior from working tools is often faster than start
171211

172212
`(lldb) process connect connect://localhost:31337`
173213

174-
175-
176-
177-
178-
179-
180-
181-
182-
183-
184-
185-
186-
187-

0 commit comments

Comments
 (0)