Function at 0x40c0f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.0040cac0
mov edi, edx
mov ebx, ecx
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.0040cbe0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
je 0x40c1a8
test esi, esi
mov ecx, esi
jle 0x40c89f
xor eax, eax
cmp ecx, 1
je 0x40c178
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
lea eax, [edi + edi*8]
shl eax, 5
lea edx, [eax + ebx]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x40c160
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c89f
lea ecx, [edi + edi*8]
shl ecx, 5
add ecx, ebx
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x40c89f
lea eax, [edi + edi*8]
mov dword [esp + 0x1c], eax
shl eax, 6
mov dword [esp + 0x18], eax
test esi, esi
mov dword [esp + 0xc], ebx
mov dword [esp + 0x14], edi
jle 0x40c2ab
cmp esi, 1
jne 0x40c489
xor eax, eax
xor ebp, ebp
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x40c209
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0xc]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c209
mov word [esp + ebp*4 + 0xac], cx
mov word [esp + ebp*4 + 0xae], ax
inc ebp
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040cbe0
add esp, 0xc
test ebp, ebp
sete byte [esp + 7]
je 0x40c2c2
mov ecx, ebp
xor eax, eax
cmp ebp, 1
je 0x40c27f
mov ecx, ebp
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xac]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
add eax, 2
cmp ecx, eax
jne 0x40c240
mov ebx, ebp
test bl, 1
je 0x40c2a2
movzx eax, word [esp + eax*4 + 0xac]
movzx ecx, al
inc dword [esp + ecx*4 + 0x52c]
shr eax, 8
inc dword [esp + eax*4 + 0x92c]
mov eax, dword [esp + 0x92c]
jmp 0x40c2cb
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040cbe0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x20], ecx
lea ebp, [esp + 0xac]
lea edx, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor eax, eax
mov dword [esp], ebx
jmp 0x40c31e
mov eax, dword [esp + 8]
inc eax
add ecx, 8
mov esi, dword [esp + 0x24]
add esi, 0x400
mov edx, edi
cmp eax, dword [esp + 0x20]
je 0x40c3bf
mov dword [esp + 8], eax
mov edi, ebp
mov dword [esp + 0x10], edx
mov edx, 3
xor ebp, ebp
nop
mov dword [esp + edx*4 + 0xd20], ebp
add ebp, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], ebp
add ebp, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], ebp
add ebp, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], ebp
add ebp, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x40c330
mov dword [esp + 0x24], esi
cmp byte [esp + 7], 0
mov ebp, dword [esp + 0x10]
jne 0x40c300
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [edi + edx*4]
shr eax, cl
movzx eax, al
mov esi, edi
mov edi, ebp
mov ebp, dword [esp + eax*4 + 0xd2c]
lea ebx, [ebp + 1]
mov dword [esp + eax*4 + 0xd2c], ebx
mov ebx, dword [esp]
mov eax, dword [esi + edx*4]
mov dword [edi + ebp*4], eax
mov ebp, edi
mov edi, esi
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
cmp edx, ebx
jb 0x40c380
jmp 0x40c300
test ebx, ebx
mov edi, dword [esp + 0x14]
je 0x40c7b7
mov edx, dword [esp]
cmp edx, 1
jne 0x40c3de
mov word [ebp], 1
jmp 0x40c681
movzx eax, word [ebp + 4]
add word [ebp], ax
lea eax, [edx - 1]
cmp eax, 2
jl 0x40c4f5
mov ecx, 2
mov esi, 2
sub esi, edx
mov dword [esp + 8], esi
xor esi, esi
mov edx, 1
jmp 0x40c42c
movzx edi, word [ebx + ecx*4]
inc ecx
add word [ebx + edx*4], di
mov ebp, ebx
mov edi, dword [esp + 8]
add edi, edx
inc edi
inc edx
cmp edi, 1
je 0x40c504
movzx edi, word [ebp + esi*4]
cmp ecx, dword [esp]
mov ebx, ebp
jge 0x40c441
movzx ebp, word [ebx + ecx*4]
cmp di, bp
jae 0x40c470
mov word [ebx + edx*4], di
mov word [ebx + esi*4], dx
inc esi
cmp ecx, dword [esp]
jge 0x40c47a
cmp esi, edx
jge 0x40c410
movzx ebp, word [ebx + esi*4]
movzx edi, word [ebx + ecx*4]
cmp bp, di
jae 0x40c414
jmp 0x40c47e
inc ecx
mov word [ebx + edx*4], bp
cmp ecx, dword [esp]
jl 0x40c44f
movzx ebp, word [ebx + esi*4]
add word [ebx + edx*4], bp
mov word [ebx + esi*4], dx
inc esi
jmp 0x40c419
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea edx, [eax + ebx]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x40c4bb
add eax, 2
cmp ecx, eax
je 0x40c1d3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c4d6
mov word [esp + ebp*4 + 0xac], si
mov word [esp + ebp*4 + 0xae], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x40c4b0
mov word [esp + ebp*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xae], si
inc ebp
jmp 0x40c4b0
lea ecx, [edx - 2]
mov word [ebp + edx*4 - 8], 0
jmp 0x40c5a5
mov edi, dword [esp]
lea ecx, [edi - 2]
mov word [ebp + edi*4 - 8], 0
cmp edi, 3
jl 0x40c5a5
lea esi, [edi - 3]
and edi, 3
xor edi, 2
mov edx, esi
je 0x40c544
mov edx, esi
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [ebp + edx*4]
movzx ebx, word [ebp + ebx*4]
inc ebx
mov word [ebp + edx*4], bx
dec edx
dec edi
jne 0x40c530
cmp esi, 3
jae 0x40c54f
mov ebp, dword [esp + 0x10]
jmp 0x40c5a5
inc edx
mov ebp, dword [esp + 0x10]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + edx*4 - 4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 4], si
movzx esi, word [ebp + edx*4 - 8]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 8], si
movzx esi, word [ebp + edx*4 - 0xc]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 0xc], si
movzx esi, word [ebp + edx*4 - 0x10]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + edx*4 - 0x10], si
add edx, 0xfffffffc
jne 0x40c560
mov esi, 1
xor edx, edx
jmp 0x40c5bc
lea esi, [ebx + ebx]
inc edx
test ebx, ebx
je 0x40c673
test ecx, ecx
mov dword [esp + 8], esi
js 0x40c5f0
lea ebx, [ecx + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
cmp edx, esi
jne 0x40c600
inc edi
dec ecx
cmp ebx, edi
jne 0x40c5d0
mov ecx, 0xffffffff
jmp 0x40c602
xor ebx, ebx
jmp 0x40c606
mov ebx, edi
mov esi, dword [esp + 8]
mov edi, esi
sub edi, ebx
jle 0x40c5b0
and edi, 3
je 0x40c639
lea esi, [eax*4]
add esi, ebp
xor ebp, ebp
nop
nop
nop
nop
mov word [esi], dx
inc ebp
add esi, 0xfffffffc
cmp edi, ebp
jne 0x40c620
mov edi, dword [esp + 8]
sub edi, ebp
sub eax, ebp
mov ebp, dword [esp + 0x10]
jmp 0x40c63b
mov edi, esi
mov esi, ebx
sub esi, dword [esp + 8]
cmp esi, 0xfffffffc
ja 0x40c5b0
nop
nop
nop
nop
nop
nop
mov word [ebp + eax*4], dx
mov word [ebp + eax*4 - 4], dx
mov word [ebp + eax*4 - 8], dx
mov word [ebp + eax*4 - 0xc], dx
add eax, 0xfffffffc
add edi, 0xfffffffc
cmp edi, ebx
jg 0x40c650
jmp 0x40c5b0
cmp dword [esp], 0
mov edi, dword [esp + 0x14]
jle 0x40c7b7
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40c6cb
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x40c6a0
test eax, eax
je 0x40c6ed
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x40c6e0
cmp dword [esp], 2
jl 0x40c7b7
mov edx, dword [esp + 0x15c4]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x40c76c
mov ecx, dword [esp + edx*4 + 0x28]
neg edx
mov esi, dword [esp + 0x15c4]
and edx, 3
je 0x40c72c
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + esi*4 + 0x28], ecx
inc eax
dec edx
jne 0x40c720
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x40c768
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x28], ecx
add ecx, dword [esp + eax*4 + 0x34]
mov dword [esp + edx*4 + 0x28], ecx
add eax, 4
cmp eax, 0x21
jne 0x40c740
test edx, edx
jle 0x40c7a7
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x24]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c780
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp eax, edx
jne 0x40ca1d
jmp 0x40c7b7
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40ca1d
mov esi, dword [esp + 0x1c]
shl esi, 5
mov ebx, dword [esp + 0xc]
lea eax, [ebx + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cbe0
add esp, 0xc
mov eax, dword [esp + 0x18]
add eax, ebx
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cbe0
add esp, 0xc
cmp dword [esp + 0x15c4], 0
jle 0x40c894
mov eax, 1
add esi, dword [esp + 0xc]
jmp 0x40c828
mov ebx, ebp
mov ebp, dword [esp]
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c4]
mov eax, ecx
mov ebp, ebx
je 0x40c894
mov edx, dword [esp + eax*4 + 0x28]
test edx, edx
jle 0x40c810
test dl, 1
jne 0x40c840
mov ecx, edx
jmp 0x40c85c
mov ecx, ebp
mov ebp, dword [esp]
movzx ecx, word [ecx + ebp*4 - 2]
dec ebp
mov dword [esp], ebp
mov byte [ecx + esi + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov ebp, dword [esp]
mov ebx, dword [esp + 0x10]
je 0x40c815
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebx + ebp*4 - 2]
mov byte [edx + esi + 0x8f12], al
movzx edx, word [ebx + ebp*4 - 6]
add ebp, 0xfffffffe
mov byte [edx + esi + 0x8f12], al
add ecx, 0xfffffffe
test ecx, ecx
jg 0x40c870
jmp 0x40c815
mov ecx, dword [esp + 0x15c0]
mov ebx, dword [esp + 0xc]
mov dword [esp + 0x530], 0
mov eax, dword [esp + 0x15c4]
cmp eax, 2
jl 0x40c947
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40c8cb
xor edx, edx
mov eax, 2
jmp 0x40c91e
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], ebx
mov ebx, ecx
and ebx, 0xfffffffe
xor edx, edx
xor eax, eax
nop
nop
nop
nop
mov edi, dword [esp + eax*4 + 0x2c]
mov esi, dword [esp + eax*4 + 0x30]
mov ebp, edi
and ebp, edx
xor edi, edx
add edi, edi
lea edx, [edi + ebp*4]
mov dword [esp + eax*4 + 0x534], edx
mov edi, esi
and edi, edx
xor esi, edx
add esi, esi
lea edx, [esi + edi*4]
mov dword [esp + eax*4 + 0x538], edx
add eax, 2
cmp ebx, eax
jne 0x40c8e0
add eax, 2
mov ebx, dword [esp + 0xc]
mov edi, dword [esp + 0x14]
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40c947
mov ecx, dword [esp + eax*4 + 0x24]
mov esi, ecx
and esi, edx
xor ecx, edx
add ecx, ecx
lea ecx, [ecx + esi*4]
mov dword [esp + eax*4 + 0x52c], ecx
mov ecx, dword [esp + 0x15c0]
test ecx, ecx
jle 0x40ca12
xor eax, eax
lea esi, [edi + edi*8]
mov edx, esi
shl edx, 5
add edx, ebx
shl esi, 6
add esi, ebx
mov dword [esp], esi
jmp 0x40c98b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x40ca12
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c982
mov ecx, dword [esp + ebx*4 + 0x52c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x40c9ef
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x40c9c0
and ebx, 3
je 0x40c970
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x40ca00
jmp 0x40c970
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15c4]
dec dword [esp + ecx*4 + 0x28]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40ca48
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x40ca30
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x40ca1d
jmp 0x40c7b7