Function at 0x40b8e0
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [0x4903c4]
push esi
mov esi, dword [0x4903c8]
push edi
xor edi, edi
test ebx, ebx
mov dword [0x4903ac], 2
je 0x40b8a1
mov ecx, dword [0x4903d4]
push ebp
lea ebx, [ebx]
movzx eax, byte [esi + 0x4a856a]
shl ecx, 5
xor eax, ecx
and eax, 0x7fff
movzx ecx, word [eax*2 + 0x4ccdb8]
mov edx, esi
and edx, 0x7fff
test ecx, ecx
mov word [edx*2 + 0x4bcdb8], cx
mov dword [0x4903d4], eax
mov word [eax*2 + 0x4ccdb8], si
je 0x40b746
mov eax, esi
sub eax, ecx
cmp eax, 0x7efa
ja 0x40b746
push ecx
call fcn.0040b460
mov edi, eax
add esp, 4
cmp edi, ebx
jbe 0x40b746
mov edi, ebx
cmp edi, 3
jb 0x40b7f7
mov ebp, dword [0x4903b4]
lea ecx, [edi - 3]
push ecx
sub esi, ebp
push esi
call fcn.004106a0
mov ebx, dword [0x4903c4]
mov ecx, dword [0x4903cc]
mov esi, dword [0x4903c8]
sub ebx, edi
add esp, 8
cmp edi, ecx
mov dword [0x4903c4], ebx
ja 0x40b7d0
mov ecx, dword [0x4903d4]
dec edi
lea esp, [esp]
movzx edx, byte [esi + 0x4a856b]
inc esi
shl ecx, 5
xor edx, ecx
and edx, 0x7fff
mov ecx, edx
mov bp, word [ecx*2 + 0x4ccdb8]
mov edx, esi
and edx, 0x7fff
dec edi
mov word [edx*2 + 0x4bcdb8], bp
mov word [ecx*2 + 0x4ccdb8], si
jne 0x40b790
mov dword [0x4903d4], ecx
jmp 0x40b822
movzx ecx, byte [esi + edi + 0x4a8568]
movzx edx, byte [esi + edi + 0x4a8569]
add esi, edi
shl ecx, 5
xor ecx, edx
xor edi, edi
and ecx, 0x7fff
mov dword [0x4903d4], ecx
jmp 0x40b823
movzx eax, byte [esi + 0x4a8568]
push eax
push 0
call fcn.004106a0
mov ebx, dword [0x4903c4]
mov esi, dword [0x4903c8]
mov ecx, dword [0x4903d4]
add esp, 8
dec ebx
mov dword [0x4903c4], ebx
inc esi
test eax, eax
mov dword [0x4903c8], esi
je 0x40b867
mov ecx, dword [0x4903c0]
test ecx, ecx
jl 0x40b83f
lea eax, [ecx + 0x4a8568]
jmp 0x40b841
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00410cb0
mov esi, dword [0x4903c8]
mov ebx, dword [0x4903c4]
mov ecx, dword [0x4903d4]
add esp, 0xc
mov dword [0x4903c0], esi
cmp ebx, 0x106
jae 0x40b898
nop
mov eax, dword [0x4903b8]
test eax, eax
jne 0x40b898
call fcn.0040b5b0
mov ebx, dword [0x4903c4]
cmp ebx, 0x106
mov esi, dword [0x4903c8]
mov ecx, dword [0x4903d4]
jb 0x40b870
test ebx, ebx
jne 0x40b6f0
pop ebp
mov ecx, dword [0x4903c0]
test ecx, ecx
jl 0x40b8c3
push 1
sub esi, ecx
lea eax, [ecx + 0x4a8568]
push esi
push eax
call fcn.00410cb0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
push 1
sub esi, ecx
xor eax, eax
push esi
push eax
call fcn.00410cb0
add esp, 0xc
pop edi
pop esi
pop ebx
ret
sub esp, 8
cmp dword [0x4903bc], 3
push ebx
mov dword [esp + 8], 0
mov ebx, 2
jg 0x40b903
pop ebx
add esp, 8
jmp 0x40b6c0
mov eax, dword [0x4903c4]
test eax, eax
push esi
mov esi, dword [0x4903c8]
je 0x40bba1
push ebp
push edi
mov edi, dword [0x4903d4]
jmp 0x40b930
mov ebx, dword [esp + 0x10]
jmp 0x40b930
movzx eax, byte [esi + 0x4a856a]
mov ebp, dword [0x4903b4]
shl edi, 5
xor eax, edi
and eax, 0x7fff
mov edi, eax
movzx eax, word [edi*2 + 0x4ccdb8]
mov ecx, esi
and ecx, 0x7fff
test eax, eax
mov word [ecx*2 + 0x4bcdb8], ax
mov dword [0x4903d4], edi
mov word [edi*2 + 0x4ccdb8], si
mov dword [0x4903ac], ebx
mov dword [esp + 0x10], 2
je 0x40b9d0
cmp ebx, dword [0x4903cc]
jae 0x40b9d0
mov edx, esi
sub edx, eax
cmp edx, 0x7efa
ja 0x40b9d0
push eax
call fcn.0040b460
mov ecx, dword [0x4903c4]
add esp, 4
cmp eax, ecx
mov dword [esp + 0x10], eax
jbe 0x40b9b2
mov dword [esp + 0x10], ecx
mov eax, ecx
cmp eax, 3
jne 0x40b9d0
mov edx, dword [0x4903b4]
mov eax, esi
sub eax, edx
cmp eax, 0x1000
jbe 0x40b9d0
mov dword [esp + 0x10], 2
cmp ebx, 3
jb 0x40babc
cmp dword [esp + 0x10], ebx
ja 0x40babc
add ebx, 0xfffffffd
sub esi, ebp
push ebx
dec esi
push esi
call fcn.004106a0
mov ecx, dword [0x4903ac]
mov esi, dword [0x4903c4]
mov edi, dword [0x4903d4]
mov edx, 1
sub edx, ecx
add esi, edx
add esp, 8
mov dword [0x4903c4], esi
mov esi, dword [0x4903c8]
sub ecx, 2
lea ecx, [ecx]
movzx edx, byte [esi + 0x4a856b]
inc esi
shl edi, 5
xor edx, edi
and edx, 0x7fff
mov edi, edx
mov bx, word [edi*2 + 0x4ccdb8]
mov edx, esi
and edx, 0x7fff
dec ecx
mov word [edx*2 + 0x4bcdb8], bx
mov word [edi*2 + 0x4ccdb8], si
jne 0x40ba20
inc esi
test eax, eax
mov dword [0x4903ac], ecx
mov dword [0x4903d4], edi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 2
mov dword [0x4903c8], esi
je 0x40bb3e
mov ecx, dword [0x4903c0]
test ecx, ecx
jl 0x40ba95
lea eax, [ecx + 0x4a8568]
jmp 0x40ba97
xor eax, eax
push 0
sub esi, ecx
push esi
push eax
call fcn.00410cb0
mov esi, dword [0x4903c8]
mov edi, dword [0x4903d4]
add esp, 0xc
mov dword [0x4903c0], esi
jmp 0x40bb3e
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40bb24
movzx eax, byte [esi + 0x4a8567]
push eax
push 0
call fcn.004106a0
add esp, 8
test eax, eax
je 0x40bb16
mov ecx, dword [0x4903c0]
test ecx, ecx
jl 0x40baec
lea eax, [ecx + 0x4a8568]
jmp 0x40baee
xor eax, eax
mov edx, dword [0x4903c8]
push 0
sub edx, ecx
push edx
push eax
call fcn.00410cb0
mov esi, dword [0x4903c8]
mov edi, dword [0x4903d4]
add esp, 0xc
mov dword [0x4903c0], esi
jmp 0x40bb2c
mov esi, dword [0x4903c8]
mov edi, dword [0x4903d4]
jmp 0x40bb2c
mov dword [esp + 0x14], 1
mov eax, dword [0x4903c4]
inc esi
dec eax
mov dword [0x4903c8], esi
mov dword [0x4903c4], eax
mov eax, dword [0x4903c4]
mov ebx, 0x106
cmp eax, ebx
jae 0x40bb72
lea esp, [esp]
mov eax, dword [0x4903b8]
test eax, eax
jne 0x40bb72
call fcn.0040b5b0
cmp dword [0x4903c4], ebx
mov esi, dword [0x4903c8]
mov edi, dword [0x4903d4]
jb 0x40bb50
mov eax, dword [0x4903c4]
test eax, eax
jne 0x40b921
mov eax, dword [esp + 0x14]
test eax, eax
pop edi
pop ebp
je 0x40bba1
movzx eax, byte [esi + 0x4a8567]
push eax
push 0
call fcn.004106a0
mov esi, dword [0x4903c8]
add esp, 8
mov ecx, dword [0x4903c0]
test ecx, ecx
jl 0x40bbc5
push 1
sub esi, ecx
lea eax, [ecx + 0x4a8568]
push esi
push eax
call fcn.00410cb0
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.00410cb0
add esp, 0xc
pop esi
pop ebx
add esp, 8
ret