Function at 0x402a60
Capabilities:
Encode data using xor

Disassembly:
sub esp, 4
push ebx
push esi
push edi
xor ebx, ebx
mov word [0x40e460], bx
push ebp
xor esi, esi
xor ebp, ebp
mov si, word [0x40e404]
cmp dword [0x40e45c], ebx
je 0x402d30
mov ecx, dword [0x40e4b8]
xor eax, eax
shl esi, 5
mov edx, dword [0x40e540]
mov al, byte [edx + ecx + 2]
mov edx, dword [0x40e530]
xor eax, esi
xor ecx, ecx
and eax, 0x7fff
mov cx, word [edx + eax*2]
mov esi, eax
mov edx, dword [0x40e4b8]
mov eax, dword [0x40e40c]
and edx, 0x7fff
mov word [eax + edx*2], cx
mov edx, dword [0x40e530]
mov edi, dword [0x40e4b8]
mov word [edx + esi*2], di
xor edi, edi
mov di, word [0x40e460]
test ecx, ecx
mov word [0x40e4a8], bp
mov ebp, 2
je 0x402b44
xor edx, edx
movsx eax, word [0x40e52c]
mov dx, word [0x40e4a8]
cmp eax, edx
jle 0x402b44
mov eax, dword [0x40e4b8]
sub eax, ecx
cmp eax, 0x7efa
ja 0x402b44
push ecx
call fcn.004028c0
add esp, 4
mov ebp, eax
mov eax, dword [0x40e45c]
cmp ebp, eax
jbe 0x402b27
mov ebp, eax
cmp ebp, 3
jne 0x402b44
mov eax, dword [0x40e4b8]
xor ecx, ecx
mov cx, word [0x40e460]
sub eax, ecx
cmp eax, 0x1000
jle 0x402b44
dec ebp
cmp word [0x40e4a8], 3
jb 0x402c6c
xor eax, eax
mov ax, word [0x40e4a8]
cmp eax, ebp
jb 0x402c6c
lea eax, [esp + 0x10]
push eax
mov ax, word [0x40e4a8]
sub ax, 3
push eax
mov eax, dword [0x40e4b8]
sub ax, di
dec ax
push eax
call fcn.004044f0
add esp, 0xc
cmp eax, 1
sbb eax, eax
neg eax
test eax, eax
jne 0x402d6c
mov eax, 1
xor ecx, ecx
mov cx, word [0x40e4a8]
sub word [0x40e4a8], 2
sub eax, ecx
add dword [0x40e45c], eax
xor edx, edx
inc dword [0x40e4b8]
mov eax, dword [0x40e4b8]
shl esi, 5
mov ecx, dword [0x40e540]
mov dl, byte [ecx + eax + 2]
mov eax, dword [0x40e530]
xor edx, esi
and edx, 0x7fff
mov cx, word [eax + edx*2]
mov esi, edx
mov edx, dword [0x40e4b8]
mov eax, dword [0x40e40c]
and edx, 0x7fff
mov word [eax + edx*2], cx
mov edx, dword [0x40e4b8]
mov ecx, dword [0x40e530]
mov word [ecx + esi*2], dx
dec word [0x40e4a8]
jne 0x402bb2
xor ebx, ebx
mov ebp, 2
inc dword [0x40e4b8]
cmp dword [esp + 0x10], ebx
je 0x402d09
mov eax, 0
cmp dword [0x40e458], ebx
jl 0x402c3c
mov eax, dword [0x40e540]
add eax, dword [0x40e458]
push 0
mov ecx, dword [0x40e4b8]
sub ecx, dword [0x40e458]
push ecx
push eax
call fcn.004053b0
add esp, 0xc
test ax, ax
jne 0x402dad
mov eax, dword [0x40e4b8]
mov dword [0x40e458], eax
jmp 0x402d09
test ebx, ebx
je 0x402cf8
lea eax, [esp + 0x10]
mov ecx, dword [0x40e540]
push eax
mov edx, dword [0x40e4b8]
movzx ax, byte [ecx + edx - 1]
push eax
push 0
call fcn.004044f0
add esp, 0xc
cmp eax, 1
sbb eax, eax
neg eax
test eax, eax
jne 0x402d78
cmp dword [esp + 0x10], 0
je 0x402cf0
cmp dword [0x40e458], 0
mov eax, 0
jl 0x402cc5
mov eax, dword [0x40e540]
add eax, dword [0x40e458]
push 0
mov ecx, dword [0x40e4b8]
sub ecx, dword [0x40e458]
push ecx
push eax
call fcn.004053b0
add esp, 0xc
test ax, ax
jne 0x402dad
mov eax, dword [0x40e4b8]
mov dword [0x40e458], eax
inc dword [0x40e4b8]
jmp 0x402d03
mov ebx, 1
add dword [0x40e4b8], ebx
dec dword [0x40e45c]
cmp dword [0x40e45c], 0x106
jge 0x402d23
cmp dword [0x40e478], 0
jne 0x402d23
call fcn.00402520
cmp dword [0x40e45c], 0
jne 0x402a87
test ebx, ebx
je 0x402d56
lea eax, [esp + 0x10]
mov edx, dword [0x40e540]
push eax
mov ecx, dword [0x40e4b8]
movzx ax, byte [edx + ecx - 1]
push eax
push 0
call fcn.004044f0
add esp, 0xc
cmp dword [0x40e458], 0
jl 0x402d84
mov eax, dword [0x40e540]
add eax, dword [0x40e458]
jmp 0x402d86
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 [0x40e4b8]
sub ecx, dword [0x40e458]
push ecx
push eax
call fcn.004053b0
add esp, 0xc
test ax, ax
jne 0x402dad
xor ax, ax
mov word [0x40e404], si
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret