Function at 0x40bcd0
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [0x490dd8]
push esi
mov esi, dword [0x490ddc]
push edi
xor edi, edi
test ebx, ebx
mov dword [0x490dc0], 2
je 0x40bc91
mov ecx, dword [0x490de8]
push ebp
lea ebx, [ebx]
movzx eax, byte [esi + 0x4a8f7a]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ecx, word [eax*2 + 0x4cd7c8]
mov edx, esi
and edx, 0x7fff
test ecx, ecx
mov word [edx*2 + 0x4bd7c8], cx
mov dword [0x490de8], eax
mov word [eax*2 + 0x4cd7c8], si
je 0x40bb36
mov eax, esi
sub eax, ecx
cmp eax, 0x7efa
ja 0x40bb36
push ecx
call fcn.0040b850
mov edi, eax
add esp, 4
cmp edi, ebx
jbe 0x40bb36
mov edi, ebx
cmp edi, 3
jb 0x40bbe7
mov ebp, dword [0x490dc8]
lea ecx, [edi - 3]
push ecx
sub esi, ebp
push esi
call fcn.00410a90
mov ebx, dword [0x490dd8]
mov ecx, dword [0x490de0]
mov esi, dword [0x490ddc]
sub ebx, edi
add esp, 8
cmp edi, ecx
mov dword [0x490dd8], ebx
ja 0x40bbc0
mov ecx, dword [0x490de8]
dec edi
lea esp, [esp]
movzx edx, byte [esi + 0x4a8f7b]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
mov bp, word [ecx*2 + 0x4cd7c8]
mov edx, esi
and edx, 0x7fff
dec edi
mov word [edx*2 + 0x4bd7c8], bp
mov word [ecx*2 + 0x4cd7c8], si
jne 0x40bb80
mov dword [0x490de8], ecx
jmp 0x40bc12
movzx ecx, byte [esi + edi + 0x4a8f78]
movzx edx, byte [esi + edi + 0x4a8f79]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x490de8], ecx
jmp 0x40bc13
movzx eax, byte [esi + 0x4a8f78]
push eax
push 0
call fcn.00410a90
mov ebx, dword [0x490dd8]
mov esi, dword [0x490ddc]
mov ecx, dword [0x490de8]
add esp, 8
dec ebx
mov dword [0x490dd8], ebx
inc esi
test eax, eax
mov dword [0x490ddc], esi
je 0x40bc57
mov ecx, dword [0x490dd4]
test ecx, ecx
jl 0x40bc2f
lea eax, [ecx + 0x4a8f78]
jmp 0x40bc31
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004110a0
mov esi, dword [0x490ddc]
mov ebx, dword [0x490dd8]
mov ecx, dword [0x490de8]
add esp, 0xc
mov dword [0x490dd4], esi
cmp ebx, 0x106
jae 0x40bc88
nop
mov eax, dword [0x490dcc]
test eax, eax
jne 0x40bc88
call fcn.0040b9a0
mov ebx, dword [0x490dd8]
cmp ebx, 0x106
mov esi, dword [0x490ddc]
mov ecx, dword [0x490de8]
jb 0x40bc60
test ebx, ebx
jne 0x40bae0
pop ebp
mov ecx, dword [0x490dd4]
test ecx, ecx
jl 0x40bcb3
push 1
sub esi, ecx
lea eax, [ecx + 0x4a8f78]
push esi
push eax
call fcn.004110a0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.004110a0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
sub esp, 8
cmp dword [0x490dd0], 3
push ebx
mov dword [esp + 8], 0
mov ebx, 2
jg 0x40bcf3
pop ebx
add esp, 8
jmp 0x40bab0
mov eax, dword [0x490dd8]
test eax, eax
push esi
mov esi, dword [0x490ddc]
je 0x40bf91
push ebp
push edi
mov edi, dword [0x490de8]
jmp 0x40bd20
mov ebx, dword [esp + 0x10]
jmp 0x40bd20
movzx eax, byte [esi + 0x4a8f7a]
mov ebp, dword [0x490dc8]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x4cd7c8]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x4bd7c8], ax
mov dword [0x490de8], edi
mov word [edi*2 + 0x4cd7c8], si
mov dword [0x490dc0], ebx
mov dword [esp + 0x10], 2
je 0x40bdc0
cmp ebx, dword [0x490de0]
jae 0x40bdc0
mov edx, esi
sub edx, eax
cmp edx, 0x7efa
ja 0x40bdc0
push eax
call fcn.0040b850
mov ecx, dword [0x490dd8]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
jbe 0x40bda2
mov dword [esp + 0x10], ecx
mov eax, ecx
cmp eax, 3
jne 0x40bdc0
mov edx, dword [0x490dc8]
mov eax, esi
sub eax, edx
cmp eax, 0x1000
jbe 0x40bdc0
mov dword [esp + 0x10], 2
cmp ebx, 3
jb 0x40beac
cmp dword [esp + 0x10], ebx
ja 0x40beac
add ebx, 0xfffffffd
sub esi, ebp
push ebx
dec esi
push esi
call fcn.00410a90
mov ecx, dword [0x490dc0]
mov esi, dword [0x490dd8]
mov edi, dword [0x490de8]
mov edx, 1
sub edx, ecx
add esi, edx
add esp, 8
mov dword [0x490dd8], esi
mov esi, dword [0x490ddc]
sub ecx, 2
lea ecx, [ecx]
movzx edx, byte [esi + 0x4a8f7b]
inc esi
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x4cd7c8]
mov edx, esi
and edx, 0x7fff
dec ecx
mov word [edx*2 + 0x4bd7c8], bx
mov word [edi*2 + 0x4cd7c8], si
jne 0x40be10
inc esi
test eax, eax
mov dword [0x490dc0], ecx
mov dword [0x490de8], edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [0x490ddc], esi
je 0x40bf2e
mov ecx, dword [0x490dd4]
test ecx, ecx
jl 0x40be85
lea eax, [ecx + 0x4a8f78]
jmp 0x40be87
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004110a0
mov esi, dword [0x490ddc]
mov edi, dword [0x490de8]
add esp, 0xc
mov dword [0x490dd4], esi
jmp 0x40bf2e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40bf14
movzx eax, byte [esi + 0x4a8f77]
push eax
push 0
call fcn.00410a90
add esp, 8
test eax, eax
je 0x40bf06
mov ecx, dword [0x490dd4]
test ecx, ecx
jl 0x40bedc
lea eax, [ecx + 0x4a8f78]
jmp 0x40bede
xor eax, eax
mov edx, dword [0x490ddc]
push 0
sub edx, ecx
push edx
push eax
call fcn.004110a0
mov esi, dword [0x490ddc]
mov edi, dword [0x490de8]
add esp, 0xc
mov dword [0x490dd4], esi
jmp 0x40bf1c
mov esi, dword [0x490ddc]
mov edi, dword [0x490de8]
jmp 0x40bf1c
mov dword [esp + 0x14], 1
mov eax, dword [0x490dd8]
inc esi
dec eax
mov dword [0x490ddc], esi
mov dword [0x490dd8], eax
mov eax, dword [0x490dd8]
mov ebx, 0x106
cmp eax, ebx
jae 0x40bf62
lea esp, [esp]
mov eax, dword [0x490dcc]
test eax, eax
jne 0x40bf62
call fcn.0040b9a0
cmp dword [0x490dd8], ebx
mov esi, dword [0x490ddc]
mov edi, dword [0x490de8]
jb 0x40bf40
mov eax, dword [0x490dd8]
test eax, eax
jne 0x40bd11
mov eax, dword [esp + 0x14]
test eax, eax
pop edi
pop ebp
je 0x40bf91
movzx eax, byte [esi + 0x4a8f77]
push eax
push 0
call fcn.00410a90
mov esi, dword [0x490ddc]
add esp, 8
mov ecx, dword [0x490dd4]
test ecx, ecx
jl 0x40bfb5
push 1
sub esi, ecx
lea eax, [ecx + 0x4a8f78]
push esi
push eax
call fcn.004110a0
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.004110a0
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret