-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathangr
64 lines (40 loc) · 1.79 KB
/
angr
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
# Converting a SimActionObject to claripy BVV
ipdb> string_address
<SAO <BV64 0x555555755060>>
ipdb> string_address.to_claripy()
<BV64 0x555555755060>
# Reading from memory
ipdb> real_addr
<BV64 0x555555755060>
data = current_state.memory._read_from(current_state.solver.eval(real_addr),8)
# Printing instruction
new_concrete_state.block(addr=0x4049bc).capstone.pp()
# Printing SimStates generated by exploration technique
sim_manager.py
-----------------
328: for state in self._fetch_states(stash=stash):
print(state)
# Hook an address with a SimProc object
new_concrete_state.project.hook(0x405337,angr.procedures.libc.strstr)
# Get 1 instruction from BB
current_state.block(addr=act.ins_addr, num_inst=1).capstone.pp()
# Get a solution for a conditions over a variable
# n is the number of solutions you want!
state.solver._eval(data,n)
# Create a BVV
weird_nine = state.solver.BVV(9, 27)
# Dump constraints
next_state.solver.constraints
# Set a breakpoint on a specific instruction
next_state.inspect.b('instruction', when=angr.BP_BEFORE, instruction= 0x40a75a)
# Drop all constraints
next_state.solver._stored_solver.constraints = []
next_state.solver.reload_solver()
#ERROR TROUBLESHOOTING
#==========================================
#PROBLEM
File "/home/degrigis/Projects/angr/angr-dev/claripy/claripy/backends/backend_z3.py", line 81, in _z3_decl_name_str
AttributeError: module 'z3' has no attribute 'Z3_get_symbol_string_bytes'
#SOLUTION
pip uninstall claripy && pip install -e ./claripy
#==========================================