NewsWhat's New

Morphing Attributes

Morphing Attributes There is a possibility to select a subset of functions to be processed by Morpher. Such selection is ...

Articles, Oct. 24, 2011

ABI: problems of C++ programs compatibility at the binary interface level

Introduction The C++ language standard strictly defines semantics of all language constructs. However, it does not specify how these constructs ...

Articles, June 14, 2011

CFG arches meshing

features, March 15, 2010

Add to Cart

Opaque predicates insertion

opaquepredicate

Description

The conditionals are extra protected with opaque predicates, which are always evaluated to true to false, but this fact cannot be automatically proved.

Transformed Code

See Appendix A. Demo for original sources.

	public _Process
.align 16
_Process proc near
push EBP
push EBX
push EDI
push ESI
sub ESP, 4
mov ECX, 2863311531
mov ESI, DWORD PTR [ESP + 36]
mov EAX, ESI
mul ECX
shr EDX
lea EAX, DWORD PTR [EDX + 2*EDX]
mov ECX, ESI
sub ECX, EAX
cmp ECX, 4294967295
sete AL
movzx EAX, AL
cmp ESI, EAX
jle .LBB2_12
.LBB2_1: ; %bb.nph16
mov EAX, DWORD PTR [ESP + 32]
mov ECX, EAX
imul ECX, ECX
mov EDX, EAX
or EDX, 2
mov ESI, EAX
xor ESI, 2
neg ESI
cmp EDX, ESI
setne DL
movzx EDX, DL
mov ESI, EAX
sub ESI, EDX
and ECX, 3
cmp ECX, 2
setb AL
movzx EAX, AL
mov DWORD PTR [ESP], EAX
xor EAX, EAX
.LBB2_2: ; %bb
mov ECX, EAX
mov EAX, DWORD PTR [ESP]
cmp DWORD PTR [ESP + 32], EAX
mov EAX, DWORD PTR [ESP + 24]
cvttsd2si EDI, QWORD PTR [EAX + 8*ECX]
jle .LBB2_13
.LBB2_3: ; %bb.bb1_crit_edge
xor EBP, EBP
mov EBX, EDI
.align 16
.LBB2_4: ; %bb1
lea EAX, DWORD PTR [EBP + EBP]
cmp EAX, 3
setne AL
movzx EAX, AL
add EBP, EAX
imul EAX, EBP, 80
add EAX, DWORD PTR [ESP + 24]
movsd XMM0, QWORD PTR [EAX + 8*ECX]
cvtsi2sd XMM1, EDI
ucomisd XMM1, XMM0
jbe .LBB2_6
.LBB2_5: ; %bb2
cvttsd2si EDI, XMM0
.LBB2_6: ; %bb3
cvtsi2sd XMM1, EBX
ucomisd XMM0, XMM1
jbe .LBB2_8
.LBB2_7: ; %bb4
cvttsd2si EBX, XMM0
.LBB2_8: ; %bb5
mov EAX, EBP
mov EDX, 3435973837
mul EDX
shr EDX, 3
imul EAX, EDX, 10
mov EDX, EBP
sub EDX, EAX
cmp EBP, ESI
je .LBB2_10
.LBB2_9: ; %bb5
cmp EDX, 16
jb .LBB2_4
.LBB2_10: ; %bb7
sub EBX, EDI
cvtsi2sd XMM0, EBX
mov EAX, DWORD PTR [ESP + 28]
movsd QWORD PTR [EAX + 8*ECX], XMM0
mov EAX, ECX
neg EAX
mov EDX, ECX
and EDX, 1
xor EDX, 1
cmp EDX, EAX
setne AL
movzx EAX, AL
add EAX, ECX
mov ECX, EAX
xor ECX, 2
mov EDX, EAX
or EDX, 2
neg ECX
cmp EAX, DWORD PTR [ESP + 36]
jne .LBB2_2
.LBB2_11: ; %bb7
cmp EDX, ECX
je .LBB2_2
.LBB2_12: ; %return
add ESP, 4
pop ESI
pop EDI
pop EBX
pop EBP
ret
.LBB2_13: ; %bb.bb7_crit_edge
mov EBX, EDI
jmp .LBB2_10
_Process endp