Reverse Engineering for Beginners

(avery) #1

CHAPTER 25. SIMD CHAPTER 25. SIMD


mov esi, [esp+10h+ar2]
sub esi, eax
lea ecx, ds:0[edx*4]
cmp esi, ecx
jb loc_143

loc_55: ; CODE XREF: f(int,int ,int ,int *)+34
cmp eax, [esp+10h+ar1]
jbe short loc_67
mov esi, [esp+10h+ar1]
sub esi, eax
neg esi
cmp ecx, esi
jbe short loc_7F


loc_67: ; CODE XREF: f(int,int ,int ,int *)+59
cmp eax, [esp+10h+ar1]
jnb loc_143
mov esi, [esp+10h+ar1]
sub esi, eax
cmp esi, ecx
jb loc_143


loc_7F: ; CODE XREF: f(int,int ,int ,int *)+65
mov edi, eax ; edi = ar1
and edi, 0Fh ; is ar1 16-byte aligned?
jz short loc_9A ; yes
test edi, 3
jnz loc_162
neg edi
add edi, 10h
shr edi, 2


loc_9A: ; CODE XREF: f(int,int ,int ,int *)+84
lea ecx, [edi+4]
cmp edx, ecx
jl loc_162
mov ecx, edx
sub ecx, edi
and ecx, 3
neg ecx
add ecx, edx
test edi, edi
jbe short loc_D6
mov ebx, [esp+10h+ar2]
mov [esp+10h+var_10], ecx
mov ecx, [esp+10h+ar1]
xor esi, esi


loc_C1: ; CODE XREF: f(int,int ,int ,int )+CD
mov edx, [ecx+esi
4]
add edx, [ebx+esi4]
mov [eax+esi
4], edx
inc esi
cmp esi, edi
jb short loc_C1
mov ecx, [esp+10h+var_10]
mov edx, [esp+10h+sz]


loc_D6: ; CODE XREF: f(int,int ,int ,int )+B2
mov esi, [esp+10h+ar2]
lea esi, [esi+edi
4] ; is ar2+i*4 16-byte aligned?
test esi, 0Fh
jz short loc_109 ; yes!
mov ebx, [esp+10h+ar1]
mov esi, [esp+10h+ar2]


loc_ED: ; CODE XREF: f(int,int ,int ,int )+105
movdqu xmm1, xmmword ptr [ebx+edi
4] ; ar1+i*4

Free download pdf