Function at 0x519c08
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, ecx
movzx eax, word [ebx]
push eax
call fcn.006af996
pop ecx
test eax, eax
je 0x519c38
add ebx, 2
movzx eax, word [ebx]
push eax
call fcn.006af996
pop ecx
test eax, eax
jne 0x519c24
mov dword [ebp + 0x10], ebx
mov esi, dword [ebp + 0xc]
movzx eax, word [esi]
push eax
call fcn.006af996
pop ecx
test eax, eax
je 0x519c5d
add esi, 2
movzx eax, word [esi]
push eax
call fcn.006af996
pop ecx
test eax, eax
jne 0x519c49
mov dword [ebp + 0xc], esi
push esi
call fcn.006a37ec
mov esi, eax
push ebx
mov dword [ebp - 8], esi
call fcn.006a37ec
mov ebx, eax
mov dword [ebp - 0xc], ebx
pop ecx
pop ecx
test esi, esi
je 0x519c9e
mov ebx, dword [ebp + 0xc]
add ebx, 0xfffffffe
lea ebx, [ebx + esi*2]
movzx ecx, word [ebx]
push ecx
call fcn.006af996
pop ecx
test eax, eax
je 0x519c98
sub ebx, 2
sub esi, 1
jne 0x519c82
mov ebx, dword [ebp - 0xc]
mov dword [ebp - 8], esi
test ebx, ebx
je 0x519cc7
mov esi, dword [ebp + 0x10]
add esi, 0xfffffffe
lea esi, [esi + ebx*2]
movzx eax, word [esi]
push eax
call fcn.006af996
pop ecx
test eax, eax
je 0x519cc1
sub esi, 2
sub ebx, 1
jne 0x519cab
mov esi, dword [ebp - 8]
mov dword [ebp - 0xc], ebx
mov eax, dword [ebp + 8]
push dword [eax + 0x38]
call fcn.006a37ec
mov dword [ebp - 0x14], eax
pop ecx
push edi
lea edx, [eax + ebx]
mov eax, dword [ebp + 8]
add edx, esi
xor ebx, ebx
and dword [ebp - 0x18], ebx
and dword [ebp - 0x10], ebx
mov eax, dword [eax + 0x18]
add eax, 9
lea eax, [eax + edx*2]
and eax, 0xfffffffc
add eax, 0xa8
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea esi, [edi + 0x25c]
mov eax, dword [esi]
test eax, eax
je 0x519d4b
mov eax, dword [eax]
add eax, dword [ebp - 4]
cmp eax, 0x3fff8
jb 0x519d4b
lea esi, [edi + 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 0x25c]
push eax
lea ecx, [edi + 0x260]
call fcn.0051adc6
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea esi, [edi + 0x25c]
mov dword [ebp - 0x10], 1
and dword [esi], ebx
cmp dword [esi], ebx
jne 0x519d67
push 0x40000
call fcn.006a66fd
mov dword [esi], eax
pop ecx
test eax, eax
je 0x519d67
and dword [eax], ebx
mov eax, dword [esi]
and dword [eax + 4], ebx
mov ecx, dword [esi]
test ecx, ecx
je 0x519d93
mov eax, dword [ecx]
mov edx, dword [ebp - 4]
add eax, edx
cmp eax, 0x3fff8
jae 0x519d93
mov eax, dword [ecx]
lea ebx, [ecx + 8]
add ebx, eax
mov dword [ebp - 0x18], ecx
add eax, edx
mov dword [ecx], eax
lea eax, [ecx + 4]
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 0x10], 0
je 0x519db7
cmp byte [edi + 0x25a], 0
je 0x519db7
push 0
push edi
push 0x51a9ec
call dword [sym.imp.KERNEL32.dll_QueueUserWorkItem]
test ebx, ebx
je 0x519f87
push 0x30
push dword [ebp + 8]
lea esi, [ebx + 0xa8]
push ebx
call fcn.00689000
mov eax, dword [ebp - 4]
mov dword [ebx], eax
mov eax, esi
sub eax, ebx
mov word [ebx + 0x38], ax
mov eax, dword [ebp - 0x14]
lea eax, [eax*2 + 2]
push eax
mov eax, dword [ebp + 8]
push dword [eax + 0x38]
push esi
call fcn.00689000
mov eax, dword [ebp - 0x14]
inc eax
lea ecx, [esi + eax*2]
mov esi, dword [ebp - 8]
mov eax, ecx
mov dword [ebp - 0x14], ecx
sub eax, ebx
mov word [ebx + 0x3a], ax
lea eax, [esi + esi]
push eax
push dword [ebp + 0xc]
mov dword [ebp - 0x10], eax
push ecx
call fcn.00689000
mov edx, dword [ebp - 0x14]
mov eax, esi
and eax, 0x3f
add esp, 0x24
xor ecx, ecx
mov ax, word [eax*2 + 0x7a7df0]
mov word [edx + esi*2], ax
test esi, esi
je 0x519e4c
mov eax, ecx
and eax, 0x3f
mov ax, word [eax*2 + 0x7a7df0]
xor word [edx + ecx*2], ax
inc ecx
cmp ecx, esi
jb 0x519e36
mov esi, dword [ebp - 0xc]
lea ecx, [edx + 2]
add ecx, dword [ebp - 0x10]
mov eax, ecx
mov dword [ebp + 0xc], ecx
sub eax, ebx
mov word [ebx + 0x3c], ax
lea eax, [esi + esi]
push eax
push dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
push ecx
call fcn.00689000
mov edx, dword [ebp + 0xc]
mov eax, esi
and eax, 0x3f
add esp, 0xc
xor ecx, ecx
mov ax, word [eax*2 + 0x7a7df0]
mov word [edx + esi*2], ax
test esi, esi
je 0x519ea3
mov eax, ecx
and eax, 0x3f
mov ax, word [eax*2 + 0x7a7df0]
xor word [edx + ecx*2], ax
inc ecx
cmp ecx, esi
jb 0x519e8d
mov esi, dword [ebp + 8]
lea ecx, [edx + 2]
add ecx, dword [ebp - 0x14]
mov eax, ecx
sub eax, ebx
mov word [ebx + 0x3e], ax
push dword [esi + 0x18]
push dword [esi + 0x30]
push ecx
call fcn.00689000
xor eax, eax
mov word [ebx + 0x40], ax
push 0x5c
push dword [esi + 0x34]
call fcn.0068a697
mov esi, eax
mov eax, dword [ebp + 8]
push 0x2f
push dword [eax + 0x34]
call fcn.0068a697
add esp, 0x1c
cmp esi, eax
cmova eax, esi
test eax, eax
jne 0x519ef3
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
jmp 0x519ef6
add eax, 2
push 0x20
push eax
lea eax, [ebx + 0x68]
push eax
call fcn.006af30a
xor eax, eax
add esp, 0xc
mov word [ebx + 0xa6], ax
mov eax, dword [edi + 0x34]
mov dword [ebx + 0xc], eax
mov eax, dword [edi + 0x38]
mov dword [ebx + 0x30], eax
mov eax, dword [edi + 0x3c]
mov dword [ebx + 0x34], eax
mov eax, dword [edi + 0x248]
test eax, eax
je 0x519f68
cmp dword [edi + 0x30], 0
je 0x519f68
push eax
call dword [sym.imp.USER32.dll_IsWindow]
test eax, eax
je 0x519f61
mov eax, dword [ebx]
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x24]
push eax
push dword [edi + 0x30]
mov dword [ebp - 0x24], 1
push 0x4a
push dword [edi + 0x248]
mov dword [ebp - 0x1c], ebx
call dword [sym.imp.USER32.dll_SendMessageW]
jmp 0x519f68
and dword [edi + 0x248], 0
mov eax, dword [ebp - 0x18]
add eax, 4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
cmp byte [edi + 0x259], 0
jne 0x519f87
push 1
mov ecx, edi
call fcn.005195c5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc