Reverse Engineering for Beginners

(avery) #1

CHAPTER 39. LOOPS: SEVERAL ITERATORS CHAPTER 39. LOOPS: SEVERAL ITERATORS


inc r10 ;8.2
mov DWORD PTR [r9+rcx], r11d ;3.6
add r9, 12 ;8.2
add rax, 28 ;8.2
cmp r10, r8 ;8.2
jb .B1.11 ; Prob 82% ;8.2
; LOE rax rdx rcx rbx rbp rsi rdi r8 r9 r10 r12 r13 r14 r15 ⤦
Çxmm6 xmm7 xmm8 xmm9 xmm10 xmm11 xmm12 xmm13 xmm14 xmm15
exit:: ; Preds .B1.11 .B1.8 .B1.1
ret ;10.1


First, there are some decisions taken, then one of the routines is executed. Looks like it is a check if arrays intersect. This is
very well known way of optimizing memory block copy routines. But copy routines are the same! This is probably an error
of the Intel C++ optimizer, which still produces workable code, though.


We intentionally considering such example code in this book so the reader would understand that compiler output is weird
at times, but still correct, because when the compiler was tested, is passed the tests.

Free download pdf