Пример #1
0
    def reset(self):
        triton.resetEngines()
        triton.clearPathConstraints()
        triton.setArchitecture(self.arch)

        triton.enableMode(triton.MODE.ALIGNED_MEMORY, True)
        triton.enableMode(triton.MODE.ONLY_ON_SYMBOLIZED, True)

        triton.addCallback(self.memoryCaching,
                           triton.CALLBACK.GET_CONCRETE_MEMORY_VALUE)
        triton.addCallback(self.constantFolding,
                           triton.CALLBACK.SYMBOLIC_SIMPLIFICATION)

        for r in self.regs:
            if r in self.triton_regs:
                triton.setConcreteRegisterValue(
                    triton.Register(
                        self.triton_regs[r], self.regs[r] &
                        ((1 << self.triton_regs[r].getBitSize()) - 1)))

        for m in cache:
            self.write_mem(m['start'], m["data"])

        for address in self.inputs:
            self.inputs[address] = triton.convertMemoryToSymbolicVariable(
                triton.MemoryAccess(address, triton.CPUSIZE.BYTE))
Пример #2
0
    def reset(self):
        triton.resetEngines()
        triton.clearPathConstraints()
        triton.setArchitecture(self.arch)

        triton.enableMode(triton.MODE.ALIGNED_MEMORY, True)
        triton.enableMode(triton.MODE.ONLY_ON_SYMBOLIZED, True)

        triton.addCallback(self.memoryCaching,
                           triton.CALLBACK.GET_CONCRETE_MEMORY_VALUE)
        triton.addCallback(self.constantFolding,
                           triton.CALLBACK.SYMBOLIC_SIMPLIFICATION)

        for r in self.regs:
            if r in self.triton_regs:
                triton.setConcreteRegisterValue(
                    triton.Register(self.triton_regs[r], self.regs[r] & ((1 << self.triton_regs[r].getBitSize()) - 1))
                )

        for m in cache:
            self.write_mem(m['start'], m["data"])

        for address in self.inputs:
                self.inputs[address] = triton.convertMemoryToSymbolicVariable(
                    triton.MemoryAccess(
                        address,
                        triton.CPUSIZE.BYTE
                    )
                )
Пример #3
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.AST_DICTIONARIES, True)
     super(TestSymboliqueEngineConcreteAst, self).setUp()
Пример #4
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.ALIGNED_MEMORY, True)
     enableMode(MODE.AST_DICTIONARIES, True)
     super(TestSymboliqueEngineAlignedAst, self).setUp()
Пример #5
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.AST_DICTIONARIES, True)
     super(TestSymboliqueEngineConcreteAst, self).setUp()
Пример #6
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.ALIGNED_MEMORY, True)
     enableMode(MODE.AST_DICTIONARIES, True)
     super(TestSymboliqueEngineAlignedAst, self).setUp()
Пример #7
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.ALIGNED_MEMORY, True)
     enableMode(MODE.ONLY_ON_SYMBOLIZED, True)
     super(TestSymboliqueEngineAlignedOnlySym, self).setUp()
Пример #8
0
 def setUp(self):
     """Define the arch and modes."""
     setArchitecture(ARCH.X86_64)
     enableMode(MODE.ALIGNED_MEMORY, True)
     enableMode(MODE.ONLY_ON_SYMBOLIZED, True)
     super(TestSymboliqueEngineAlignedOnlySym, self).setUp()