angr 约束的ast孩子
solver.constraints[0]是angr当前state的第一个约束,是ast形式来展示的,其中,以下接口与约束的孩子有关,即得到约束的叶子或者子树
以下返回结果大部分只有BVV和BVS类型,不包含int类型(如扩展位数操作的32和8),args会返回int类型的数
# | Description | Method |
---|---|---|
返回两个子树 | 此ast节点的孩子子树 | state.solver.constraints[0].args |
返回所有子树 | 此ast节点的所有孩子子树,对于位数扩展操作,仅有被扩展的ast,没有扩展的位数作为子树,我认为可能是仅仅记录BVV和BVS,不记录int | list(state.solver.constraints[0].children_asts()) |
list(state.solver.constraints[0].recursive_children_asts) |
||
返回所有叶子 | 其BVV和BVS的叶子节点 | list(state.solver.constraints[0].leaf_asts()) |
list(state.solver.constraints[0].recursive_leaf_asts) |
这是以下运行结果和相应代码
state.solver.constraints[0]:
<Bool SignExt(24, __wql_func_arg_3___42_64[7:0]) - 0x25 > 0xa>
-----------------------------------------------
state.solver.constraints[0].args:
(<BV32 SignExt(24, __wql_func_arg_3___42_64[7:0]) - 0x25>, <BV32 0xa>)
-----------------------------------------------
list(state.solver.constraints[0].children_asts()):
[<BV32 SignExt(24, __wql_func_arg_3___42_64[7:0]) - 0x25>, <BV32 SignExt(24, __wql_func_arg_3___42_64[7:0])>, <BV8 __wql_func_arg_3___42_64[7:0]>, <BV64 __wql_func_arg_3___42_64>, <BV32 0x25>, <BV32 0xa>]
-----------------------------------------------
list(state.solver.constraints[0].leaf_asts()):
[<BV32 0xa>, <BV32 0x25>, <BV64 __wql_func_arg_3___42_64>]
-----------------------------------------------
list(state.solver.constraints[0].recursive_children_asts):
[<BV32 SignExt(24, __wql_func_arg_3___42_64[7:0]) - 0x25>, <BV32 SignExt(24, __wql_func_arg_3___42_64[7:0])>, <BV8 __wql_func_arg_3___42_64[7:0]>, <BV64 __wql_func_arg_3___42_64>, <BV32 0x25>, <BV32 0xa>]
-----------------------------------------------
list(state.solver.constraints[0].recursive_leaf_asts):
[<BV32 0xa>, <BV32 0x25>, <BV64 __wql_func_arg_3___42_64>]
print(state.solver.constraints[0])
print("-----------------------------------------------")
print("state.solver.constraints[0].args:")
print(state.solver.constraints[0].args)
print("-----------------------------------------------")
print("list(state.solver.constraints[0].children_asts()):")
print(list(state.solver.constraints[0].children_asts()))
print("-----------------------------------------------")
print("list(state.solver.constraints[0].leaf_asts()):")
print(list(state.solver.constraints[0].leaf_asts()))
print("-----------------------------------------------")
print("list(state.solver.constraints[0].recursive_children_asts):")
print(list(state.solver.constraints[0].recursive_children_asts))
print("-----------------------------------------------")
print("list(state.solver.constraints[0].recursive_leaf_asts):")
print(list(state.solver.constraints[0].recursive_leaf_asts))
_arg_registers, Value: {32, 64, 96, 72, 80, 24, 88}
_function_map, Value: FunctionDict({4210688: <Function _init (0x404000)>, 4210720: <Function sub_404020 (0x404020)>,