MC-Semantics (或者 mcsema, 发音 ‘em see se ma’) 是一个用来将机器码翻译成 LLVM IR 的库,包括如下几个子项目:
Control Flow Recovery
Instruction Semantics
Binary File Parsing
Semantics Testing
示例:
C:\dev\llvm-new\mc-sema\tests>demo2 Could Not Find C:\dev\llvm-new\mc-sema\tests\demo_test2.cfg getFunc: Starting at 0x1 1: movl %eax, %ecx 3: xorl %eax, %eax 5: incl %eax 6: xorl %ebx, %ebx 8: cmpl %ecx, %ebx a: je 5 c: addl %eax, %eax e: incl %ebx f: jmp -9 8: cmpl %ecx, %ebx a: je 5 11: ret getFunc: Function recovery complete for func at 1 Adding entry point: demo2_entry demo_driver2.c 0x100