Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is this POC yielding these results? #1301

Open
imliuxin opened this issue Dec 23, 2023 · 2 comments
Open

Why is this POC yielding these results? #1301

imliuxin opened this issue Dec 23, 2023 · 2 comments

Comments

@imliuxin
Copy link

What should I do?
poc.zip

@JonathanSalwan
Copy link
Owner

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

@imliuxin
Copy link
Author

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)  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants