NewsWhat's New

Perfomance evaluation of Morpher’s passes

Introduction The purpose of this article is theoretical and experimental evaluation of the impact of the given Morpher’s pass on ...

Articles, Aug. 15, 2013

Morpher 2.0 for Android is available!

Morpher 2.0 release includes not only improvements in all areas of the compiler, but also brings Morpher to one of ...

news, Oct. 16, 2012

Morpher 2.0 release

MTC Group, Ltd. is proud to announce the new major revision of its innovative product for secure code transformation and ...

news, Oct. 16, 2012

Add to Cart

Pseudo cycles insertion

pseudocycles

Description

This transformation turns straight pieces of code into cycles which has
only 1 trip count. This introduces some artificial paths into CFG as
well.

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, 12
mov EAX, DWORD PTR [ESP + 44]
mov DWORD PTR [ESP + 4], EAX
test EAX, EAX
jle .LBB2_13
.LBB2_1: ; %entry.cBB_crit_edge
mov EAX, DWORD PTR [ESP + 40]
mov ECX, 4294967295
.align 16
.LBB2_2: ; %cBB
inc ECX
je .LBB2_14
.LBB2_3: ; %bb.loopexit
mov EAX, DWORD PTR [ESP + 32]
lea EAX, DWORD PTR [EAX + 80]
mov DWORD PTR [ESP], EAX
xor EAX, EAX
.LBB2_4: ; %bb
mov ECX, DWORD PTR [ESP + 32]
cvttsd2si ECX, QWORD PTR [ECX + EAX]
mov ESI, DWORD PTR [ESP]
lea ESI, DWORD PTR [ESI + EAX]
test DL, 1
je .LBB2_15
.LBB2_5: ; %bb1.preheader
mov EBX, DWORD PTR [ESP + 8]
mov EDI, ECX
.LBB2_6: ; %bb1
movsd XMM0, QWORD PTR [ESI]
cvtsi2sd XMM1, ECX
ucomisd XMM1, XMM0
jbe .LBB2_8
.LBB2_7: ; %bb2
cvttsd2si ECX, XMM0
.LBB2_8: ; %bb3
cvtsi2sd XMM1, EDI
ucomisd XMM0, XMM1
jbe .LBB2_11
.LBB2_9: ; %bb3.cBB7_crit_edge
mov EBP, 4294967295
.align 16
.LBB2_10: ; %cBB7
inc EBP
je .LBB2_16
.LBB2_11: ; %bb5
add ESI, 80
dec EBX
jne .LBB2_6
.LBB2_12: ; %bb7
sub EDI, ECX
cvtsi2sd XMM0, EDI
mov ECX, DWORD PTR [ESP + 36]
movsd QWORD PTR [EAX + ECX], XMM0
add EAX, 8
dec DWORD PTR [ESP + 4]
jne .LBB2_4
.LBB2_13: ; %return
add ESP, 12
pop ESI
pop EDI
pop EBX
pop EBP
ret
.LBB2_14: ; %bb.nph16
lea EDX, DWORD PTR [EAX - 1]
mov DWORD PTR [ESP + 8], EDX
cmp EAX, 1
setg DL
jmp .LBB2_2
.LBB2_15: ; %bb.bb7_crit_edge
mov EDI, ECX
jmp .LBB2_12
.LBB2_16: ; %bb4
cvttsd2si EDI, XMM0
jmp .LBB2_10
_Process endp