Function at 0x401690
Capabilities:
Encode data using xor

Disassembly:
push ecx
mov eax, dword [0x4137d8]
push ebp
cmp eax, 3
mov dword [esp + 4], 0
mov ebp, 2
jg 0x4016b1
call fcn.004019a0
pop ebp
pop ecx
ret
mov eax, dword [0x4137dc]
test eax, eax
je 0x40195b
mov edx, dword [0x4137d0]
mov ecx, dword [0x463a44]
push ebx
push esi
push edi
xor eax, eax
and edx, 0x3ff
mov al, byte [ecx + 0x4438c2]
mov esi, ecx
and eax, 0x7fff
mov edi, dword [0x463a54]
shl edx, 5
xor edx, eax
xor eax, eax
and esi, 0x7fff
mov dword [0x4137d0], edx
mov ax, word [edx*2 + 0x4338a0]
mov word [esi*2 + 0x4238a0], ax
mov esi, ebp
test eax, eax
mov word [edx*2 + 0x4338a0], cx
mov dword [0x463a40], esi
mov ebp, 2
je 0x401780
cmp esi, dword [0x4137cc]
jae 0x401780
mov ebx, ecx
sub ebx, eax
cmp ebx, 0x7efa
ja 0x401780
push eax
call fcn.00401440
mov ebp, eax
mov eax, dword [0x4137dc]
add esp, 4
cmp ebp, eax
jbe 0x40174e
mov ebp, eax
cmp ebp, 3
jne 0x401840
mov ecx, dword [0x463a44]
mov esi, dword [0x463a54]
mov edx, ecx
sub edx, esi
cmp edx, 0x1000
jbe 0x401774
mov ebp, 2
mov edx, dword [0x4137d0]
mov esi, dword [0x463a40]
cmp esi, 3
jb 0x401878
cmp ebp, esi
ja 0x401878
sub ecx, edi
add esi, 0xfffffffd
dec ecx
push esi
push ecx
call fcn.004069d0
mov esi, dword [0x463a40]
mov ecx, dword [0x4137dc]
mov edi, eax
mov edx, dword [0x4137d0]
mov eax, 1
add esp, 8
sub eax, esi
add ecx, eax
sub esi, 2
mov dword [0x4137dc], ecx
mov ecx, dword [0x463a44]
inc ecx
xor eax, eax
and edx, 0x3ff
mov al, byte [ecx + 0x4438c2]
and eax, 0x7fff
shl edx, 5
xor edx, eax
mov eax, ecx
and eax, 0x7fff
dec esi
mov bx, word [edx*2 + 0x4338a0]
mov word [eax*2 + 0x4238a0], bx
mov word [edx*2 + 0x4338a0], cx
jne 0x4017cd
mov dword [0x463a40], esi
xor esi, esi
inc ecx
mov dword [0x4137d0], edx
test edi, edi
mov dword [esp + 0x10], esi
mov ebp, 2
mov dword [0x463a44], ecx
je 0x401908
mov edx, dword [0x463a58]
test edx, edx
jl 0x401851
lea eax, [edx + 0x4438c0]
jmp 0x401853
mov edx, dword [0x4137d0]
mov ecx, dword [0x463a44]
jmp 0x40177a
xor eax, eax
sub ecx, edx
push 0
push ecx
push eax
call fcn.004060c0
mov ecx, dword [0x463a44]
mov edx, dword [0x4137d0]
add esp, 0xc
mov dword [0x463a58], ecx
jmp 0x401908
mov esi, dword [esp + 0x10]
test esi, esi
je 0x4018ed
xor edx, edx
mov dl, byte [ecx + 0x4438bf]
push edx
push 0
call fcn.004069d0
add esp, 8
test eax, eax
je 0x4018cd
mov ecx, dword [0x463a58]
test ecx, ecx
jl 0x4018a9
lea eax, [ecx + 0x4438c0]
jmp 0x4018ab
xor eax, eax
mov edx, dword [0x463a44]
push 0
sub edx, ecx
push edx
push eax
call fcn.004060c0
mov ecx, dword [0x463a44]
add esp, 0xc
mov dword [0x463a58], ecx
jmp 0x4018d3
mov ecx, dword [0x463a44]
mov eax, dword [0x4137dc]
mov edx, dword [0x4137d0]
inc ecx
dec eax
mov dword [0x463a44], ecx
mov dword [0x4137dc], eax
jmp 0x401908
mov eax, dword [0x4137dc]
inc ecx
mov esi, 1
dec eax
mov dword [esp + 0x10], esi
mov dword [0x463a44], ecx
mov dword [0x4137dc], eax
mov eax, dword [0x4137dc]
cmp eax, 0x106
jae 0x40193b
mov edi, dword [0x4137d4]
test edi, edi
jne 0x40193b
call fcn.00401590
mov eax, dword [0x4137dc]
mov edx, dword [0x4137d0]
mov ecx, dword [0x463a44]
cmp eax, 0x106
jb 0x401914
test eax, eax
jne 0x4016cd
pop edi
test esi, esi
pop esi
pop ebx
je 0x401961
mov al, byte [ecx + 0x4438bf]
push eax
push 0
call fcn.004069d0
add esp, 8
mov ecx, dword [0x463a44]
mov edx, dword [0x463a58]
test edx, edx
jl 0x401982
sub ecx, edx
lea eax, [edx + 0x4438c0]
push 1
push ecx
push eax
call fcn.004060c0
add esp, 0xc
pop ebp
pop ecx
ret
sub ecx, edx
xor eax, eax
push 1
push ecx
push eax
call fcn.004060c0
add esp, 0xc
pop ebp
pop ecx
ret