Function at 0x540f10
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x571e2d
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ebx
sub esp, 0x278
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x18], esi
cmp byte [esi + 0x38], 0
je 0x54136e
push 0x5b5fc0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp byte [0x5b3098], 0
jne 0x54105a
mov eax, dword [esi + 0x3c]
cmp eax, dword [0x5b309c]
jne 0x54105a
lea ecx, [esi + 0x40]
mov edx, 0x5b30a0
mov edi, 0xc
nop word [eax + eax]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x54105a
add ecx, 4
add edx, 4
sub edi, 4
jae 0x540f90
mov ecx, dword [esi + 0x54]
cmp ecx, dword [0x5b30b4]
jne 0x54105a
test ecx, ecx
je 0x541013
mov edx, dword [esi + 0x50]
mov edi, dword [0x5b30b0]
sub ecx, 4
jb 0x540fd7
mov eax, dword [edx]
cmp eax, dword [edi]
jne 0x540fdc
add edx, 4
add edi, 4
sub ecx, 4
jae 0x540fc6
cmp ecx, 0xfffffffc
je 0x54100d
mov al, byte [edx]
cmp al, byte [edi]
jne 0x541009
cmp ecx, 0xfffffffd
je 0x54100d
mov al, byte [edx + 1]
cmp al, byte [edi + 1]
jne 0x541009
cmp ecx, 0xfffffffe
je 0x54100d
mov al, byte [edx + 2]
cmp al, byte [edi + 2]
jne 0x541009
cmp ecx, 0xffffffff
je 0x54100d
mov al, byte [edx + 3]
cmp al, byte [edi + 3]
je 0x54100d
xor al, al
jmp 0x54100f
mov al, 1
test al, al
je 0x54105a
movups xmm0, xmmword [0x5b30b8]
movups xmmword [esi + 0x58], xmm0
movups xmm0, xmmword [0x5b30c8]
movups xmmword [esi + 0x68], xmm0
mov eax, dword [0x5b30d8]
mov ecx, dword [0x5b30dc]
mov dword [esi + 0x78], eax
mov dword [esi + 0x7c], ecx
movups xmm0, xmmword [0x5b30e0]
movups xmmword [esi + 0x80], xmm0
movups xmm0, xmmword [0x5b30f0]
movups xmmword [esi + 0x90], xmm0
mov byte [esi + 0x38], 0
push 0x5b5fc0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp byte [esi + 0x38], 0
je 0x54136e
push dword [esi + 0x54]
lea ecx, [ebp - 0x280]
push dword [esi + 0x50]
call fcn.00540170
mov ecx, 0x40
lea esi, [ebp - 0x280]
lea edi, [ebp - 0x180]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x18]
lea ecx, [ebp - 0x180]
push 0x10
lea edx, [esi + 0x40]
call fcn.00565d20
push 4
lea edx, [ebp - 0x60]
mov dword [ebp - 0x60], 0x1000000
lea ecx, [ebp - 0x180]
call fcn.00565d20
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp - 0x180]
call fcn.00540140
mov ecx, dword [esi + 0x3c]
mov edx, 1
movaps xmm0, xmmword [ebp - 0x60]
movaps xmm1, xmmword [ebp - 0x50]
shl edx, cl
dec edx
movaps xmmword [ebp - 0x80], xmm0
xor eax, eax
movaps xmmword [ebp - 0x70], xmm1
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x1c], eax
nop
mov ecx, eax
mov dword [ebp - 0x20], ecx
test edx, edx
je 0x541171
nop dword [eax]
mov ecx, 0x40
lea esi, [ebp - 0x280]
lea edi, [ebp - 0x180]
rep movsd dword es:[edi], dword [esi]
push 0x20
lea edx, [ebp - 0x60]
lea ecx, [ebp - 0x180]
call fcn.00565d20
lea eax, [ebp - 0x60]
push eax
lea ecx, [ebp - 0x180]
call fcn.00540140
xor eax, eax
nop dword [eax]
nop dword [eax + eax]
movups xmm0, xmmword [ebp + eax - 0x80]
movups xmm1, xmmword [ebp + eax - 0x60]
xorps xmm1, xmm0
movups xmmword [ebp + eax - 0x80], xmm1
add eax, 0x10
cmp eax, 0x20
jb 0x541140
sub dword [ebp - 0x14], 1
jne 0x541100
movaps xmm1, xmmword [ebp - 0x70]
movaps xmm0, xmmword [ebp - 0x80]
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x20]
test eax, eax
jne 0x541192
movups xmmword [esi + 0x58], xmm0
movups xmmword [esi + 0x68], xmm1
lea eax, [ecx + 1]
mov dword [ebp - 0x14], 0x10
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], eax
jmp 0x541100
cmp eax, 1
jne 0x5411a7
movups xmmword [esi + 0x80], xmm0
movups xmmword [esi + 0x90], xmm1
jmp 0x54117d
lea ecx, [ebp - 0x40]
inc eax
mov dword [ebp - 0x1c], eax
mov edx, 0x10
mov dword [ebp - 0x14], edx
movups xmmword [ecx], xmm0
movups xmmword [ecx + 0x10], xmm1
cmp eax, 3
jb 0x5410f0
movzx eax, byte [ebp - 0x40]
mov ecx, 8
mov byte [esi + 0x78], al
movzx eax, byte [ebp - 0x3f]
mov byte [esi + 0x79], al
movzx eax, byte [ebp - 0x3e]
lea edx, [ecx + 5]
mov byte [esi + 0x7a], al
lea edi, [ecx + 3]
movzx eax, byte [ebp - 0x3d]
mov byte [esi + 0x7b], al
movzx eax, byte [ebp - 0x3c]
mov byte [esi + 0x7c], al
movzx eax, byte [ebp - 0x3b]
mov byte [esi + 0x7d], al
movzx eax, byte [ebp - 0x3a]
mov byte [esi + 0x7e], al
movzx eax, byte [ebp - 0x39]
mov byte [esi + 0x7f], al
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 9
mov eax, dword [ebp - 0x14]
and ecx, 7
movzx eax, byte [ebp + eax - 0x41]
xor byte [ecx + esi + 0x78], al
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
and ecx, 7
movzx eax, byte [ebp + eax - 0x40]
xor byte [ecx + esi + 0x78], al
lea ecx, [edi - 1]
movzx eax, byte [ebp + edi - 0x41]
and ecx, 7
xor byte [ecx + esi + 0x78], al
mov ecx, edi
movzx eax, byte [ebp + edi - 0x40]
and ecx, 7
add edi, 6
xor byte [ecx + esi + 0x78], al
lea ecx, [edx - 1]
movzx eax, byte [ebp + edx - 0x41]
and ecx, 7
xor byte [ecx + esi + 0x78], al
mov ecx, edx
movzx eax, byte [ebp + edx - 0x40]
and ecx, 7
add edx, 6
xor byte [ecx + esi + 0x78], al
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
add eax, 6
add ecx, 6
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], ecx
cmp eax, 0x21
jb 0x541213
push 0x5b5fc0
mov byte [esi + 0x38], 0
mov dword [ebp - 0x18], 0x5b5fc0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov al, byte [esi + 0x38]
xor ecx, ecx
mov byte [0x5b3098], al
mov eax, dword [esi + 0x3c]
mov dword [ebp - 4], 0
mov dword [0x5b309c], eax
nop word [eax + eax]
mov al, byte [esi + ecx + 0x40]
mov byte [ecx + 0x5b30a0], al
inc ecx
cmp ecx, 0x10
jb 0x5412c0
lea eax, [esi + 0x50]
cmp eax, 0x5b30b0
je 0x5412e9
push dword [eax + 4]
mov ecx, 0x5b30b0
push dword [eax]
call fcn.0040c0e5
xor ecx, ecx
nop dword [eax + eax]
mov al, byte [esi + ecx + 0x58]
mov byte [ecx + 0x5b30b8], al
inc ecx
cmp ecx, 0x20
jb 0x5412f0
movzx eax, byte [esi + 0x78]
xor ecx, ecx
mov byte [0x5b30d8], al
movzx eax, byte [esi + 0x79]
mov byte [0x5b30d9], al
movzx eax, byte [esi + 0x7a]
mov byte [0x5b30da], al
movzx eax, byte [esi + 0x7b]
mov byte [0x5b30db], al
movzx eax, byte [esi + 0x7c]
mov byte [0x5b30dc], al
movzx eax, byte [esi + 0x7d]
mov byte [0x5b30dd], al
movzx eax, byte [esi + 0x7e]
mov byte [0x5b30de], al
movzx eax, byte [esi + 0x7f]
mov byte [0x5b30df], al
nop word [eax + eax]
mov al, byte [esi + ecx + 0x80]
mov byte [ecx + 0x5b30e0], al
inc ecx
cmp ecx, 0x20
jb 0x541350
push 0x5b5fc0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0xb0]
and eax, 1
or eax, 0
je 0x5413b0
cmp byte [esi + 0xa8], 0
je 0x5413b0
mov eax, dword [esi + 0x78]
cmp eax, dword [esi + 0xa0]
jne 0x54139b
mov eax, dword [esi + 0x7c]
cmp eax, dword [esi + 0xa4]
je 0x5413b0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
mov ecx, dword [ebp - 0xc]
mov al, 1
pop edi
mov dword fs:[0], ecx
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret