Function at 0x406bb5
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0x18]
push ebx
push ebp
mov ebp, dword [esp + 0x14]
lea ebx, [ecx - 0x35f3]
push esi
mov esi, ecx
xor edx, 0x412
xor esi, 0x35f3
mov dword [esp + 0x24], edx
push edi
mov edi, dword [esp + 0x24]
add ebp, 0xfffffc55
add edi, 0xffffc59f
lea eax, [esi + 0x3d9f]
cmp edx, eax
je 0x406e44
lea eax, [edi + 0x35f3]
cmp esi, eax
jge 0x406e44
lea eax, [ebx + 0x3d35]
cmp esi, eax
je 0x406dc2
mov edi, dword [esp + 0x14]
mov eax, dword [0x52aa18]
mov ecx, dword [0x52aa08]
mov edx, dword [0x517e7c]
add ecx, 0xf82a4
sub eax, dword [edi + 0x118]
add eax, 0x161598
mov dword [0x52aa20], eax
mov eax, dword [0x52aa64]
add eax, ecx
add dword [edx + 0x80], eax
lea eax, [ebx + 0x3525]
push eax
lea eax, [ebx + 0x4036]
mov ebx, dword [esp + 0x28]
push eax
lea eax, [esi + 0x3ded]
xor esi, 0x4036
push eax
push esi
lea eax, [ebx + 0x2ef]
push eax
push dword [0x517e7c]
lea eax, [ebp + 0x44]
push eax
call fcn.00414096
add esp, 0x1c
lea eax, [ebx + 0x52]
cmp dword [edi + 0x120], 0x8d5a
mov dword [esp + 0x28], eax
jae 0x406ca7
mov dword [edi + 0xb4], 0x415190
jmp 0x406cbb
mov eax, dword [edi + 0xfc]
lea ecx, [eax - 0x24b5d]
or ecx, eax
mov dword [edi + 0xfc], ecx
xor esi, esi
mov eax, dword [edi + 0x34]
xor eax, 1
add dword [edi + 0x10c], eax
mov eax, dword [edi + 0xb4]
push 0x1d
mov ecx, dword [esi + eax]
add esi, 4
mov eax, dword [0x52aa80]
sub dword [edi + 0xa0], eax
mov ebx, dword [0x52aa20]
mov eax, dword [0x517e7c]
imul ebx, ecx
mov ecx, dword [eax + 0x84]
mov eax, dword [edi + 0xb8]
mov edx, ebx
shr edx, 8
mov byte [ecx + eax], dl
mov eax, dword [0x517e7c]
inc dword [eax + 0x84]
mov edx, dword [edi + 0x114]
pop eax
sub eax, edx
add dword [edi + 0x78], eax
mov eax, dword [0x52aa1c]
add eax, 0xffe736c1
add dword [edi + 0x78], eax
mov eax, dword [0x517e7c]
mov eax, dword [eax + 0x1c]
sub eax, 0x11
imul eax, edx
mov dword [edi + 0x114], eax
mov eax, dword [edi + 8]
add eax, dword [edi + 0x68]
xor eax, 0xfff09a93
or dword [edi + 0x48], eax
mov eax, dword [0x517e7c]
mov eax, dword [eax + 8]
sub eax, dword [edi + 0xc]
xor eax, 0xfff0490e
add dword [edi + 0x108], eax
mov eax, dword [0x52a9d4]
xor eax, dword [0x52aaa8]
xor eax, 1
mov dword [0x52aaa8], eax
mov ecx, dword [edi + 0x84]
mov eax, dword [0x52aa58]
mov byte [eax + ecx], bl
inc dword [edi + 0x84]
mov ecx, dword [0x517e7c]
mov eax, dword [edi + 0xa0]
sub dword [ecx + 0x1c], eax
cmp esi, 0x1b18
jl 0x406cbd
mov eax, dword [edi + 0x124]
add eax, dword [0x52a9c0]
xor eax, 0x22d90b3a
mov dword [edi + 0x80], eax
mov edi, dword [esp + 0x28]
jmp 0x406e44
mov edx, dword [esp + 0x14]
mov eax, ebp
and eax, 0x40b1
cmp dword [edx + 0xfc], eax
jne 0x406e1d
mov eax, dword [edx + 0xec]
xor eax, ebx
add eax, 0x360b
cmp dword [0x52aa78], eax
ja 0x406e44
mov eax, dword [edx + 0xdc]
imul eax, ebx
cmp dword [edx + 0x98], eax
jbe 0x406e44
mov ecx, dword [0x517e7c]
mov eax, dword [edx + 0x120]
and eax, dword [0x52aa1c]
xor eax, dword [ecx + 0x20]
xor eax, ebx
mov dword [ecx + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x406e44
mov eax, dword [esp + 0x28]
add eax, 0xffffc9f5
cmp esi, eax
je 0x406e44
mov eax, dword [0x52aa7c]
add eax, 0xffffc261
add eax, dword [edx + 0x78]
cmp esi, eax
jae 0x406e44
or ebp, edi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [edi + 0x33a]
pop edi
pop esi
pop ebp
pop ebx
ret