0

I need something like that for x86 arch:

mov edi, dword ptr [0x7fc70000]
add edi, 0x11
sub edi, 0x33F0B753

After Z3 simplification I have got (memory 0x7FC70000 is symbolized):

bvadd (_ bv3423553726 32) MEM_0x7FC70000

The last step is converting Z3's AST into ASM code to get result like this:

mov edi, dword ptr [0x7fc70000]
add edi, 0xCC0F48BE

Is there any efficient way to perform last step? Should I parse SMT formula and convert it manually (bv -> mov...)?

DBenson
  • 377
  • 3
  • 12
  • 1
    Almost a duplicate of [What is the best way to translate Z3's AST into ASM code?](https://stackoverflow.com/q/61801235), arguably it still is. Or if not then it's pretty broad, I mean writing an optimizing compiler is not exactly something that fits in an SO answer. You might consider transforming it to LLVM-IR to let LLVM's optimizing compiler do register allocation and so on to make whole functions out of statements like this. – Peter Cordes May 15 '20 at 19:16
  • 2
    Does this answer your question? [What is the best way to translate Z3's AST into ASM code?](https://stackoverflow.com/questions/61801235/what-is-the-best-way-to-translate-z3s-ast-into-asm-code) – alias May 15 '20 at 20:18

0 Answers0