Function at 0x40be00
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [0x495744]
push esi
mov esi, dword [0x495748]
push edi
xor edi, edi
test ebx, ebx
mov dword [0x49572c], 2
je 0x40bdc1
mov ecx, dword [0x495754]
push ebp
lea ebx, [ebx]
movzx eax, byte [esi + 0x4ad8ea]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ecx, word [eax*2 + 0x4d2138]
mov edx, esi
and edx, 0x7fff
test ecx, ecx
mov word [edx*2 + 0x4c2138], cx
mov dword [0x495754], eax
mov word [eax*2 + 0x4d2138], si
je 0x40bc66
mov eax, esi
sub eax, ecx
cmp eax, 0x7efa
ja 0x40bc66
push ecx
call fcn.0040b980
mov edi, eax
add esp, 4
cmp edi, ebx
jbe 0x40bc66
mov edi, ebx
cmp edi, 3
jb 0x40bd17
mov ebp, dword [0x495734]
lea ecx, [edi - 3]
push ecx
sub esi, ebp
push esi
call fcn.00410be0
mov ebx, dword [0x495744]
mov ecx, dword [0x49574c]
mov esi, dword [0x495748]
sub ebx, edi
add esp, 8
cmp edi, ecx
mov dword [0x495744], ebx
ja 0x40bcf0
mov ecx, dword [0x495754]
dec edi
lea esp, [esp]
movzx edx, byte [esi + 0x4ad8eb]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
mov bp, word [ecx*2 + 0x4d2138]
mov edx, esi
and edx, 0x7fff
dec edi
mov word [edx*2 + 0x4c2138], bp
mov word [ecx*2 + 0x4d2138], si
jne 0x40bcb0
mov dword [0x495754], ecx
jmp 0x40bd42
movzx ecx, byte [esi + edi + 0x4ad8e8]
movzx edx, byte [esi + edi + 0x4ad8e9]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x495754], ecx
jmp 0x40bd43
movzx eax, byte [esi + 0x4ad8e8]
push eax
push 0
call fcn.00410be0
mov ebx, dword [0x495744]
mov esi, dword [0x495748]
mov ecx, dword [0x495754]
add esp, 8
dec ebx
mov dword [0x495744], ebx
inc esi
test eax, eax
mov dword [0x495748], esi
je 0x40bd87
mov ecx, dword [0x495740]
test ecx, ecx
jl 0x40bd5f
lea eax, [ecx + 0x4ad8e8]
jmp 0x40bd61
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004111f0
mov esi, dword [0x495748]
mov ebx, dword [0x495744]
mov ecx, dword [0x495754]
add esp, 0xc
mov dword [0x495740], esi
cmp ebx, 0x106
jae 0x40bdb8
nop
mov eax, dword [0x495738]
test eax, eax
jne 0x40bdb8
call fcn.0040bad0
mov ebx, dword [0x495744]
cmp ebx, 0x106
mov esi, dword [0x495748]
mov ecx, dword [0x495754]
jb 0x40bd90
test ebx, ebx
jne 0x40bc10
pop ebp
mov ecx, dword [0x495740]
test ecx, ecx
jl 0x40bde3
push 1
sub esi, ecx
lea eax, [ecx + 0x4ad8e8]
push esi
push eax
call fcn.004111f0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.004111f0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
sub esp, 8
cmp dword [0x49573c], 3
push ebx
mov dword [esp + 8], 0
mov ebx, 2
jg 0x40be23
pop ebx
add esp, 8
jmp 0x40bbe0
mov eax, dword [0x495744]
test eax, eax
push esi
mov esi, dword [0x495748]
je 0x40c0c1
push ebp
push edi
mov edi, dword [0x495754]
jmp 0x40be50
mov ebx, dword [esp + 0x10]
jmp 0x40be50
movzx eax, byte [esi + 0x4ad8ea]
mov ebp, dword [0x495734]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x4d2138]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x4c2138], ax
mov dword [0x495754], edi
mov word [edi*2 + 0x4d2138], si
mov dword [0x49572c], ebx
mov dword [esp + 0x10], 2
je 0x40bef0
cmp ebx, dword [0x49574c]
jae 0x40bef0
mov edx, esi
sub edx, eax
cmp edx, 0x7efa
ja 0x40bef0
push eax
call fcn.0040b980
mov ecx, dword [0x495744]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
jbe 0x40bed2
mov dword [esp + 0x10], ecx
mov eax, ecx
cmp eax, 3
jne 0x40bef0
mov edx, dword [0x495734]
mov eax, esi
sub eax, edx
cmp eax, 0x1000
jbe 0x40bef0
mov dword [esp + 0x10], 2
cmp ebx, 3
jb 0x40bfdc
cmp dword [esp + 0x10], ebx
ja 0x40bfdc
add ebx, 0xfffffffd
sub esi, ebp
push ebx
dec esi
push esi
call fcn.00410be0
mov ecx, dword [0x49572c]
mov esi, dword [0x495744]
mov edi, dword [0x495754]
mov edx, 1
sub edx, ecx
add esi, edx
add esp, 8
mov dword [0x495744], esi
mov esi, dword [0x495748]
sub ecx, 2
lea ecx, [ecx]
movzx edx, byte [esi + 0x4ad8eb]
inc esi
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x4d2138]
mov edx, esi
and edx, 0x7fff
dec ecx
mov word [edx*2 + 0x4c2138], bx
mov word [edi*2 + 0x4d2138], si
jne 0x40bf40
inc esi
test eax, eax
mov dword [0x49572c], ecx
mov dword [0x495754], edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [0x495748], esi
je 0x40c05e
mov ecx, dword [0x495740]
test ecx, ecx
jl 0x40bfb5
lea eax, [ecx + 0x4ad8e8]
jmp 0x40bfb7
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004111f0
mov esi, dword [0x495748]
mov edi, dword [0x495754]
add esp, 0xc
mov dword [0x495740], esi
jmp 0x40c05e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40c044
movzx eax, byte [esi + 0x4ad8e7]
push eax
push 0
call fcn.00410be0
add esp, 8
test eax, eax
je 0x40c036
mov ecx, dword [0x495740]
test ecx, ecx
jl 0x40c00c
lea eax, [ecx + 0x4ad8e8]
jmp 0x40c00e
xor eax, eax
mov edx, dword [0x495748]
push 0
sub edx, ecx
push edx
push eax
call fcn.004111f0
mov esi, dword [0x495748]
mov edi, dword [0x495754]
add esp, 0xc
mov dword [0x495740], esi
jmp 0x40c04c
mov esi, dword [0x495748]
mov edi, dword [0x495754]
jmp 0x40c04c
mov dword [esp + 0x14], 1
mov eax, dword [0x495744]
inc esi
dec eax
mov dword [0x495748], esi
mov dword [0x495744], eax
mov eax, dword [0x495744]
mov ebx, 0x106
cmp eax, ebx
jae 0x40c092
lea esp, [esp]
mov eax, dword [0x495738]
test eax, eax
jne 0x40c092
call fcn.0040bad0
cmp dword [0x495744], ebx
mov esi, dword [0x495748]
mov edi, dword [0x495754]
jb 0x40c070
mov eax, dword [0x495744]
test eax, eax
jne 0x40be41
mov eax, dword [esp + 0x14]
test eax, eax
pop edi
pop ebp
je 0x40c0c1
movzx eax, byte [esi + 0x4ad8e7]
push eax
push 0
call fcn.00410be0
mov esi, dword [0x495748]
add esp, 8
mov ecx, dword [0x495740]
test ecx, ecx
jl 0x40c0e5
push 1
sub esi, ecx
lea eax, [ecx + 0x4ad8e8]
push esi
push eax
call fcn.004111f0
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.004111f0
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret