Function at 0x40be60
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a0
call fcn.0040c7e0
mov ebp, edx
mov edi, ecx
mov esi, dword [esp + 0x15b4]
lea eax, [esp + 0x1c]
push 0x84
push 0
push eax
call fcn.0040c900
add esp, 0xc
cmp dword [esp + 0x15bc], 0
je 0x40bf1e
test esi, esi
mov ecx, esi
jle 0x40c33b
xor eax, eax
cmp ecx, 1
je 0x40bee8
mov ecx, dword [esp + 0x15b4]
and ecx, 0x7ffffffe
lea eax, [ebp*8]
add eax, ebp
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x1c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x1c]
add eax, 2
cmp ecx, eax
jne 0x40bed0
mov ecx, dword [esp + 0x15b4]
test cl, 1
je 0x40c33b
lea ecx, [ebp*8]
add ecx, ebp
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15b4]
inc dword [esp + eax*4 + 0x1c]
jmp 0x40c33b
mov dword [esp + 8], edi
mov dword [esp + 0x14], ebp
lea ebp, [ebp + ebp*8]
mov ecx, ebp
shl ecx, 6
test esi, esi
mov dword [esp + 0x10], ecx
jle 0x40c032
mov eax, dword [esp + 8]
add eax, ecx
add eax, 0x8192
xor ecx, ecx
xor ebx, ebx
jmp 0x40bf5f
add ecx, 0xd1c6b3b7
cmp ecx, dword [esp + 0x15b4]
jge 0x40bf80
movzx edx, word [eax + ecx*2]
test dx, dx
je 0x40bf50
mov word [esp + ebx*4 + 0xd20], dx
mov word [esp + ebx*4 + 0xd22], cx
add ebx, 0x28fe5b41
jmp 0x40bf50
lea eax, [esp + 0x520]
push 0x800
push 0
push eax
call fcn.0040c900
add esp, 0xc
test ebx, ebx
sete al
je 0x40c049
mov byte [esp], al
xor ecx, ecx
cmp ebx, 1
je 0x40c007
mov edx, ebx
and edx, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esp + ecx*4 + 0xd20]
movzx esi, al
add dword [esp + esi*4 + 0x520], 0x474ff94f
shr eax, 8
inc dword [esp + eax*4 + 0x920]
movzx eax, word [esp + ecx*4 + 0xd24]
movzx esi, al
add dword [esp + esi*4 + 0x520], 0x474ff94f
shr eax, 8
inc dword [esp + eax*4 + 0x920]
add ecx, 2
cmp edx, ecx
jne 0x40bfc0
test bl, 1
je 0x40c02c
movzx eax, word [esp + ecx*4 + 0xd20]
movzx ecx, al
add dword [esp + ecx*4 + 0x520], 0x474ff94f
shr eax, 8
inc dword [esp + eax*4 + 0x920]
movzx eax, byte [esp]
jmp 0x40c04d
lea eax, [esp + 0x520]
push 0x800
push 0
push eax
call fcn.0040c900
add esp, 0xc
xor ebx, ebx
mov al, 1
xor ecx, ecx
mov edx, 3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x1194], ecx
add ecx, dword [esp + edx*4 + 0x514]
mov dword [esp + edx*4 + 0x1198], ecx
add ecx, dword [esp + edx*4 + 0x518]
mov dword [esp + edx*4 + 0x119c], ecx
add ecx, dword [esp + edx*4 + 0x51c]
mov dword [esp + edx*4 + 0x11a0], ecx
add ecx, dword [esp + edx*4 + 0x520]
add edx, 4
cmp edx, 0x103
jne 0x40c060
test al, al
je 0x40c0b0
test ebx, ebx
jg 0x40c107
jmp 0x40c20e
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, byte [esp + eax*4 + 0xd20]
mov edx, dword [esp + ecx*4 + 0x11a0]
mov esi, edx
mov edi, dword [esp + eax*4 + 0xd20]
mov dword [esp + edx*4 + 0xa0], edi
and edx, 1
xor esi, 1
lea edx, [esi + edx*2]
mov dword [esp + ecx*4 + 0x11a0], edx
inc eax
cmp ebx, eax
jne 0x40c0c0
cmp ebx, 1
jne 0x40c465
mov word [esp + 0xa0], 1
lea edx, [ebx - 1]
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40c157
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
movzx esi, word [esp + ecx*4 + 0xa0]
inc dword [esp + esi*4 + 0x1c]
movzx esi, word [esp + ecx*4 + 0xa4]
inc dword [esp + esi*4 + 0x1c]
movzx esi, word [esp + ecx*4 + 0xa8]
inc dword [esp + esi*4 + 0x1c]
movzx esi, word [esp + ecx*4 + 0xac]
inc dword [esp + esi*4 + 0x1c]
add ecx, 4
cmp edx, ecx
jne 0x40c120
test eax, eax
je 0x40c17d
lea ecx, [esp + ecx*4]
add ecx, 0xa0
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x1c]
inc edx
cmp eax, edx
jne 0x40c170
cmp ebx, 2
jl 0x40c20e
mov edx, dword [esp + 0x15b8]
cmp edx, 0x1f
jg 0x40c1ba
lea eax, [edx + 1]
mov ecx, dword [esp + edx*4 + 0x1c]
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x1c]
mov dword [esp + edx*4 + 0x1c], ecx
add eax, 0xe2cc176d
cmp eax, 0x21
jl 0x40c1a0
test edx, edx
jle 0x40c70f
mov esi, edx
not esi
xor eax, eax
mov dword [esp], esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, edx
and edi, dword [esp]
mov ecx, esi
and ecx, dword [esp + 0x15b8]
sub ecx, edi
mov edi, dword [esp + edx*4 + 0x1c]
shl edi, cl
mov ecx, edi
and ecx, eax
xor edi, eax
lea eax, [edi + ecx*2]
inc esi
cmp edx, 1
lea edx, [edx - 1]
ja 0x40c1d0
mov edx, 1
mov ecx, dword [esp + 0x15b8]
shl edx, cl
cmp eax, edx
jne 0x40c71a
shl ebp, 5
mov esi, dword [esp + 8]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040c900
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040c900
add esp, 0xc
mov edx, dword [esp + 0x15b8]
test edx, edx
jle 0x40c32c
mov ecx, 1
add ebp, dword [esp + 8]
jmp 0x40c27d
lea eax, [ecx + 1]
cmp ecx, edx
mov ecx, eax
je 0x40c32c
mov eax, dword [esp + ecx*4 + 0x1c]
test eax, eax
jle 0x40c270
mov esi, eax
and esi, 3
je 0x40c2d0
mov dword [esp], eax
lea eax, [esp + 0x9e]
lea eax, [eax + ebx*4]
xor edi, edi
nop
nop
nop
nop
nop
movzx edx, word [eax]
mov byte [edx + ebp + 0x8f12], cl
inc edi
add eax, 0xfffffffc
cmp esi, edi
jne 0x40c2a0
sub ebx, edi
mov eax, dword [esp]
mov esi, eax
sub esi, edi
mov edx, dword [esp + 0x15b8]
cmp eax, 4
jb 0x40c270
jmp 0x40c2d7
mov esi, eax
cmp eax, 4
jb 0x40c270
dec esi
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esp + ebx*4 + 0x9e]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [esp + ebx*4 + 0x9a]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [esp + ebx*4 + 0x96]
mov byte [eax + ebp + 0x8f12], cl
movzx eax, word [esp + ebx*4 + 0x92]
add ebx, 0xfffffffc
mov byte [eax + ebp + 0x8f12], cl
add esi, 0xfffffffc
cmp esi, 0xfffffffe
jb 0x40c2e0
jmp 0x40c270
mov ecx, dword [esp + 0x15b4]
mov edi, dword [esp + 8]
mov ebp, dword [esp + 0x14]
mov dword [esp + 0x524], 0
mov eax, dword [esp + 0x15b8]
cmp eax, 2
jl 0x40c3ad
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40c363
xor eax, eax
mov edx, 2
jmp 0x40c394
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x20]
add eax, eax
mov dword [esp + edx*4 + 0x528], eax
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
add edx, 2
cmp ebx, edx
jne 0x40c370
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15b4]
je 0x40c3ad
add eax, dword [esp + edx*4 + 0x18]
add eax, eax
mov dword [esp + edx*4 + 0x520], eax
test ecx, ecx
jle 0x40c45a
xor eax, eax
lea edx, [ebp*8]
add edx, ebp
mov esi, edx
shl esi, 5
add esi, edi
mov dword [esp], esi
shl edx, 6
add edx, edi
mov dword [esp + 4], edx
jmp 0x40c3f8
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15b4]
inc eax
cmp eax, ecx
je 0x40c45a
mov edx, dword [esp]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c3f3
mov edx, dword [esp + ebx*4 + 0x520]
lea ecx, [edx + 1]
mov dword [esp + ebx*4 + 0x520], ecx
xor edi, edi
cmp ebx, 1
je 0x40c44d
mov ebp, ebx
and ebp, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, edx
shr edi, 1
mov esi, edx
and esi, 1
add esi, esi
lea ecx, [esi + ecx*4]
and edi, 1
or edi, ecx
shr edx, 2
mov ecx, edi
add ebp, 0xfffffffe
jne 0x40c430
test bl, 1
je 0x40c3e0
and edx, 1
lea edi, [edx + edi*2]
jmp 0x40c3e0
add esp, 0x15a0
pop esi
pop edi
pop ebx
pop ebp
ret
movzx eax, word [esp + 0xa4]
add word [esp + 0xa0], ax
lea eax, [ebx - 1]
mov dword [esp + 0xc], eax
cmp eax, 2
jl 0x40c53b
mov ecx, 2
mov eax, 2
sub eax, ebx
mov dword [esp], eax
xor esi, esi
mov edi, 1
jmp 0x40c4bd
movzx eax, word [esp + ecx*4 + 0xa0]
inc ecx
add word [esp + edi*4 + 0xa0], ax
mov eax, dword [esp]
add eax, edi
inc eax
inc edi
cmp eax, 1
je 0x40c53b
movzx eax, word [esp + esi*4 + 0xa0]
cmp ecx, ebx
jge 0x40c4d6
movzx edx, word [esp + ecx*4 + 0xa0]
cmp ax, dx
jae 0x40c510
mov word [esp + edi*4 + 0xa0], ax
mov word [esp + esi*4 + 0xa0], di
inc esi
cmp ecx, ebx
jge 0x40c51d
cmp esi, edi
jge 0x40c4a0
movzx edx, word [esp + esi*4 + 0xa0]
movzx eax, word [esp + ecx*4 + 0xa0]
cmp dx, ax
jae 0x40c4a8
jmp 0x40c525
inc ecx
mov word [esp + edi*4 + 0xa0], dx
cmp ecx, ebx
jl 0x40c4eb
movzx edx, word [esp + esi*4 + 0xa0]
add word [esp + edi*4 + 0xa0], dx
mov word [esp + esi*4 + 0xa0], di
inc esi
jmp 0x40c4b1
mov eax, ebx
not eax
and eax, 2
mov ecx, ebx
and ecx, 0xfffffffd
sub ecx, eax
mov word [esp + ecx*4 + 0xa0], 0
mov esi, ebx
add esi, 0xfffffffd
js 0x40c60c
mov edi, ebx
and edi, 3
xor edi, 2
mov edx, esi
je 0x40c58d
mov edx, esi
nop
nop
nop
nop
movzx eax, word [esp + edx*4 + 0xa0]
movzx eax, word [esp + eax*4 + 0xa0]
inc eax
mov word [esp + edx*4 + 0xa0], ax
dec edx
dec edi
jne 0x40c570
cmp esi, 3
jb 0x40c60c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esp + edx*4 + 0xa0]
movzx eax, word [esp + eax*4 + 0xa0]
inc eax
mov word [esp + edx*4 + 0xa0], ax
movzx eax, word [esp + edx*4 + 0x9c]
movzx eax, word [esp + eax*4 + 0xa0]
inc eax
mov word [esp + edx*4 + 0x9c], ax
movzx eax, word [esp + edx*4 + 0x98]
movzx eax, word [esp + eax*4 + 0xa0]
inc eax
mov word [esp + edx*4 + 0x98], ax
movzx eax, word [esp + edx*4 + 0x94]
movzx eax, word [esp + eax*4 + 0xa0]
inc eax
mov word [esp + edx*4 + 0x94], ax
add edx, 0xfffffffc
cmp edx, 0xffffffff
jne 0x40c5a0
mov esi, 1
xor edx, edx
mov edi, dword [esp + 0xc]
mov dword [esp + 4], ebp
jmp 0x40c62c
lea esi, [eax + eax]
inc edx
test eax, eax
je 0x40c0a7
test ecx, ecx
mov dword [esp], esi
js 0x40c660
lea eax, [ecx + 1]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, eax
movzx eax, word [esp + ecx*4 + 0xa0]
cmp edx, eax
jne 0x40c670
inc esi
dec ecx
mov eax, ebp
cmp ebp, esi
jne 0x40c640
mov ecx, 0xffffffff
jmp 0x40c672
xor eax, eax
sub esi, eax
jle 0x40c620
jmp 0x40c67d
mov eax, esi
mov ebp, dword [esp + 4]
mov esi, dword [esp]
sub esi, eax
jle 0x40c620
and esi, 3
je 0x40c6be
mov dword [esp + 0x18], eax
mov dword [esp + 0xc], edi
lea eax, [esp + edi*4]
add eax, 0xa0
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax], dx
inc edi
add eax, 0xfffffffc
cmp esi, edi
jne 0x40c6a0
mov esi, dword [esp]
sub esi, edi
mov eax, dword [esp + 0xc]
sub eax, edi
mov edi, eax
mov eax, dword [esp + 0x18]
jmp 0x40c6c1
mov esi, dword [esp]
mov ebp, eax
sub eax, dword [esp]
cmp eax, 0xfffffffc
mov eax, ebp
mov ebp, dword [esp + 4]
ja 0x40c620
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esp + edi*4 + 0xa0], dx
mov word [esp + edi*4 + 0x9c], dx
mov word [esp + edi*4 + 0x98], dx
mov word [esp + edi*4 + 0x94], dx
add edi, 0xfffffffc
add esi, 0xfffffffc
cmp esi, eax
jg 0x40c6e0
jmp 0x40c620
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15b8]
add ecx, 0x719ba20
jmp 0x40c749
dec edi
mov dword [esp + esi*4 - 0x1c66e868], edi
add dword [esp + esi*4 - 0x1c66e864], 2
dec eax
cmp eax, edx
je 0x40c20e
mov esi, dword [esp + 0x15b8]
dec dword [esp + esi*4 + 0x1c]
cmp esi, 2
jl 0x40c740
mov esi, ecx
nop
nop
nop
nop
nop
mov edi, dword [esp + esi*4 - 0x1c66e868]
test edi, edi
jne 0x40c730
add esi, 0xf8e645df
cmp esi, 0x719ba21
jg 0x40c760
jmp 0x40c740