本文整理汇总了Python中angr.SimState.stack_push方法的典型用法代码示例。如果您正苦于以下问题:Python SimState.stack_push方法的具体用法?Python SimState.stack_push怎么用?Python SimState.stack_push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angr.SimState
的用法示例。
在下文中一共展示了SimState.stack_push方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_state
# 需要导入模块: from angr import SimState [as 别名]
# 或者: from angr.SimState import stack_push [as 别名]
def test_state():
s = SimState(arch='AMD64')
s.registers.store('sp', 0x7ffffffffff0000)
nose.tools.assert_equals(s.se.eval(s.registers.load('sp')), 0x7ffffffffff0000)
s.stack_push(s.se.BVV("ABCDEFGH"))
nose.tools.assert_equals(s.se.eval(s.registers.load('sp')), 0x7fffffffffefff8)
s.stack_push(s.se.BVV("IJKLMNOP"))
nose.tools.assert_equals(s.se.eval(s.registers.load('sp')), 0x7fffffffffefff0)
a = s.stack_pop()
nose.tools.assert_equals(s.se.eval(s.registers.load('sp')), 0x7fffffffffefff8)
nose.tools.assert_equals(s.se.eval(a, cast_to=str), "IJKLMNOP")
b = s.stack_pop()
nose.tools.assert_equals(s.se.eval(s.registers.load('sp')), 0x7ffffffffff0000)
nose.tools.assert_equals(s.se.eval(b, cast_to=str), "ABCDEFGH")
示例2: test_crosspage_read
# 需要导入模块: from angr import SimState [as 别名]
# 或者: from angr.SimState import stack_push [as 别名]
def test_crosspage_read():
state = SimState(arch='ARM')
state.regs.sp = 0x7fff0008
state.stack_push(0x44556677)
state.stack_push(0x1)
state.stack_push(0x2)
state.stack_push(0x3)
state.stack_push(0x4)
state.stack_push(0x99887766)
state.stack_push(0x5)
state.stack_push(0x105c8)
state.stack_push(0x11223344)
state.stack_push(0x10564)
r = state.memory.load(state.regs.sp, 40)
assert bytes.fromhex("77665544") in state.solver.eval(r, cast_to=bytes)