Function at 0x40c270
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.0040cbc0
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.0040cd10
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x1c], esi
je 0x40c2f0
test ebx, ebx
jle 0x40c9e6
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, byte [eax + ecx + 0x8f12]
inc dword [esp + edx*4 + 0x28]
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, ebx
jl 0x40c2d0
jmp 0x40c9e6
lea eax, [esi + esi*8]
mov dword [esp + 0x20], eax
shl eax, 6
mov dword [esp + 0x14], eax
test ebx, ebx
mov dword [esp + 0xc], edi
jle 0x40c3e9
cmp ebx, 1
jne 0x40c5cd
xor eax, eax
xor ebp, ebp
test bl, 1
mov ebx, ebp
je 0x40c348
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0xc]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c348
mov word [esp + ebx*4 + 0xac], cx
mov word [esp + ebx*4 + 0xae], ax
inc ebx
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040cd10
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40c400
xor eax, eax
cmp ebx, 1
je 0x40c3bf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
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 0x40c380
test bl, 1
je 0x40c3e0
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 0x40c409
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.0040cd10
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 + 0x24], ecx
lea ebp, [esp + 0xac]
lea edx, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor eax, eax
mov dword [esp], ebx
jmp 0x40c45e
mov eax, dword [esp + 8]
inc eax
add ecx, 8
mov esi, dword [esp + 0x18]
add esi, 0x400
mov edx, edi
cmp eax, dword [esp + 0x24]
je 0x40c4ff
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 0x40c470
mov dword [esp + 0x18], esi
cmp byte [esp + 7], 0
mov ebp, dword [esp + 0x10]
jne 0x40c440
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 0x40c4c0
jmp 0x40c440
test ebx, ebx
mov ebx, dword [esp + 0x15c0]
je 0x40c907
mov edx, dword [esp]
cmp edx, 1
jne 0x40c521
mov word [ebp], 1
jmp 0x40c7cd
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp edx, 3
jl 0x40c635
mov eax, 2
mov ecx, 2
sub ecx, edx
mov dword [esp + 8], ecx
xor edx, edx
mov esi, 1
jmp 0x40c56d
movzx edi, word [ebp + eax*4]
inc eax
add word [ebp + esi*4], di
mov ecx, dword [esp + 8]
lea edi, [ecx + esi]
inc edi
inc esi
cmp edi, 1
je 0x40c644
movzx edi, word [ebp + edx*4]
cmp eax, dword [esp]
jge 0x40c581
movzx ecx, word [ebp + eax*4]
cmp di, cx
jae 0x40c5b0
mov word [ebp + esi*4], di
mov word [ebp + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x40c5bb
cmp edx, esi
jge 0x40c550
movzx ecx, word [ebp + edx*4]
movzx edi, word [ebp + eax*4]
cmp cx, di
jae 0x40c555
jmp 0x40c5c0
inc eax
mov word [ebp + esi*4], cx
cmp eax, dword [esp]
jl 0x40c591
movzx ecx, word [ebp + edx*4]
add word [ebp + esi*4], cx
mov word [ebp + edx*4], si
inc edx
jmp 0x40c55b
mov ecx, ebx
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x14]
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x40c5fb
add eax, 2
cmp ecx, eax
je 0x40c317
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c616
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 0x40c5f0
mov word [esp + ebp*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xae], si
inc ebp
jmp 0x40c5f0
lea eax, [edx - 2]
mov word [ebp + edx*4 - 8], 0
jmp 0x40c6c8
mov eax, dword [esp]
mov word [ebp + eax*4 - 8], 0
lea edx, [eax - 3]
and eax, 3
xor eax, 2
mov ecx, edx
je 0x40c674
mov ecx, edx
nop
nop
nop
movzx esi, word [ebp + ecx*4]
movzx esi, word [ebp + esi*4]
inc esi
mov word [ebp + ecx*4], si
dec ecx
dec eax
jne 0x40c660
mov eax, dword [esp]
add eax, 0xfffffffe
cmp edx, 3
jb 0x40c6c5
inc ecx
movzx edx, word [ebp + ecx*4 - 4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 4], dx
movzx edx, word [ebp + ecx*4 - 8]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 8], dx
movzx edx, word [ebp + ecx*4 - 0xc]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 0xc], dx
movzx edx, word [ebp + ecx*4 - 0x10]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4 - 0x10], dx
add ecx, 0xfffffffc
jne 0x40c680
mov edx, dword [esp]
lea ecx, [edx - 1]
mov edi, 1
xor edx, edx
jmp 0x40c6ec
lea edi, [esi + esi]
inc edx
test esi, esi
jle 0x40c7c3
test eax, eax
mov dword [esp + 8], edi
js 0x40c720
lea esi, [eax + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
mov ebx, esi
movzx esi, word [ebp + eax*4]
cmp edx, esi
jne 0x40c730
dec eax
inc edi
mov esi, ebx
cmp ebx, edi
jne 0x40c700
mov eax, 0xffffffff
jmp 0x40c732
xor esi, esi
sub edi, esi
jle 0x40c6e0
jmp 0x40c741
mov esi, edi
mov ebx, dword [esp + 0x15c0]
mov edi, dword [esp + 8]
sub edi, esi
jle 0x40c6e0
and edi, 3
je 0x40c77d
mov dword [esp + 0x18], esi
lea esi, [ecx*4]
add esi, ebp
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi], dx
inc ebp
add esi, 0xfffffffc
cmp edi, ebp
jne 0x40c760
mov edi, dword [esp + 8]
sub edi, ebp
sub ecx, ebp
mov ebp, dword [esp + 0x10]
mov esi, dword [esp + 0x18]
jmp 0x40c781
mov edi, dword [esp + 8]
mov ebx, esi
sub esi, dword [esp + 8]
cmp esi, 0xfffffffc
mov esi, ebx
mov ebx, dword [esp + 0x15c0]
ja 0x40c6e0
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + ecx*4], dx
mov word [ebp + ecx*4 - 4], dx
mov word [ebp + ecx*4 - 8], dx
mov word [ebp + ecx*4 - 0xc], dx
add ecx, 0xfffffffc
add edi, 0xfffffffc
cmp edi, esi
jg 0x40c7a0
jmp 0x40c6e0
cmp dword [esp], 0
jle 0x40c907
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40c81b
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
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 0x40c7f0
test eax, eax
je 0x40c83d
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 0x40c830
cmp dword [esp], 2
jl 0x40c907
mov edx, dword [esp + 0x15c4]
cmp edx, 0x20
jge 0x40c8bc
mov eax, dword [esp + edx*4 + 0x28]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40c87c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + esi*4 + 0x28], eax
dec edx
jne 0x40c870
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x40c8b8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + edx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x40c890
test edx, edx
jle 0x40c8f7
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 0x40c8d0
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp eax, edx
jne 0x40cb1d
jmp 0x40c907
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40cb1d
mov esi, dword [esp + 0x20]
shl esi, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cd10
add esp, 0xc
mov eax, dword [esp + 0x14]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cd10
add esp, 0xc
cmp dword [esp + 0x15c4], 0
jle 0x40c9e2
mov eax, 1
add esi, dword [esp + 0xc]
jmp 0x40c978
mov edi, ebp
mov ebp, dword [esp]
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c4]
mov eax, ecx
mov ebp, edi
je 0x40c9e2
mov edx, dword [esp + eax*4 + 0x28]
test edx, edx
jle 0x40c960
test dl, 1
jne 0x40c990
mov ecx, edx
jmp 0x40c9b0
mov ebp, dword [esp]
mov ecx, ebp
not ecx
lea ebp, [ecx + ebp*2]
mov dword [esp], ebp
mov ecx, dword [esp + 0x10]
movzx ecx, word [ecx + ebp*4 + 2]
mov byte [ecx + esi + 0x8f12], al
lea ecx, [edx - 1]
cmp edx, 1
mov ebp, dword [esp]
mov edi, dword [esp + 0x10]
je 0x40c965
dec ecx
nop
nop
nop
movzx edx, word [edi + ebp*4 - 2]
mov byte [edx + esi + 0x8f12], al
movzx edx, word [edi + ebp*4 - 6]
mov byte [edx + esi + 0x8f12], al
add ebp, 0xfffffffe
add ecx, 0xfffffffe
jb 0x40c9c0
jmp 0x40c965
mov edi, dword [esp + 0xc]
mov dword [esp + 0x530], 0
mov eax, dword [esp + 0x15c4]
cmp eax, 2
jl 0x40ca5d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40ca13
xor eax, eax
mov edx, 2
test cl, 1
jne 0x40ca50
jmp 0x40ca5d
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x40ca20
add edx, 2
mov ebx, dword [esp + 0x15c0]
test cl, 1
je 0x40ca5d
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ebx, ebx
jle 0x40cb12
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp], ecx
jmp 0x40ca95
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
inc eax
cmp eax, dword [esp + 0x15c0]
je 0x40cb12
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40ca8b
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 0x40caef
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
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 0x40cac0
and ebx, 3
je 0x40ca80
nop
nop
nop
nop
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 0x40cb00
jmp 0x40ca80
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 0x40cb48
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x40cb30
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x40cb1d
jmp 0x40c907