Function at 0x540190
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x48
call fcn.004273e0
push edi
mov edi, dword [esp + 0x5c]
push edi
mov dword [esp + 0x38], 0
call fcn.004c9370
push edi
call fcn.004c9290
mov edi, eax
add esp, 8
mov dword [esp + 0x1c], edi
test edi, edi
je 0x5406de
push ebp
push esi
mov esi, dword [esp + 0x64]
push esi
call fcn.004c9290
mov ebp, eax
add esp, 4
mov dword [esp + 0x20], ebp
test ebp, ebp
je 0x5406dc
push esi
call fcn.004c9290
mov ebp, eax
add esp, 4
mov dword [esp + 0x30], ebp
test ebp, ebp
je 0x5406dc
push ebx
push esi
call fcn.004c9290
mov ebx, eax
add esp, 4
mov dword [esp + 0x2c], ebx
test ebx, ebx
je 0x5406db
mov esi, dword [esp + 0x64]
push esi
push dword [esp + 0x64]
push ebp
call fcn.0053fd30
add esp, 0xc
test eax, eax
je 0x5406db
cmp dword [ebp + 4], 0
je 0x5406db
push esi
push ebx
call fcn.004aa8a0
add esp, 8
test eax, eax
je 0x5406db
push ebp
call fcn.004aab40
push dword [esp + 0x30]
mov ebx, eax
mov dword [esp + 0x24], ebx
call fcn.004aab40
mov edx, dword [esi + 4]
add esp, 8
mov dword [esp + 0x38], eax
mov dword [esp + 0x14], edx
cmp edx, dword [ebp + 8]
jg 0x540272
mov eax, ebp
jmp 0x540280
push edx
push ebp
call fcn.004aae70
mov edx, dword [esp + 0x1c]
add esp, 8
test eax, eax
je 0x5406db
mov esi, dword [esp + 0x34]
mov ebp, dword [ebp]
mov dword [esp + 0x3c], ebp
mov eax, dword [esi + 4]
cmp eax, edx
jge 0x5402af
lea edi, [eax*4]
mov ecx, edx
add edi, ebp
sub ecx, eax
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x28]
mov dword [esi + 4], edx
cmp edx, dword [edi + 8]
jg 0x5402bb
mov eax, edi
jmp 0x5402c9
push edx
push edi
call fcn.004aae70
mov edx, dword [esp + 0x1c]
add esp, 8
test eax, eax
je 0x5406db
mov esi, dword [edi]
mov dword [esp + 0x20], esi
mov dword [esi], 1
cmp edx, 1
jle 0x5402f0
lea ecx, [edx - 1]
xor eax, eax
lea edi, [esi + 4]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov dword [edi + 4], edx
cmp edx, dword [ecx + 8]
jg 0x540300
mov eax, ecx
jmp 0x540312
push edx
push ecx
call fcn.004aae70
mov edx, dword [esp + 0x1c]
add esp, 8
mov ecx, dword [esp + 0x24]
test eax, eax
je 0x5406db
mov edi, dword [ecx]
mov dword [esp + 0x18], edi
test edx, edx
jle 0x54032e
mov ecx, edx
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
mov dword [ecx + 4], edx
mov ecx, dword [eax]
mov dword [esp + 0x10], ecx
nop dword [eax + eax]
test ebx, ebx
je 0x540417
nop dword [eax + eax]
mov ebx, dword [ebp]
test bl, 1
jne 0x54040b
mov ecx, dword [esp + 0x64]
xor edi, edi
mov eax, dword [esi]
mov edx, eax
and edx, 1
neg edx
mov ecx, dword [ecx]
mov dword [esp + 0x44], edx
mov ecx, dword [ecx]
and ecx, edx
mov edx, dword [esp + 0x14]
xor eax, ecx
lea ecx, [edx - 1]
test ecx, ecx
jle 0x5403ed
mov ecx, dword [esp + 0x20]
mov edx, ebp
sub edx, ecx
mov dword [esp + 0x30], 0xfffffffc
add esi, 4
mov dword [esp + 0x48], edx
sub dword [esp + 0x30], ecx
nop dword [eax]
mov edx, dword [edx + esi]
lea esi, [esi + 4]
mov ecx, edx
shr ebx, 1
shl ecx, 0x1f
or ecx, ebx
shr eax, 1
mov dword [ebp + edi*4], ecx
mov ebx, edx
mov ecx, dword [esp + 0x64]
inc edi
mov ecx, dword [ecx]
add ecx, dword [esp + 0x30]
mov edx, dword [ecx + esi]
and edx, dword [esp + 0x44]
xor edx, dword [esi - 4]
mov ecx, edx
shl ecx, 0x1f
or ecx, eax
mov eax, edx
mov edx, dword [esp + 0x48]
mov dword [esi - 8], ecx
mov ecx, dword [esp + 0x14]
dec ecx
cmp edi, ecx
jl 0x5403a0
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x14]
shr ebx, 1
mov dword [ebp + edi*4], ebx
mov ebx, dword [esp + 0x1c]
shr eax, 1
sub ebx, 1
mov dword [esi + edi*4], eax
mov dword [esp + 0x1c], ebx
jne 0x540350
jmp 0x540413
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp ebx, 0x20
jg 0x540430
mov eax, dword [ebp]
test eax, eax
je 0x5406db
cmp eax, 1
je 0x540687
mov edi, dword [esp + 0x38]
cmp ebx, edi
jge 0x540480
mov eax, dword [esp + 0x34]
mov esi, dword [esp + 0x2c]
mov ebp, dword [esp + 0x24]
mov dword [esp + 0x34], esi
mov esi, eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x28], ebp
mov ebp, ecx
mov dword [esp + 0x38], ebx
mov ebx, edi
mov ecx, dword [esi]
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x18]
mov dword [esp + 0x24], eax
mov eax, dword [eax]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x10], ecx
mov dword [esp + 0x20], esi
mov dword [esp + 0x18], eax
jmp 0x540484
mov eax, dword [esp + 0x18]
xor edi, edi
test edx, edx
jle 0x540633
cmp edx, 8
jb 0x5405de
lea eax, [eax + edx*4]
add eax, 0xfffffffc
lea ecx, [edx - 1]
lea ecx, [esi + ecx*4]
cmp esi, eax
ja 0x5404b1
cmp ecx, dword [esp + 0x18]
jae 0x5405de
lea eax, [edx*4 - 4]
add eax, ebp
cmp esi, eax
ja 0x5404c6
cmp ecx, ebp
jae 0x5405de
mov eax, dword [esp + 0x10]
lea eax, [eax + edx*4]
add eax, 0xfffffffc
cmp esi, eax
ja 0x5404e0
mov eax, dword [esp + 0x10]
cmp ecx, eax
jae 0x5405e2
mov eax, dword [esp + 0x18]
lea ecx, [edx*4 - 4]
add ecx, ebp
lea eax, [eax + edx*4]
add eax, 0xfffffffc
cmp ebp, eax
ja 0x540501
cmp ecx, dword [esp + 0x18]
jae 0x5405de
mov eax, dword [esp + 0x10]
lea eax, [eax + edx*4]
add eax, 0xfffffffc
cmp ebp, eax
ja 0x54051b
mov eax, dword [esp + 0x10]
cmp ecx, eax
jae 0x5405e2
mov eax, edx
and eax, reloc.WS2_32.dll_getsockopt
jns 0x540529
dec eax
or eax, 0xfffffff8
inc eax
mov ebx, dword [esp + 0x18]
mov ecx, edx
sub ecx, eax
mov edx, esi
mov eax, dword [esp + 0x10]
sub eax, ebp
mov dword [esp + 0x50], ecx
mov dword [esp + 0x48], eax
lea ecx, [ebp + 0x10]
mov eax, ebx
sub eax, ebp
mov dword [esp + 0x44], eax
mov eax, esi
sub eax, ebp
mov ebp, dword [esp + 0x44]
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x10]
sub eax, ebx
mov dword [esp + 0x30], eax
mov eax, ebx
mov ebx, dword [esp + 0x48]
sub eax, esi
mov dword [esp + 0x54], eax
nop
movups xmm0, xmmword [ecx - 0x10]
mov esi, dword [esp + 0x30]
lea ecx, [ecx + 0x20]
add eax, edx
add edi, 8
movups xmm1, xmmword [eax + esi]
pxor xmm1, xmm0
movups xmmword [ecx - 0x30], xmm1
movups xmm0, xmmword [eax]
mov eax, dword [esp + 0x4c]
movups xmm1, xmmword [edx]
pxor xmm1, xmm0
movups xmmword [edx], xmm1
add edx, 0x20
movups xmm0, xmmword [ecx - 0x20]
movups xmm1, xmmword [ebx + ecx - 0x20]
pxor xmm1, xmm0
movups xmmword [ecx - 0x20], xmm1
movups xmm0, xmmword [eax + ecx - 0x20]
movups xmm1, xmmword [ecx + ebp - 0x20]
pxor xmm1, xmm0
movups xmmword [eax + ecx - 0x20], xmm1
mov eax, dword [esp + 0x54]
cmp edi, dword [esp + 0x50]
jl 0x540570
mov ebp, dword [esp + 0x3c]
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
cmp edi, edx
jge 0x540633
sub eax, ebp
lea ecx, [edi*4]
mov dword [esp + 0x54], eax
sub esi, ebp
mov eax, dword [esp + 0x18]
add ecx, ebp
sub eax, ebp
mov dword [esp + 0x4c], esi
mov esi, dword [esp + 0x54]
sub edx, edi
mov ebx, dword [esp + 0x4c]
mov edi, eax
mov dword [esp + 0x50], eax
mov eax, dword [ecx + esi]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
mov eax, dword [ecx + edi - 4]
xor dword [ecx + ebx - 4], eax
sub edx, 1
jne 0x540611
mov esi, dword [esp + 0x20]
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp ebx, dword [esp + 0x38]
jne 0x540340
lea eax, [ebx - 1]
cdq
and edx, 0x1f
lea esi, [edx + eax]
sar esi, 5
mov eax, dword [ebp + esi*4]
test eax, eax
jne 0x540663
test esi, esi
je 0x540663
mov eax, dword [ebp + esi*4 - 4]
dec esi
test eax, eax
je 0x540656
push eax
call fcn.004aabb0
mov edx, dword [esp + 0x18]
add esp, 4
mov ecx, dword [esp + 0x10]
shl esi, 5
lea ebx, [esi + eax]
mov esi, dword [esp + 0x20]
mov dword [esp + 0x1c], ebx
jmp 0x540340
mov ebx, dword [esp + 0x28]
mov ecx, dword [ebx + 4]
test ecx, ecx
jle 0x5406b1
mov eax, dword [ebx]
lea edx, [ecx - 1]
lea edx, [eax + edx*4]
nop word [eax + eax]
mov eax, dword [edx]
lea edx, [edx - 4]
test eax, eax
jne 0x5406ae
dec ecx
test ecx, ecx
jg 0x5406a0
mov dword [ebx + 4], ecx
cmp dword [ebx + 4], 0
jne 0x5406be
mov dword [ebx + 0xc], 0
push ebx
push dword [esp + 0x60]
call fcn.004aa8a0
xor ecx, ecx
add esp, 8
test eax, eax
mov edx, 1
cmovne ecx, edx
mov dword [esp + 0x40], ecx
pop ebx
pop esi
pop ebp
push dword [esp + 0x5c]
call fcn.004c9220
mov eax, dword [esp + 0x38]
add esp, 4
pop edi
add esp, 0x48
ret