Function at 0x40c030
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a4
call fcn.0040ca70
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15b8]
lea eax, [esp + 0x20]
push 0x84
push 0
push eax
call fcn.0040cbc0
add esp, 0xc
cmp dword [esp + 0x15c0], 0
je 0x40c0e8
test esi, esi
mov ecx, esi
jle 0x40c85e
xor eax, eax
cmp ecx, 1
je 0x40c0b8
mov ecx, dword [esp + 0x15b8]
and ecx, 0x7ffffffe
lea eax, [ebx + ebx*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x20]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x20]
add eax, 2
cmp ecx, eax
jne 0x40c0a0
mov ecx, dword [esp + 0x15b8]
test cl, 1
je 0x40c85e
lea ecx, [ebx + ebx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15b8]
inc dword [esp + eax*4 + 0x20]
jmp 0x40c85e
lea eax, [ebx + ebx*8]
mov dword [esp + 0x18], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x14], eax
jle 0x40c1ed
cmp esi, 1
jne 0x40c40b
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15b8]
test cl, 1
je 0x40c141
mov ecx, dword [esp + 0x14]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c141
mov word [esp + ebx*4 + 0x4a4], cx
mov word [esp + ebx*4 + 0x4a6], ax
inc ebx
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.0040cbc0
add esp, 0xc
test ebx, ebx
sete al
je 0x40c204
mov byte [esp], al
xor ecx, ecx
cmp ebx, 1
je 0x40c1bf
mov edx, ebx
and edx, 0xfffffffe
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esp + ecx*4 + 0x4a4]
movzx esi, al
inc dword [esp + esi*4 + 0x924]
shr eax, 8
inc dword [esp + eax*4 + 0xd24]
movzx eax, word [esp + ecx*4 + 0x4a8]
movzx esi, al
inc dword [esp + esi*4 + 0x924]
shr eax, 8
inc dword [esp + eax*4 + 0xd24]
add ecx, 2
cmp edx, ecx
jne 0x40c180
test bl, 1
je 0x40c1e0
movzx ecx, word [esp + ecx*4 + 0x4a4]
movzx edx, cl
inc dword [esp + edx*4 + 0x924]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd24]
mov ecx, dword [esp + 0xd24]
movzx eax, byte [esp]
jmp 0x40c20a
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.0040cbc0
add esp, 0xc
xor ebx, ebx
mov al, 1
xor ecx, ecx
mov dword [esp + 0xc], edi
xor edx, edx
mov esi, 3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + esi*4 + 0x98], edx
add edx, dword [esp + esi*4 + 0x918]
mov dword [esp + esi*4 + 0x9c], edx
add edx, dword [esp + esi*4 + 0x91c]
mov dword [esp + esi*4 + 0xa0], edx
add edx, dword [esp + esi*4 + 0x920]
mov dword [esp + esi*4 + 0xa4], edx
add edx, dword [esp + esi*4 + 0x924]
add esi, 4
cmp esi, 0x103
jne 0x40c220
mov byte [esp], al
test al, al
jne 0x40c2a6
xor edx, edx
nop
nop
nop
nop
movzx eax, byte [esp + edx*4 + 0x4a4]
mov esi, dword [esp + eax*4 + 0xa4]
lea edi, [esi + 1]
mov dword [esp + eax*4 + 0xa4], edi
mov eax, dword [esp + edx*4 + 0x4a4]
mov dword [esp + esi*4 + 0x1124], eax
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
cmp edx, ebx
jb 0x40c270
cmp ecx, ebx
jne 0x40c2be
lea edi, [esp + 0x1124]
test ebx, ebx
jne 0x40c368
jmp 0x40c737
xor ecx, ecx
mov edx, 3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x98], ecx
add ecx, dword [esp + edx*4 + 0xd18]
mov dword [esp + edx*4 + 0x9c], ecx
add ecx, dword [esp + edx*4 + 0xd1c]
mov dword [esp + edx*4 + 0xa0], ecx
add ecx, dword [esp + edx*4 + 0xd20]
mov dword [esp + edx*4 + 0xa4], ecx
add ecx, dword [esp + edx*4 + 0xd24]
add edx, 4
cmp edx, 0x103
jne 0x40c2d0
cmp byte [esp], 0
jne 0x40c359
xor eax, eax
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x1124]
movzx ecx, ch
mov edx, dword [esp + ecx*4 + 0xa4]
lea esi, [edx + 1]
mov dword [esp + ecx*4 + 0xa4], esi
mov ecx, dword [esp + eax*4 + 0x1124]
mov dword [esp + edx*4 + 0x4a4], ecx
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, ebx
jb 0x40c320
lea edi, [esp + 0x4a4]
test ebx, ebx
je 0x40c737
cmp ebx, 1
jne 0x40c377
mov word [edi], 1
jmp 0x40c608
movzx eax, word [edi + 4]
add word [edi], ax
cmp ebx, 3
jl 0x40c475
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov dword [esp + 4], ecx
xor edx, edx
mov esi, 1
jmp 0x40c3be
movzx ecx, word [edi + edx*4]
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
mov ecx, dword [esp + 4]
add ecx, esi
inc ecx
inc esi
cmp ecx, 1
je 0x40c48b
movzx ecx, word [edi + edx*4]
cmp eax, ebx
jge 0x40c3cf
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x40c3e0
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
cmp eax, ebx
jge 0x40c3a0
jmp 0x40c3e9
inc eax
mov word [edi + esi*4], bp
cmp eax, ebx
jge 0x40c3a0
cmp edx, esi
jge 0x40c400
movzx ecx, word [edi + edx*4]
movzx ebp, word [edi + eax*4]
cmp cx, bp
jb 0x40c3a4
jmp 0x40c404
movzx ebp, word [edi + eax*4]
inc eax
add word [edi + esi*4], bp
jmp 0x40c3ad
mov ecx, esi
and ecx, 0x7ffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c43b
add eax, 2
cmp ecx, eax
je 0x40c10f
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c456
mov word [esp + ebx*4 + 0x4a4], si
mov word [esp + ebx*4 + 0x4a6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c430
mov word [esp + ebx*4 + 0x4a4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4a6], si
inc ebx
jmp 0x40c430
mov ecx, ebx
not ecx
and ecx, 2
mov eax, ebx
and eax, 0xfffffffd
sub eax, ecx
mov word [edi + eax*4], 0
jmp 0x40c4f9
mov ecx, ebx
not ecx
and ecx, 2
mov eax, ebx
and eax, 0x7ffffffd
sub eax, ecx
mov word [edi + eax*4], 0
lea edx, [ebx - 3]
mov ecx, edx
test bl, 1
je 0x40c4c2
movzx ecx, word [edi + ebx*4 - 0xc]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + ebx*4 - 0xc], cx
lea ecx, [edx + edx]
sub ecx, ebx
add ecx, 2
test edx, edx
je 0x40c4f9
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + ecx*4]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + ecx*4], dx
mov edx, ecx
not edx
lea edx, [edx + ecx*2]
movzx esi, word [edi + edx*4]
movzx esi, word [edi + esi*4]
inc esi
mov word [edi + edx*4], si
add edx, edx
sub edx, ecx
mov ecx, edx
jns 0x40c4d0
mov esi, edi
lea ecx, [ebx - 1]
mov edi, 1
xor edx, edx
mov dword [esp], esi
jmp 0x40c520
lea edi, [ebp*2]
inc edx
test ebp, ebp
je 0x40c5fd
test eax, eax
mov dword [esp + 8], edi
js 0x40c550
lea ebp, [eax + 1]
xor esi, esi
nop
nop
nop
mov edi, ebp
mov ebp, dword [esp]
movzx ebp, word [ebp + eax*4]
cmp edx, ebp
jne 0x40c560
inc esi
dec eax
mov ebp, edi
cmp edi, esi
jne 0x40c530
mov eax, 0xffffffff
jmp 0x40c562
xor ebp, ebp
jmp 0x40c566
mov ebp, esi
mov edi, dword [esp + 8]
mov esi, edi
sub esi, ebp
jle 0x40c510
and esi, 3
mov dword [esp + 0x10], ebp
je 0x40c5ac
mov edi, esi
lea esi, [ecx + ecx]
xor ebp, ebp
mov dword [esp + 4], edi
mov edi, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + esi*2], dx
inc ebp
add esi, 0xfffffffe
cmp dword [esp + 4], ebp
jne 0x40c590
mov esi, dword [esp + 8]
sub esi, ebp
sub ecx, ebp
mov ebp, dword [esp + 0x10]
jmp 0x40c5ae
mov esi, edi
mov edi, ebp
sub ebp, dword [esp + 8]
cmp ebp, 0xfffffffc
mov ebp, edi
ja 0x40c510
mov edi, dword [esp]
lea ebp, [ecx*2 - 2]
neg ecx
nop
nop
nop
nop
nop
mov word [edi + ebp*2 + 4], dx
mov word [edi + ebp*2], dx
mov word [edi + ebp*2 - 4], dx
mov word [edi + ebp*2 - 8], dx
add esi, 0xfffffffc
add ecx, 4
add ebp, 0xfffffff8
cmp esi, dword [esp + 0x10]
jg 0x40c5d0
neg ecx
mov ebp, dword [esp + 0x10]
jmp 0x40c510
test ebx, ebx
mov edi, dword [esp]
jle 0x40c737
lea edx, [ebx - 1]
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40c64a
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x20]
add ecx, 4
cmp edx, ecx
jne 0x40c620
test eax, eax
je 0x40c66d
lea ecx, [edi + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x20]
inc edx
cmp eax, edx
jne 0x40c660
cmp ebx, 2
jl 0x40c737
mov edx, dword [esp + 0x15bc]
cmp edx, 0x20
jge 0x40c6ec
mov eax, dword [esp + edx*4 + 0x20]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40c6ac
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
inc ecx
mov dword [esp + esi*4 + 0x20], eax
dec edx
jne 0x40c6a0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x40c6e8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x28]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x30]
add ecx, 4
mov dword [esp + edx*4 + 0x20], eax
cmp ecx, 0x20
jne 0x40c6c0
test edx, edx
jle 0x40c727
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 + 0x1c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40c700
mov edx, 1
mov ecx, dword [esp + 0x15bc]
shl edx, cl
cmp eax, edx
jne 0x40c9ad
jmp 0x40c737
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40c9ad
mov ebp, edi
mov edi, dword [esp + 0x18]
shl edi, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cbc0
add esp, 0xc
mov eax, dword [esp + 0x14]
add eax, esi
add eax, 0x8852
mov esi, edi
mov edi, ebp
push 0x240
push 0
push eax
call fcn.0040cbc0
add esp, 0xc
cmp dword [esp + 0x15bc], 0
jle 0x40c84f
add edi, 0xfffffffe
mov eax, 1
add esi, dword [esp + 0xc]
mov dword [esp], edi
jmp 0x40c7b2
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15bc]
mov eax, ecx
je 0x40c84f
mov ecx, dword [esp + eax*4 + 0x20]
test ecx, ecx
jle 0x40c7a0
mov edx, ecx
and edx, 3
je 0x40c800
mov dword [esp + 4], ecx
lea ebp, [edi + ebx*4]
mov edi, esi
xor esi, esi
nop
nop
nop
nop
movzx ecx, word [ebp]
mov byte [ecx + edi + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x40c7d0
sub ebx, esi
mov ecx, dword [esp + 4]
mov edx, ecx
sub edx, esi
mov esi, edi
mov edi, dword [esp]
cmp ecx, 4
jb 0x40c7a0
jmp 0x40c807
mov edx, ecx
cmp ecx, 4
jb 0x40c7a0
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 0xc]
add ebx, 0xfffffffc
mov byte [ecx + esi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x40c810
jmp 0x40c7a0
mov ecx, dword [esp + 0x15b8]
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x928], 0
mov eax, dword [esp + 0x15bc]
cmp eax, 2
jl 0x40c8df
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40c886
xor eax, eax
mov edx, 2
jmp 0x40c8c6
mov esi, ebx
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x92c], eax
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
add edx, 2
cmp ebx, edx
jne 0x40c8a0
add edx, 2
mov ebx, esi
test cl, 1
mov ecx, dword [esp + 0x15b8]
je 0x40c8df
add eax, dword [esp + edx*4 + 0x1c]
add eax, eax
mov dword [esp + edx*4 + 0x924], eax
test ecx, ecx
jle 0x40c9a2
xor eax, eax
lea esi, [ebx + ebx*8]
mov edx, esi
shl edx, 5
add edx, edi
shl esi, 6
add esi, edi
mov dword [esp], esi
jmp 0x40c91b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15b8]
inc eax
cmp eax, ecx
je 0x40c9a2
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40c912
mov ecx, dword [esp + ebx*4 + 0x924]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x924], edi
xor edi, edi
cmp bl, 4
jb 0x40c97f
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 0x40c950
and ebx, 3
je 0x40c900
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 0x40c990
jmp 0x40c900
add esp, 0x15a4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15bc]
dec dword [esp + ecx*4 + 0x20]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40c9d8
mov esi, dword [esp + ecx*4 + 0x1c]
dec ecx
test esi, esi
je 0x40c9c0
dec esi
mov dword [esp + ecx*4 + 0x20], esi
add dword [esp + ecx*4 + 0x24], 2
dec eax
cmp eax, edx
jne 0x40c9ad
jmp 0x40c737