Function at 0x405870
Capabilities:
Encode data using xor

Disassembly:
movsx eax, word [0x46b0a8]
movsx edx, word [0x46b0b6]
add eax, edx
push ebp
mov dword [0x46b1c4], eax
mov ebp, esp
mov ecx, dword [0x46b1c4]
add esp, 0xffffffe8
shl ecx, 4
mov dword [0x46b1c4], ecx
push ebx
movsx eax, word [0x46b0b4]
add dword [0x46b1c4], eax
push esi
push edi
mov edx, dword [0x46b1c4]
mov edi, dword [ebp + 8]
push 0
push edx
push edi
call fcn.0042e350
xor ecx, ecx
add esp, 0xc
mov ebx, ecx
mov esi, ecx
mov byte [ebp - 2], 0
cmp ebx, 0x64
jae 0x4059fd
push edi
call fcn.00430138
pop ecx
mov byte [ebp - 1], al
mov eax, esi
cmp eax, 0xa
ja case.default.0x4058e7
jmp dword [eax*4 + 0x4058ee]
cmp byte [ebp - 1], 0xe
jne case.default.0x4058e7
inc esi
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0x1f
jne case.default.0x4058e7
inc esi
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xbb
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
mov word [ebp - 0x16], ax
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xb9
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
mov word [ebp - 0x14], ax
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xba
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
mov word [ebp - 0x12], ax
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xc1
jne case.default.0x4058e7
cmp byte [ebp - 2], 0x81
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
add word [ebp - 0x14], ax
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0x97
jne case.default.0x4058e7
cmp byte [ebp - 2], 0x30
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
add word [ebp - 0x16], ax
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0x43
jne case.default.0x4058e7
inc esi
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xf2
jne case.default.0x4058e7
cmp byte [ebp - 2], 0
jne case.default.0x4058e7
inc esi
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xe2
jne case.default.0x4058e7
inc esi
jmp case.default.0x4058e7
cmp byte [ebp - 1], 0xe9
jne case.default.0x4058e7
inc esi
push edi
call fcn.00418670
pop ecx
mov word [ebp - 0x18], ax
cmp esi, 0xb
je 0x4059fd
mov dl, byte [ebp - 1]
mov byte [ebp - 2], dl
inc ebx
cmp ebx, 0x64
jb 0x4058d2
cmp esi, 0xb
je 0x405a09
xor eax, eax
jmp 0x405b57
push 1
push edi
push 0x12
call fcn.00401410
add esp, 0xc
dec eax
je 0x405a20
xor eax, eax
jmp 0x405b57
sub dword [0x46b1c4], 0xb1e
push 0
mov edx, dword [0x46b1c4]
push edx
push edi
call fcn.0042e350
add esp, 0xc
push 0x1e
call fcn.0042b7bc
pop ecx
mov dword [ebp - 8], eax
push edi
push 0x1e
push 1
mov ecx, dword [ebp - 8]
push ecx
call fcn.0042e2b0
add esp, 0x10
push 0
push 0
push edi
call fcn.0042e350
add esp, 0xc
xor ebx, ebx
mov eax, dword [ebp - 8]
mov dl, byte [ebp - 0x12]
inc ebx
xor byte [eax], dl
inc eax
mov cl, byte [ebp - 0x11]
add byte [ebp - 0x12], cl
cmp ebx, 0x1e
jb 0x405a6a
mov eax, dword [ebp - 8]
xor edx, edx
mov ecx, dword [ebp - 8]
movzx esi, byte [eax + 0x18]
mov eax, dword [ebp - 8]
mov dl, byte [eax + 0x19]
mov eax, dword [ebp - 8]
shl edx, 8
add esi, edx
xor edx, edx
sub si, 0x10
mov word [0x46b0ae], si
movzx esi, byte [ecx + 0x16]
mov dl, byte [eax + 0x17]
mov ecx, dword [ebp - 8]
shl edx, 8
mov eax, dword [ebp - 8]
add esi, edx
xor edx, edx
sub si, 0x10
mov word [0x46b0b6], si
movzx esi, byte [ecx + 0x14]
mov dl, byte [eax + 0x15]
shl edx, 8
add esi, edx
mov word [0x46b0b4], si
mov ecx, dword [0x46b1c4]
test ecx, ecx
jns 0x405ae5
add ecx, 0x1ff
sar ecx, 9
mov word [0x46b0a4], cx
mov ax, word [0x46b0a4]
shl eax, 9
mov dx, word [0x46b1c4]
sub dx, ax
mov word [0x46b0a2], dx
cmp word [0x46b0a2], 0
je 0x405b1a
inc word [0x46b0a4]
push 0
push 0
push edi
call fcn.0042e350
add esp, 0xc
push edi
push 2
push 0xc
push 0x46b0a0
call fcn.0042e540
add esp, 0x10
mov ecx, dword [ebp - 8]
push ecx
call fcn.0042b7cc
pop ecx
push edi
call fcn.00418690
pop ecx
inc eax
jne 0x405b52
or eax, 0xffffffff
jmp 0x405b57
mov eax, 0x12
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret