Function at 0x402bf0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 4
push ebx
push esi
push edi
xor ebx, ebx
mov word [0x40e560], bx
push ebp
xor esi, esi
xor ebp, ebp
mov si, word [0x40e504]
cmp dword [0x40e55c], ebx
je 0x402ec0
mov ecx, dword [0x40e5b8]
xor eax, eax
shl esi, 5
mov edx, dword [0x40e640]
mov al, byte [edx + ecx + 2]
mov edx, dword [0x40e630]
xor eax, esi
xor ecx, ecx
and eax, 0x7fff
mov cx, word [edx + eax*2]
mov esi, eax
mov edx, dword [0x40e5b8]
mov eax, dword [0x40e50c]
and edx, 0x7fff
mov word [eax + edx*2], cx
mov edx, dword [0x40e630]
mov edi, dword [0x40e5b8]
mov word [edx + esi*2], di
xor edi, edi
mov di, word [0x40e560]
test ecx, ecx
mov word [0x40e5a8], bp
mov ebp, 2
je 0x402cd4
xor edx, edx
movsx eax, word [0x40e62c]
mov dx, word [0x40e5a8]
cmp eax, edx
jle 0x402cd4
mov eax, dword [0x40e5b8]
sub eax, ecx
cmp eax, 0x7efa
ja 0x402cd4
push ecx
call fcn.00402a50
add esp, 4
mov ebp, eax
mov eax, dword [0x40e55c]
cmp ebp, eax
jbe 0x402cb7
mov ebp, eax
cmp ebp, 3
jne 0x402cd4
mov eax, dword [0x40e5b8]
xor ecx, ecx
mov cx, word [0x40e560]
sub eax, ecx
cmp eax, 0x1000
jle 0x402cd4
dec ebp
cmp word [0x40e5a8], 3
jb 0x402dfc
xor eax, eax
mov ax, word [0x40e5a8]
cmp eax, ebp
jb 0x402dfc
lea eax, [esp + 0x10]
push eax
mov ax, word [0x40e5a8]
sub ax, 3
push eax
mov eax, dword [0x40e5b8]
sub ax, di
dec ax
push eax
call fcn.00404680
add esp, 0xc
cmp eax, 1
sbb eax, eax
neg eax
test eax, eax
jne 0x402efc
mov eax, 1
xor ecx, ecx
mov cx, word [0x40e5a8]
sub word [0x40e5a8], 2
sub eax, ecx
add dword [0x40e55c], eax
xor edx, edx
inc dword [0x40e5b8]
mov eax, dword [0x40e5b8]
shl esi, 5
mov ecx, dword [0x40e640]
mov dl, byte [ecx + eax + 2]
mov eax, dword [0x40e630]
xor edx, esi
and edx, 0x7fff
mov cx, word [eax + edx*2]
mov esi, edx
mov edx, dword [0x40e5b8]
mov eax, dword [0x40e50c]
and edx, 0x7fff
mov word [eax + edx*2], cx
mov edx, dword [0x40e5b8]
mov ecx, dword [0x40e630]
mov word [ecx + esi*2], dx
dec word [0x40e5a8]
jne 0x402d42
xor ebx, ebx
mov ebp, 2
inc dword [0x40e5b8]
cmp dword [esp + 0x10], ebx
je 0x402e99
mov eax, 0
cmp dword [0x40e558], ebx
jl 0x402dcc
mov eax, dword [0x40e640]
add eax, dword [0x40e558]
push 0
mov ecx, dword [0x40e5b8]
sub ecx, dword [0x40e558]
push ecx
push eax
call fcn.00405540
add esp, 0xc
test ax, ax
jne 0x402f3d
mov eax, dword [0x40e5b8]
mov dword [0x40e558], eax
jmp 0x402e99
test ebx, ebx
je 0x402e88
lea eax, [esp + 0x10]
mov ecx, dword [0x40e640]
push eax
mov edx, dword [0x40e5b8]
movzx ax, byte [ecx + edx - 1]
push eax
push 0
call fcn.00404680
add esp, 0xc
cmp eax, 1
sbb eax, eax
neg eax
test eax, eax
jne 0x402f08
cmp dword [esp + 0x10], 0
je 0x402e80
cmp dword [0x40e558], 0
mov eax, 0
jl 0x402e55
mov eax, dword [0x40e640]
add eax, dword [0x40e558]
push 0
mov ecx, dword [0x40e5b8]
sub ecx, dword [0x40e558]
push ecx
push eax
call fcn.00405540
add esp, 0xc
test ax, ax
jne 0x402f3d
mov eax, dword [0x40e5b8]
mov dword [0x40e558], eax
inc dword [0x40e5b8]
jmp 0x402e93
mov ebx, 1
add dword [0x40e5b8], ebx
dec dword [0x40e55c]
cmp dword [0x40e55c], 0x106
jge 0x402eb3
cmp dword [0x40e578], 0
jne 0x402eb3
call fcn.004026b0
cmp dword [0x40e55c], 0
jne 0x402c17
test ebx, ebx
je 0x402ee6
lea eax, [esp + 0x10]
mov edx, dword [0x40e640]
push eax
mov ecx, dword [0x40e5b8]
movzx ax, byte [edx + ecx - 1]
push eax
push 0
call fcn.00404680
add esp, 0xc
cmp dword [0x40e558], 0
jl 0x402f14
mov eax, dword [0x40e640]
add eax, dword [0x40e558]
jmp 0x402f16
mov ax, 0xfff5
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov ax, 0xfff5
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
xor eax, eax
push 1
mov ecx, dword [0x40e5b8]
sub ecx, dword [0x40e558]
push ecx
push eax
call fcn.00405540
add esp, 0xc
test ax, ax
jne 0x402f3d
xor ax, ax
mov word [0x40e504], si
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret