Triton icon indicating copy to clipboard operation
Triton copied to clipboard

Why is this POC yielding these results?

Open imliuxin opened this issue 1 year ago • 2 comments

What should I do? poc.zip

imliuxin avatar Dec 23 '23 14:12 imliuxin

You should probably first post your snippet of code and a short description of the issue in this thread.

JonathanSalwan avatar Dec 23 '23 15:12 JonathanSalwan

the code of before simple:

or eax,FFFFFFFF
xor edx,edx
div dword ptr ss:[ebp+14]
mov esi,dword ptr ds:[ecx+C8]
mov dword ptr ss:[ebp-8],edx
movzx ecx,bl
movzx ecx,word ptr ds:[esi+ecx*2] mov edx,ecx

the code of after simple:

or eax,FFFFFFFF
xor edx,edx
div dword ptr ss:[ebp+14]

the content of poc file:

from triton import *

if name == 'main': # Set the architecture ctx = TritonContext(ARCH.X86) # Set a symbolic optimization mode ctx.setMode(MODE.ALIGNED_MEMORY, True)

block = BasicBlock([Instruction(b"\x83\xc8\xff"),
    Instruction(b"\x33\xd2"),
    Instruction(b"\xf7\x75\x14"),
    Instruction(b"\x8b\xb1\xc8\x00\x00\x00"),
    Instruction(b"\x89\x55\xf8"),
    Instruction(b"\x0f\xb6\xcb"),
    Instruction(b"\x0f\xb7\x0c\x4e"),
    Instruction(b"\x8b\xd1")
    ])

ctx.disassembly(block, 0x40149f)
print(block)
print('-------------')
sblock = ctx.simplify(block)
ctx.disassembly(sblock, 0x40149f)
print(sblock)  

imliuxin avatar Dec 24 '23 08:12 imliuxin