FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
voltron/examples/client.py at master · nobeee/voltron · GitHub
nobeee
/
voltron
Public
forked from
snare/voltron
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
voltron
/
examples
/
client.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
64 lines (54 loc) · 1.95 KB
Breadcrumbs
voltron
/
examples
/
client.py
Copy path
File metadata and controls
64 lines (54 loc) · 1.95 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python
"""
Example Voltron client.
Start your debugger as follows:
$ lldb /tmp/inferior
Voltron loaded.
Run `voltron init` after you load a target.
(lldb) target create "/tmp/inferior"
Current executable set to '/tmp/inferior' (x86_64).
(lldb) voltron init
Registered stop-hook
(lldb) b main
Breakpoint 1: where = inferior`main, address = 0x0000000100000cf0
(lldb) run
Process 13185 launched: '/Volumes/Data/Users/snare/code/voltron/repo/tests/inferior' (x86_64)
Process 13185 stopped
* thread #1: tid = 0x1ee63, 0x0000000100000cf0 inferior`main, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100000cf0 inferior`main
inferior`main:
-> 0x100000cf0: push rbp
0x100000cf1: mov rbp, rsp
0x100000cf4: sub rsp, 0x50
0x100000cf8: mov dword ptr [rbp - 0x4], 0x0
Run this client in another terminal. Each time you `stepi` in the debugger,
the client will output the current RIP:
$ python client.py
Instruction pointer is: 0x100000CFF
Instruction pointer is: 0x100000D02
Instruction pointer is: 0x100000D06
Instruction pointer is: 0x100000D0D
Instruction pointer is: 0x100000D15
Instruction pointer is: 0x100000D1C
"""
import
voltron
from
voltron
.
core
import
Client
def
main
():
# Create a client and connect to the server
client
=
Client
()
# Main event loop
while
True
:
# Wait for the debugger to stop again
res
=
client
.
perform_request
(
'version'
,
block
=
True
)
if
res
.
is_success
:
# If nothing went wrong, get the instruction pointer and print it
res
=
client
.
perform_request
(
'registers'
,
registers
=
[
'rip'
])
if
res
.
is_success
:
print
(
"Instruction pointer is: 0x{:X}"
.
format
(
res
.
registers
[
'rip'
]))
else
:
print
(
"Failed to get registers: {}"
.
format
(
res
))
else
:
print
(
"Error waiting for the debugger to stop: {}"
.
format
(
res
))
break
if
__name__
==
"__main__"
:
main
()
Back
|
FazBrowse Home
|
New Git URL