23.03.2013 Views

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

Quick introduction to reverse engineering for beginners

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mov ecx, [esp+10h+var_10]<br />

mov edx, [esp+10h+sz]<br />

loc_D6: ; CODE XREF: f(int,int *,int *,int *)+B2<br />

mov esi, [esp+10h+ar2]<br />

lea esi, [esi+edi*4] ; is ar2+i*4 16-byte aligned?<br />

test esi, 0Fh<br />

jz short loc_109 ; yes!<br />

mov ebx, [esp+10h+ar1]<br />

mov esi, [esp+10h+ar2]<br />

loc_ED: ; CODE XREF: f(int,int *,int *,int *)+105<br />

movdqu xmm1, xmmword ptr [ebx+edi*4]<br />

movdqu xmm0, xmmword ptr [esi+edi*4] ; ar2+i*4 is not 16-byte aligned, so<br />

load it <strong>to</strong> xmm0<br />

paddd xmm1, xmm0<br />

movdqa xmmword ptr [eax+edi*4], xmm1<br />

add edi, 4<br />

cmp edi, ecx<br />

jb short loc_ED<br />

jmp short loc_127<br />

; ---------------------------------------------------------------------------<br />

loc_109: ; CODE XREF: f(int,int *,int *,int *)+E3<br />

mov ebx, [esp+10h+ar1]<br />

mov esi, [esp+10h+ar2]<br />

loc_111: ; CODE XREF: f(int,int *,int *,int *)+125<br />

movdqu xmm0, xmmword ptr [ebx+edi*4]<br />

paddd xmm0, xmmword ptr [esi+edi*4]<br />

movdqa xmmword ptr [eax+edi*4], xmm0<br />

add edi, 4<br />

cmp edi, ecx<br />

jb short loc_111<br />

loc_127: ; CODE XREF: f(int,int *,int *,int *)+107<br />

; f(int,int *,int *,int *)+164<br />

cmp ecx, edx<br />

jnb short loc_15B<br />

mov esi, [esp+10h+ar1]<br />

mov edi, [esp+10h+ar2]<br />

loc_133: ; CODE XREF: f(int,int *,int *,int *)+13F<br />

mov ebx, [esi+ecx*4]<br />

add ebx, [edi+ecx*4]<br />

mov [eax+ecx*4], ebx<br />

inc ecx<br />

cmp ecx, edx<br />

jb short loc_133<br />

jmp short loc_15B<br />

; ---------------------------------------------------------------------------<br />

loc_143: ; CODE XREF: f(int,int *,int *,int *)+17<br />

; f(int,int *,int *,int *)+3A ...<br />

95

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!