Function at 0x406ba0
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 8]
mov eax, ecx
mov edx, dword [esp + 0x18]
xor eax, 0x531
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
lea ebx, [ecx - 0x51d]
push esi
mov esi, dword [esp + 0x18]
xor edx, 0xe95
push edi
mov edi, ecx
mov dword [esp + 0x18], eax
xor edi, 0x16e
mov dword [esp + 0x28], edx
add esi, 0xfffffefe
mov dword [esp + 0x24], esi
lea eax, [edi - 0xea]
cmp edx, eax
je 0x406e39
lea eax, [ebp - 0x55b]
cmp edi, eax
je 0x406e39
lea eax, [ebx + 0xce]
cmp edi, eax
jle 0x406db3
mov esi, dword [esp + 0x14]
xor edi, 0x4a
mov eax, dword [0x529168]
mov ecx, dword [0x529158]
mov edx, dword [0x4ae154]
add ecx, 0xf82a4
sub eax, dword [esi + 0x118]
add eax, 0x161598
mov dword [0x529170], eax
mov eax, dword [0x5291b4]
add eax, ecx
add dword [edx + 0x80], eax
lea eax, [ebx + 0x641]
push eax
lea eax, [ebx + 0x87a]
push eax
mov eax, dword [esp + 0x20]
add eax, 0xfffffb13
push eax
push edi
lea eax, [ebp + 0x239]
push eax
push dword [0x4ae154]
mov eax, dword [esp + 0x3c]
add eax, 0x1d4
push eax
call fcn.0041408a
add esp, 0x1c
add ebp, 0xfffffa8d
cmp dword [esi + 0x120], 0x8d5a
jae 0x406c9c
mov dword [esi + 0xb4], 0x415190
jmp 0x406cb0
mov eax, dword [esi + 0xfc]
lea ecx, [eax - 0x24b5d]
or ecx, eax
mov dword [esi + 0xfc], ecx
xor edi, edi
mov eax, dword [esi + 0x34]
xor eax, 1
add dword [esi + 0x10c], eax
mov eax, dword [esi + 0xb4]
push 0x1d
mov ecx, dword [edi + eax]
add edi, 4
mov eax, dword [0x5291d0]
sub dword [esi + 0xa0], eax
mov ebx, dword [0x529170]
mov eax, dword [0x4ae154]
imul ebx, ecx
mov ecx, dword [eax + 0x84]
mov eax, dword [esi + 0xb8]
mov edx, ebx
shr edx, 8
mov byte [ecx + eax], dl
mov eax, dword [0x4ae154]
inc dword [eax + 0x84]
mov edx, dword [esi + 0x114]
pop eax
sub eax, edx
add dword [esi + 0x78], eax
mov eax, dword [0x52916c]
add eax, 0xffe736c1
add dword [esi + 0x78], eax
mov eax, dword [0x4ae154]
mov eax, dword [eax + 0x1c]
sub eax, 0x11
imul eax, edx
mov dword [esi + 0x114], eax
mov eax, dword [esi + 8]
add eax, dword [esi + 0x68]
xor eax, 0xfff09a93
or dword [esi + 0x48], eax
mov eax, dword [0x4ae154]
mov eax, dword [eax + 8]
sub eax, dword [esi + 0xc]
xor eax, 0xfff0490e
add dword [esi + 0x108], eax
mov eax, dword [0x529124]
xor eax, dword [0x5291f8]
xor eax, 1
mov dword [0x5291f8], eax
mov ecx, dword [esi + 0x84]
mov eax, dword [0x5291a8]
mov byte [eax + ecx], bl
inc dword [esi + 0x84]
mov ecx, dword [0x4ae154]
mov eax, dword [esi + 0xa0]
sub dword [ecx + 0x1c], eax
cmp edi, 0x24d8
jl 0x406cb2
mov eax, dword [esi + 0x124]
add eax, dword [0x529110]
xor eax, 0x22d90b3a
mov dword [esi + 0x80], eax
jmp 0x406e39
mov edx, dword [esp + 0x14]
mov eax, esi
and eax, 0x3a86
cmp dword [edx + 0xfc], eax
jne 0x406e0e
mov eax, dword [edx + 0xec]
xor eax, ebx
add eax, 0x39a7
cmp dword [0x5291c8], eax
ja 0x406e39
mov eax, dword [edx + 0xdc]
imul eax, ebx
cmp dword [edx + 0x98], eax
jbe 0x406e39
mov ecx, dword [0x4ae154]
mov eax, dword [edx + 0x120]
and eax, dword [0x52916c]
xor eax, dword [ecx + 0x20]
xor eax, ebx
mov dword [ecx + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x406e39
mov eax, dword [esp + 0x28]
mov ebx, dword [esp + 0x18]
add eax, 0xffffbf37
cmp ebx, eax
je 0x406e39
mov eax, dword [0x5291cc]
add eax, 0xffffc08d
add eax, dword [edx + 0x78]
cmp ebx, eax
jae 0x406e39
or esi, ebp
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
lea eax, [ebp + 0x980]
pop ebp
pop ebx
ret