Function at 0x40bd00
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [0x49626c]
push esi
mov esi, dword [0x496270]
push edi
xor edi, edi
test ebx, ebx
mov dword [0x496254], 2
je 0x40bcc1
mov ecx, dword [0x49627c]
push ebp
lea ebx, [ebx]
movzx eax, byte [esi + 0x4ae412]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ecx, word [eax*2 + 0x4d2c60]
mov edx, esi
and edx, 0x7fff
test ecx, ecx
mov word [edx*2 + 0x4c2c60], cx
mov dword [0x49627c], eax
mov word [eax*2 + 0x4d2c60], si
je 0x40bb66
mov eax, esi
sub eax, ecx
cmp eax, 0x7efa
ja 0x40bb66
push ecx
call fcn.0040b880
mov edi, eax
add esp, 4
cmp edi, ebx
jbe 0x40bb66
mov edi, ebx
cmp edi, 3
jb 0x40bc17
mov ebp, dword [0x49625c]
lea ecx, [edi - 3]
push ecx
sub esi, ebp
push esi
call fcn.00410ae0
mov ebx, dword [0x49626c]
mov ecx, dword [0x496274]
mov esi, dword [0x496270]
sub ebx, edi
add esp, 8
cmp edi, ecx
mov dword [0x49626c], ebx
ja 0x40bbf0
mov ecx, dword [0x49627c]
dec edi
lea esp, [esp]
movzx edx, byte [esi + 0x4ae413]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
mov bp, word [ecx*2 + 0x4d2c60]
mov edx, esi
and edx, 0x7fff
dec edi
mov word [edx*2 + 0x4c2c60], bp
mov word [ecx*2 + 0x4d2c60], si
jne 0x40bbb0
mov dword [0x49627c], ecx
jmp 0x40bc42
movzx ecx, byte [esi + edi + 0x4ae410]
movzx edx, byte [esi + edi + 0x4ae411]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x49627c], ecx
jmp 0x40bc43
movzx eax, byte [esi + 0x4ae410]
push eax
push 0
call fcn.00410ae0
mov ebx, dword [0x49626c]
mov esi, dword [0x496270]
mov ecx, dword [0x49627c]
add esp, 8
dec ebx
mov dword [0x49626c], ebx
inc esi
test eax, eax
mov dword [0x496270], esi
je 0x40bc87
mov ecx, dword [0x496268]
test ecx, ecx
jl 0x40bc5f
lea eax, [ecx + 0x4ae410]
jmp 0x40bc61
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004110f0
mov esi, dword [0x496270]
mov ebx, dword [0x49626c]
mov ecx, dword [0x49627c]
add esp, 0xc
mov dword [0x496268], esi
cmp ebx, 0x106
jae 0x40bcb8
nop
mov eax, dword [0x496260]
test eax, eax
jne 0x40bcb8
call fcn.0040b9d0
mov ebx, dword [0x49626c]
cmp ebx, 0x106
mov esi, dword [0x496270]
mov ecx, dword [0x49627c]
jb 0x40bc90
test ebx, ebx
jne 0x40bb10
pop ebp
mov ecx, dword [0x496268]
test ecx, ecx
jl 0x40bce3
push 1
sub esi, ecx
lea eax, [ecx + 0x4ae410]
push esi
push eax
call fcn.004110f0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.004110f0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
sub esp, 8
cmp dword [0x496264], 3
push ebx
mov dword [esp + 8], 0
mov ebx, 2
jg 0x40bd23
pop ebx
add esp, 8
jmp 0x40bae0
mov eax, dword [0x49626c]
test eax, eax
push esi
mov esi, dword [0x496270]
je 0x40bfc1
push ebp
push edi
mov edi, dword [0x49627c]
jmp 0x40bd50
mov ebx, dword [esp + 0x10]
jmp 0x40bd50
movzx eax, byte [esi + 0x4ae412]
mov ebp, dword [0x49625c]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x4d2c60]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x4c2c60], ax
mov dword [0x49627c], edi
mov word [edi*2 + 0x4d2c60], si
mov dword [0x496254], ebx
mov dword [esp + 0x10], 2
je 0x40bdf0
cmp ebx, dword [0x496274]
jae 0x40bdf0
mov edx, esi
sub edx, eax
cmp edx, 0x7efa
ja 0x40bdf0
push eax
call fcn.0040b880
mov ecx, dword [0x49626c]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
jbe 0x40bdd2
mov dword [esp + 0x10], ecx
mov eax, ecx
cmp eax, 3
jne 0x40bdf0
mov edx, dword [0x49625c]
mov eax, esi
sub eax, edx
cmp eax, 0x1000
jbe 0x40bdf0
mov dword [esp + 0x10], 2
cmp ebx, 3
jb 0x40bedc
cmp dword [esp + 0x10], ebx
ja 0x40bedc
add ebx, 0xfffffffd
sub esi, ebp
push ebx
dec esi
push esi
call fcn.00410ae0
mov ecx, dword [0x496254]
mov esi, dword [0x49626c]
mov edi, dword [0x49627c]
mov edx, 1
sub edx, ecx
add esi, edx
add esp, 8
mov dword [0x49626c], esi
mov esi, dword [0x496270]
sub ecx, 2
lea ecx, [ecx]
movzx edx, byte [esi + 0x4ae413]
inc esi
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x4d2c60]
mov edx, esi
and edx, 0x7fff
dec ecx
mov word [edx*2 + 0x4c2c60], bx
mov word [edi*2 + 0x4d2c60], si
jne 0x40be40
inc esi
test eax, eax
mov dword [0x496254], ecx
mov dword [0x49627c], edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [0x496270], esi
je 0x40bf5e
mov ecx, dword [0x496268]
test ecx, ecx
jl 0x40beb5
lea eax, [ecx + 0x4ae410]
jmp 0x40beb7
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.004110f0
mov esi, dword [0x496270]
mov edi, dword [0x49627c]
add esp, 0xc
mov dword [0x496268], esi
jmp 0x40bf5e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40bf44
movzx eax, byte [esi + 0x4ae40f]
push eax
push 0
call fcn.00410ae0
add esp, 8
test eax, eax
je 0x40bf36
mov ecx, dword [0x496268]
test ecx, ecx
jl 0x40bf0c
lea eax, [ecx + 0x4ae410]
jmp 0x40bf0e
xor eax, eax
mov edx, dword [0x496270]
push 0
sub edx, ecx
push edx
push eax
call fcn.004110f0
mov esi, dword [0x496270]
mov edi, dword [0x49627c]
add esp, 0xc
mov dword [0x496268], esi
jmp 0x40bf4c
mov esi, dword [0x496270]
mov edi, dword [0x49627c]
jmp 0x40bf4c
mov dword [esp + 0x14], 1
mov eax, dword [0x49626c]
inc esi
dec eax
mov dword [0x496270], esi
mov dword [0x49626c], eax
mov eax, dword [0x49626c]
mov ebx, 0x106
cmp eax, ebx
jae 0x40bf92
lea esp, [esp]
mov eax, dword [0x496260]
test eax, eax
jne 0x40bf92
call fcn.0040b9d0
cmp dword [0x49626c], ebx
mov esi, dword [0x496270]
mov edi, dword [0x49627c]
jb 0x40bf70
mov eax, dword [0x49626c]
test eax, eax
jne 0x40bd41
mov eax, dword [esp + 0x14]
test eax, eax
pop edi
pop ebp
je 0x40bfc1
movzx eax, byte [esi + 0x4ae40f]
push eax
push 0
call fcn.00410ae0
mov esi, dword [0x496270]
add esp, 8
mov ecx, dword [0x496268]
test ecx, ecx
jl 0x40bfe5
push 1
sub esi, ecx
lea eax, [ecx + 0x4ae410]
push esi
push eax
call fcn.004110f0
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.004110f0
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret