Function at 0x540130
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x3c
call fcn.00554d90
push esi
mov esi, dword [esp + 0x50]
push esi
mov dword [esp + 0x3c], 0
call fcn.004e0790
push esi
call fcn.004e06b0
mov esi, eax
add esp, 8
mov dword [esp + 0x28], esi
test esi, esi
je 0x540619
push edi
mov edi, dword [esp + 0x54]
push edi
call fcn.004e06b0
mov edx, eax
add esp, 4
mov dword [esp + 0x18], edx
test edx, edx
je 0x540618
push edi
call fcn.004e06b0
mov esi, eax
add esp, 4
mov dword [esp + 0x38], esi
test esi, esi
je 0x540618
push edi
call fcn.004e06b0
mov edi, eax
add esp, 4
mov dword [esp + 0x1c], edi
test edi, edi
je 0x540618
push ebx
mov ebx, dword [esp + 0x54]
push ebx
push dword [esp + 0x54]
push esi
call fcn.0053fcd0
add esp, 0xc
test eax, eax
je 0x540617
cmp dword [esi + 4], 0
je 0x540617
push ebx
push edi
call fcn.004a2490
add esp, 8
test eax, eax
je 0x540617
push ebp
push esi
call fcn.004a2720
mov ebp, eax
push edi
mov dword [esp + 0x38], ebp
call fcn.004a2720
mov edi, dword [ebx + 4]
add esp, 8
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], edi
cmp edi, dword [esi + 8]
jg 0x54020f
mov eax, esi
jmp 0x540219
push edi
push esi
call fcn.004a2a50
add esp, 8
test eax, eax
je 0x540616
mov edx, dword [esp + 0x40]
mov esi, dword [esi]
mov dword [esp + 0x28], esi
mov eax, dword [edx + 4]
cmp eax, edi
jge 0x540243
mov ecx, dword [esp + 0x18]
lea edi, [esi + eax*4]
sub ecx, eax
xor eax, eax
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x18]
mov ebx, dword [esp + 0x34]
mov dword [edx + 4], edi
cmp edi, dword [ebx + 8]
jg 0x540253
mov eax, ebx
jmp 0x54025d
push edi
push ebx
call fcn.004a2a50
add esp, 8
test eax, eax
je 0x540616
mov edx, dword [ebx]
mov dword [esp + 0x1c], edx
mov dword [edx], 1
cmp edi, 1
jle 0x540284
lea ecx, [edi - 1]
xor eax, eax
lea edi, [edx + 4]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov dword [ebx + 4], edi
cmp edi, dword [ecx + 8]
jg 0x540294
mov eax, ecx
jmp 0x5402a6
push edi
push ecx
call fcn.004a2a50
mov edx, dword [esp + 0x24]
add esp, 8
mov ecx, dword [esp + 0x20]
test eax, eax
je 0x540616
mov ebx, dword [ecx]
mov dword [esp + 0x14], ebx
test edi, edi
jle 0x5402c8
mov ecx, edi
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
mov dword [ecx + 4], edi
mov ecx, dword [eax]
mov dword [esp + 0x10], ecx
test ebp, ebp
je 0x5403a3
nop dword [eax]
mov ebx, dword [esi]
test bl, 1
jne 0x54039b
mov ecx, dword [esp + 0x58]
dec edi
mov eax, dword [edx]
mov ebp, eax
and ebp, 1
neg ebp
mov ecx, dword [ecx]
mov ecx, dword [ecx]
and ecx, ebp
xor eax, ecx
xor ecx, ecx
mov dword [esp + 0x3c], ecx
test edi, edi
jle 0x54037c
mov ecx, esi
mov dword [esp + 0x38], 0xfffffffc
sub ecx, edx
lea edi, [edx + 4]
sub dword [esp + 0x38], edx
mov dword [esp + 0x48], ecx
jmp 0x540328
mov ecx, dword [esp + 0x48]
mov edx, dword [edi + ecx]
mov ecx, edx
shl ecx, 0x1f
shr ebx, 1
or ecx, ebx
shr eax, 1
mov ebx, dword [esp + 0x3c]
mov dword [esi + ebx*4], ecx
mov ebx, edx
mov ecx, dword [esp + 0x58]
mov edx, dword [esp + 0x38]
mov esi, dword [esp + 0x28]
add edx, edi
mov ecx, dword [ecx]
mov edx, dword [edx + ecx + 4]
and edx, ebp
xor edx, dword [edi]
mov ecx, edx
shl ecx, 0x1f
or ecx, eax
mov eax, edx
mov edx, dword [esp + 0x18]
mov dword [edi - 4], ecx
dec edx
mov ecx, dword [esp + 0x3c]
add edi, 4
inc ecx
mov dword [esp + 0x3c], ecx
cmp ecx, edx
jl 0x540324
mov edx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x30]
mov edi, dword [esp + 0x18]
shr ebx, 1
shr eax, 1
sub ebp, 1
mov dword [esi + ecx*4], ebx
mov dword [edx + ecx*4], eax
mov dword [esp + 0x30], ebp
jne 0x5402e0
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp ebp, 0x20
jg 0x5403bb
mov eax, dword [esi]
test eax, eax
je 0x540616
cmp eax, 1
je 0x5405d5
cmp ebp, dword [esp + 0x2c]
jge 0x54040d
mov edx, dword [esp + 0x24]
mov eax, ebp
mov ebp, dword [esp + 0x2c]
mov esi, ecx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x20]
mov dword [esp + 0x34], edx
mov edx, ebx
mov ecx, dword [ecx]
mov dword [esp + 0x20], eax
mov eax, dword [eax]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x28], esi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], eax
jmp 0x540411
mov eax, dword [esp + 0x14]
xor ebx, ebx
test edi, edi
jle 0x540576
cmp edi, 4
jb 0x54052b
lea eax, [eax + edi*4]
add eax, 0xfffffffc
lea ecx, [edi - 1]
lea ecx, [edx + ecx*4]
cmp edx, eax
ja 0x54043e
cmp ecx, dword [esp + 0x14]
jae 0x54052b
lea eax, [edi - 1]
lea eax, [esi + eax*4]
lea ecx, [edi - 1]
lea ecx, [edx + ecx*4]
cmp edx, eax
ja 0x540456
cmp ecx, esi
jae 0x54052b
mov eax, dword [esp + 0x10]
lea ecx, [edi - 1]
lea ecx, [edx + ecx*4]
lea eax, [eax + edi*4]
add eax, 0xfffffffc
cmp edx, eax
ja 0x540476
mov eax, dword [esp + 0x10]
cmp ecx, eax
jae 0x54052f
mov eax, dword [esp + 0x14]
lea ecx, [edi - 1]
lea ecx, [esi + ecx*4]
lea eax, [eax + edi*4]
add eax, 0xfffffffc
cmp esi, eax
ja 0x540494
cmp ecx, dword [esp + 0x14]
jae 0x54052b
mov eax, dword [esp + 0x10]
lea ecx, [edi - 1]
lea ecx, [esi + ecx*4]
lea eax, [eax + edi*4]
add eax, 0xfffffffc
cmp esi, eax
ja 0x5404b4
mov eax, dword [esp + 0x10]
cmp ecx, eax
jae 0x54052f
mov eax, edi
and eax, reloc.WS2_32.dll_closesocket
jns 0x5404c2
dec eax
or eax, 0xfffffffc
inc eax
mov edx, dword [esp + 0x10]
mov ecx, edi
mov edi, dword [esp + 0x1c]
sub edx, esi
mov dword [esp + 0x48], edx
sub ecx, eax
mov edx, dword [esp + 0x14]
mov eax, esi
sub edx, esi
sub edi, esi
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0x48]
mov dword [esp + 0x38], edi
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
movups xmm0, xmmword [eax]
add ebx, 4
lea eax, [eax + 0x10]
movups xmm1, xmmword [edx + eax - 0x10]
pxor xmm1, xmm0
movups xmmword [eax - 0x10], xmm1
movups xmm1, xmmword [edi + eax - 0x10]
movups xmm0, xmmword [esi + eax - 0x10]
pxor xmm1, xmm0
movups xmmword [esi + eax - 0x10], xmm1
cmp ebx, ecx
jl 0x5404f2
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
cmp ebx, edi
jge 0x540576
sub eax, esi
lea ecx, [esi + ebx*4]
mov dword [esp + 0x48], eax
sub edx, esi
mov eax, dword [esp + 0x14]
sub eax, esi
mov dword [esp + 0x38], edx
mov esi, dword [esp + 0x48]
sub edi, ebx
mov dword [esp + 0x3c], eax
mov ebx, eax
mov eax, dword [ecx + esi]
lea ecx, [ecx + 4]
xor dword [ecx - 4], eax
mov eax, dword [ecx + ebx - 4]
xor dword [ecx + edx - 4], eax
sub edi, 1
jne 0x540554
mov esi, dword [esp + 0x28]
mov edx, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
cmp ebp, dword [esp + 0x2c]
jne 0x5402d5
lea eax, [ebp - 1]
cdq
and edx, 0x1f
lea edi, [edx + eax]
sar edi, 5
mov eax, dword [esi + edi*4]
test eax, eax
jne 0x5405ad
nop dword [eax]
test edi, edi
je 0x5405ad
mov eax, dword [esi + edi*4 - 4]
dec edi
test eax, eax
je 0x5405a0
push eax
call fcn.004a2790
mov edx, dword [esp + 0x20]
add esp, 4
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
shl edi, 5
lea ebp, [edi + eax]
mov edi, dword [esp + 0x18]
mov dword [esp + 0x30], ebp
jmp 0x5402d5
mov esi, dword [esp + 0x34]
mov ecx, dword [esi + 4]
test ecx, ecx
jle 0x5405f9
mov eax, dword [esi]
lea edx, [ecx - 1]
lea edx, [eax + edx*4]
mov eax, dword [edx]
lea edx, [edx - 4]
test eax, eax
jne 0x5405f6
dec ecx
test ecx, ecx
jg 0x5405e8
mov dword [esi + 4], ecx
push esi
push dword [esp + 0x54]
call fcn.004a2490
xor ecx, ecx
add esp, 8
test eax, eax
mov edx, 1
cmovne ecx, edx
mov dword [esp + 0x44], ecx
pop ebp
pop ebx
pop edi
push dword [esp + 0x50]
call fcn.004e0640
mov eax, dword [esp + 0x3c]
add esp, 4
pop esi
add esp, 0x3c
ret