Function at 0x518260
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x2c
mov esi, ecx
mov ecx, dword [ecx + 0x7c]
mov eax, dword [esi + 0xc4]
lea edx, [ecx - 0x106]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x28], edx
mov ebx, dword [esi + 0x8c]
add ecx, dword [esp + 0x28]
mov edx, dword [esi + 0xbc]
sub ebx, eax
sub ebx, edx
cmp edx, ecx
jb 0x5184c5
mov edi, dword [esp + 0xc]
mov eax, dword [esi + 0x88]
mov edx, edi
lea ecx, [eax + edi]
sub edx, ebx
push edx
push ecx
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
sub dword [esi + 0xc0], edi
sub dword [esi + 0xbc], edi
sub dword [esi + 0xac], edi
mov ecx, dword [esi + 0x9c]
mov eax, dword [esi + 0x7c]
lea ebp, [ecx + ecx]
movd xmm0, eax
add ebp, dword [esi + 0x94]
cmp ecx, 8
jae 0x518300
movdqa xmm5, xmmword [0x53bf00]
mov edx, ebp
xor ebp, ebp
pxor xmm7, xmm7
jmp 0x5183be
mov edi, ecx
pshufd xmm1, xmm0, 0
movdqa xmm6, xmmword [0x53bf10]
mov dword [esp + 8], ecx
and ecx, 7
pxor xmm7, xmm7
and edi, 0xfffffff8
lea edx, [edi + edi]
mov dword [esp + 0x24], edi
mov dword [esp + 0x10], edx
mov edx, ebp
add ebp, 0xfffffff0
sub edx, dword [esp + 0x10]
movdqu xmmword [esp + 0x10], xmm0
movdqa xmm0, xmmword [0x53bf00]
nop
movdqu xmm2, xmmword [ebp]
movdqa xmm4, xmm1
pxor xmm4, xmm0
pshufb xmm2, xmmword [0x53bef0]
movdqa xmm3, xmm2
punpckhwd xmm2, xmm7
movdqa xmm5, xmm2
punpcklwd xmm3, xmm7
psubd xmm2, xmm1
por xmm5, xmm0
pcmpgtd xmm5, xmm4
pand xmm2, xmm5
movdqa xmm5, xmm3
psubd xmm3, xmm1
por xmm5, xmm0
pshufb xmm2, xmm6
pcmpgtd xmm5, xmm4
pand xmm3, xmm5
pshufb xmm3, xmm6
punpcklqdq xmm2, xmm3
movdqu xmmword [ebp], xmm2
add ebp, 0xfffffff0
add edi, 0xfffffff8
jne 0x518340
mov edi, dword [esp + 0x24]
movdqa xmm5, xmm0
movdqu xmm0, xmmword [esp + 0x10]
mov ebp, 0
cmp dword [esp + 8], edi
je 0x5183e1
add edx, 0xfffffffe
nop word cs:[eax + eax]
nop dword [eax + eax]
movzx edi, word [edx]
sub edi, eax
cmovb edi, ebp
mov word [edx], di
add edx, 0xfffffffe
dec ecx
jne 0x5183d0
lea edi, [eax + eax]
add edi, dword [esi + 0x90]
cmp eax, 8
jae 0x518400
mov ecx, eax
mov edx, edi
jmp 0x51849e
mov ebp, eax
movdqa xmm6, xmmword [0x53bf10]
mov ecx, eax
pshufd xmm0, xmm0, 0
and ebp, 0xfffffff8
and ecx, 7
lea edx, [ebp + ebp]
mov dword [esp + 0x10], edx
mov edx, edi
add edi, 0xfffffff0
sub edx, dword [esp + 0x10]
mov dword [esp + 0x10], ebp
nop dword [eax]
movdqu xmm1, xmmword [edi]
movdqa xmm3, xmm0
pxor xmm3, xmm5
pshufb xmm1, xmmword [0x53bef0]
movdqa xmm2, xmm1
punpckhwd xmm1, xmm7
movdqa xmm4, xmm1
punpcklwd xmm2, xmm7
psubd xmm1, xmm0
por xmm4, xmm5
pcmpgtd xmm4, xmm3
pand xmm1, xmm4
movdqa xmm4, xmm2
psubd xmm2, xmm0
por xmm4, xmm5
pshufb xmm1, xmm6
pcmpgtd xmm4, xmm3
pand xmm2, xmm4
pshufb xmm2, xmm6
punpcklqdq xmm1, xmm2
movdqu xmmword [edi], xmm1
add edi, 0xfffffff0
add ebp, 0xfffffff8
jne 0x518430
cmp eax, dword [esp + 0x10]
mov ebp, 0
je 0x5184c1
add edx, 0xfffffffe
nop word cs:[eax + eax]
nop dword [eax + eax]
movzx edi, word [edx]
sub edi, eax
cmovb edi, ebp
mov word [edx], di
add edx, 0xfffffffe
dec ecx
jne 0x5184b0
add ebx, dword [esp + 0xc]
mov edi, dword [esi]
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x518647
mov eax, dword [esi + 0xc4]
cmp ecx, ebx
cmovbe ebx, ecx
test ebx, ebx
je 0x518540
mov ebp, dword [esi + 0x88]
sub ecx, ebx
add ebp, dword [esi + 0xbc]
mov dword [edi + 4], ecx
mov ecx, dword [edi + 0x1c]
add ebp, eax
cmp dword [ecx + 0x18], 2
jne 0x518510
push ebx
push ebp
push edi
call fcn.0049ff00
add esp, 0xc
jmp 0x518535
push ebx
push dword [edi]
push ebp
call sub.api_ms_win_crt_private_l1_1_0.dll_memcpy
add esp, 0xc
mov eax, dword [edi + 0x1c]
cmp dword [eax + 0x18], 1
jne 0x518535
push ebx
push ebp
push dword [edi + 0x30]
call fcn.004fa900
add esp, 0xc
mov dword [edi + 0x30], eax
add dword [edi], ebx
add dword [edi + 8], ebx
mov eax, dword [esi + 0xc4]
add eax, ebx
mov dword [esi + 0xc4], eax
mov edi, dword [esi + 0x1704]
lea ecx, [edi + eax]
cmp ecx, 3
jb 0x518630
mov edx, dword [esi + 0xbc]
mov ebx, dword [esi + 0x88]
mov dword [esp + 0x10], edi
sub edx, edi
mov edi, dword [esi + 0xa4]
movzx ebp, byte [ebx + edx]
mov dword [esi + 0x98], ebp
mov ecx, dword [esi + 0xa8]
shl ebp, cl
mov dword [esp + 8], ebp
movzx ebp, byte [ebx + edx + 1]
xor ebp, dword [esp + 8]
and ebp, edi
cmp dword [esp + 0x10], 0
mov dword [esi + 0x98], ebp
je 0x518630
nop word cs:[eax + eax]
nop
movzx eax, byte [ebx + edx + 2]
shl ebp, cl
xor eax, ebp
and eax, edi
mov dword [esi + 0x98], eax
mov edi, dword [esi + 0x94]
mov ecx, dword [esi + 0x90]
movzx eax, word [edi + eax*2]
mov edi, dword [esi + 0x84]
and edi, edx
mov word [ecx + edi*2], ax
mov eax, dword [esi + 0x94]
mov ecx, dword [esi + 0x98]
mov word [eax + ecx*2], dx
mov edi, dword [esi + 0x1704]
lea ecx, [edi - 1]
mov dword [esi + 0x1704], ecx
mov eax, dword [esi + 0xc4]
lea edi, [eax + edi - 1]
cmp edi, 3
jb 0x518630
test ecx, ecx
je 0x518630
mov ebx, dword [esi + 0x88]
mov ebp, dword [esi + 0x98]
mov ecx, dword [esi + 0xa8]
mov edi, dword [esi + 0xa4]
inc edx
jmp 0x5185b0
cmp eax, 0x105
ja 0x518647
mov ecx, dword [esi]
cmp dword [ecx + 4], 0
je 0x518647
mov ecx, dword [esi + 0x7c]
jmp 0x518280
mov edx, dword [esi + 0x8c]
mov eax, dword [esi + 0x1710]
mov ecx, edx
sub ecx, eax
jbe 0x5186be
mov edi, dword [esi + 0xc4]
add edi, dword [esi + 0xbc]
cmp eax, edi
jae 0x518697
mov eax, dword [esi + 0x88]
sub edx, edi
mov ebx, 0x102
cmp edx, 0x102
cmovb ebx, edx
add eax, edi
push ebx
push 0
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
add esp, 0xc
add ebx, edi
mov dword [esi + 0x1710], ebx
jmp 0x5186be
add edi, 0x102
sub edi, eax
jbe 0x5186be
cmp edi, ecx
cmova edi, ecx
add eax, dword [esi + 0x88]
push edi
push 0
push eax
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
add esp, 0xc
add dword [esi + 0x1710], edi
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret