Function at 0x40c430
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.0040ce40
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.0040cf60
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x18], ebx
je 0x40c4fc
test esi, esi
mov ecx, esi
mov ebx, dword [esp + 0x15c8]
jle 0x40cc4a
xor eax, eax
cmp ecx, 1
je 0x40c4c8
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x40c4b0
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40cc4a
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c4]
inc dword [esp + eax*4 + 0x2c]
jmp 0x40cc4a
lea eax, [ebx + ebx*8]
mov dword [esp + 0x10], eax
mov ebp, eax
shl ebp, 6
test esi, esi
mov dword [esp + 0x14], edi
jle 0x40c5f9
cmp esi, 1
jne 0x40c819
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40c550
lea ecx, [edi + ebp]
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40c550
mov word [esp + ebx*4 + 0xb0], cx
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040cf60
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x40c610
xor eax, eax
cmp ebx, 1
je 0x40c5cf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
add eax, 2
cmp ecx, eax
jne 0x40c590
test bl, 1
je 0x40c5f0
movzx eax, word [esp + eax*4 + 0xb0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x530]
shr eax, 8
inc dword [esp + eax*4 + 0x930]
mov eax, dword [esp + 0x930]
jmp 0x40c619
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.0040cf60
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
mov dword [esp + 0x24], ebp
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp], ebx
mov edx, ebx
and edx, 0xfffffffe
lea eax, [esp + 0xb0]
mov dword [esp + 8], eax
lea eax, [esp + 0x1130]
xor ecx, ecx
xor edi, edi
mov dword [esp + 0xc], edx
jmp 0x40c674
mov edi, dword [esp + 0x20]
inc edi
add ecx, 8
mov eax, esi
cmp edi, dword [esp + 0x28]
je 0x40c75e
mov esi, dword [esp + 8]
mov dword [esp + 8], eax
mov dword [esp + 0x20], edi
mov eax, edi
shl eax, 0xa
add eax, esp
add eax, 0x530
xor ebp, ebp
xor edx, edx
mov dword [esp + edx*4 + 0xd30], ebp
add ebp, dword [eax + edx*4]
mov ebx, edx
and ebx, 1
xor edx, 1
lea edx, [edx + ebx*2]
cmp edx, 0x100
jb 0x40c690
cmp byte [esp + 7], 0
jne 0x40c660
cmp dword [esp + 0x1c], 0
je 0x40c729
xor eax, eax
mov edi, dword [esp + 8]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [esi + eax*4]
mov dword [edi + ebx*4], edx
movzx edx, word [esi + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [esi + eax*4 + 4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 0xc]
add eax, 2
cmp edx, eax
jne 0x40c6d0
test byte [esp], 1
je 0x40c660
jmp 0x40c735
xor eax, eax
test byte [esp], 1
je 0x40c660
movzx edx, word [esi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov eax, dword [esi + eax*4]
mov edi, dword [esp + 8]
mov dword [edi + ebx*4], eax
jmp 0x40c660
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 8]
je 0x40cb32
mov edx, dword [esp]
cmp edx, 1
jne 0x40c789
mov word [edi], 1
jmp 0x40ca17
movzx eax, word [edi + 4]
add word [edi], ax
cmp edx, 3
jl 0x40c875
mov eax, 2
mov ecx, 2
sub ecx, edx
xor edx, edx
mov esi, 1
jmp 0x40c7cb
movzx ebx, word [edi + eax*4]
inc eax
add word [edi + esi*4], bx
mov ebp, dword [esp + 0x10]
lea ebx, [ecx + esi]
inc ebx
inc esi
cmp ebx, 1
je 0x40c884
movzx ebx, word [edi + edx*4]
cmp eax, dword [esp]
jge 0x40c7dd
movzx ebp, word [edi + eax*4]
cmp bx, bp
jae 0x40c800
mov word [edi + esi*4], bx
mov word [edi + edx*4], si
inc edx
cmp eax, dword [esp]
jge 0x40c80a
cmp edx, esi
jge 0x40c7b0
movzx ebp, word [edi + edx*4]
movzx ebx, word [edi + eax*4]
cmp bp, bx
jae 0x40c7b4
jmp 0x40c80e
inc eax
mov word [edi + esi*4], bp
cmp eax, dword [esp]
jl 0x40c7eb
movzx ebp, word [edi + edx*4]
add word [edi + esi*4], bp
mov word [edi + edx*4], si
inc edx
jmp 0x40c7b9
mov ecx, esi
and ecx, 0x7ffffffe
lea edx, [edi + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40c83b
add eax, 2
cmp ecx, eax
je 0x40c521
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40c856
mov word [esp + ebx*4 + 0xb0], si
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x40c830
mov word [esp + ebx*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], si
inc ebx
jmp 0x40c830
lea ecx, [edx - 2]
mov word [edi + edx*4 - 8], 0
jmp 0x40c901
mov ebx, dword [esp]
mov word [edi + ebx*4 - 8], 0
lea edx, [ebx - 3]
mov ecx, ebx
and ecx, 3
xor ecx, 2
mov eax, edx
je 0x40c8b1
mov eax, edx
nop
movzx esi, word [edi + eax*4]
movzx esi, word [edi + esi*4]
inc esi
mov word [edi + eax*4], si
dec eax
dec ecx
jne 0x40c8a0
lea ecx, [ebx - 2]
cmp edx, 3
jb 0x40c901
inc eax
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4 - 4]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 4], dx
movzx edx, word [edi + eax*4 - 8]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 8], dx
movzx edx, word [edi + eax*4 - 0xc]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 0xc], dx
movzx edx, word [edi + eax*4 - 0x10]
movzx edx, word [edi + edx*4]
inc edx
mov word [edi + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x40c8c0
mov edi, 1
xor edx, edx
mov eax, dword [esp + 0x1c]
jmp 0x40c936
mov edi, esi
and edi, 2
mov ebx, esi
or esi, 2
imul esi, edi
xor edi, 2
and ebx, 0x7ffffffd
imul ebx, edi
add esi, ebx
inc edx
mov edi, esi
test esi, esi
jle 0x40ca02
test ecx, ecx
mov dword [esp + 0xc], edi
js 0x40c970
lea esi, [ecx + 1]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, esi
mov esi, dword [esp + 8]
movzx esi, word [esi + ecx*4]
cmp edx, esi
jne 0x40c980
inc ebx
dec ecx
mov esi, edi
cmp edi, ebx
jne 0x40c950
mov ecx, 0xffffffff
jmp 0x40c982
xor esi, esi
jmp 0x40c986
mov esi, ebx
mov edi, dword [esp + 0xc]
mov ebx, edi
sub ebx, esi
mov edi, dword [esp + 8]
jle 0x40c910
and ebx, 3
je 0x40c9bd
mov dword [esp + 0x20], esi
lea esi, [edi + eax*4]
xor ebp, ebp
nop
nop
mov word [esi], dx
inc ebp
add esi, 0xfffffffc
cmp ebx, ebp
jne 0x40c9a0
mov ebx, dword [esp + 0xc]
sub ebx, ebp
sub eax, ebp
mov ebp, dword [esp + 0x10]
mov esi, dword [esp + 0x20]
jmp 0x40c9c1
mov ebx, dword [esp + 0xc]
mov edi, esi
sub esi, dword [esp + 0xc]
cmp esi, 0xfffffffc
mov esi, edi
mov edi, dword [esp + 8]
ja 0x40c910
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + eax*4], dx
mov word [edi + eax*4 - 4], dx
mov word [edi + eax*4 - 8], dx
mov word [edi + eax*4 - 0xc], dx
add ebx, 0xfffffffc
add eax, 0xfffffffc
cmp ebx, esi
jg 0x40c9e0
jmp 0x40c910
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
mov edi, dword [esp + 8]
jle 0x40cb32
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
jb 0x40ca5a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x40ca30
test eax, eax
je 0x40ca7d
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 + 0x2c]
inc edx
cmp eax, edx
jne 0x40ca70
cmp dword [esp], 2
jl 0x40cb32
cmp ebx, 0x20
jge 0x40caec
mov eax, dword [esp + ebx*4 + 0x2c]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40caac
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + ebx*4 + 0x2c], eax
dec edx
jne 0x40caa0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x40cae8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x3c]
add ecx, 4
mov dword [esp + ebx*4 + 0x2c], eax
cmp ecx, 0x20
jne 0x40cac0
test ebx, ebx
jle 0x40cb22
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x28]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x40cb00
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40cd9d
jmp 0x40cb32
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40cd9d
shl ebp, 5
mov esi, dword [esp + 0x14]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.0040cf60
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.0040cf60
add esp, 0xc
test ebx, ebx
jle 0x40cc3f
add edi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x14]
jmp 0x40cba3
mov esi, dword [esp]
mov dword [esp], esi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40cc3f
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x40cb90
mov edx, ecx
and edx, 3
je 0x40cbf0
mov dword [esp + 0xc], ecx
mov ecx, dword [esp]
lea ebx, [edi + ecx*4]
xor esi, esi
nop
nop
mov ecx, ebp
movzx ebp, word [ebx]
mov byte [ebp + ecx + 0x8f12], al
mov ebp, ecx
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x40cbc0
sub dword [esp], esi
mov ecx, dword [esp + 0xc]
mov edx, ecx
sub edx, esi
mov ebx, dword [esp + 0x15c8]
jmp 0x40cbf2
mov edx, ecx
cmp ecx, 4
mov esi, dword [esp]
jb 0x40cb93
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [edi + esi*4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 8]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [edi + esi*4 - 0xc]
add esi, 0xfffffffc
mov byte [ecx + ebp + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x40cc00
jmp 0x40cb93
mov ecx, dword [esp + 0x15c4]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x40ccbd
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x40cc6b
xor eax, eax
mov edx, 2
jmp 0x40cca4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x53c], eax
add edx, 2
cmp ebx, edx
jne 0x40cc80
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c4]
je 0x40ccbd
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x530], eax
test ecx, ecx
jle 0x40cd92
xor eax, eax
mov edx, dword [esp + 0x18]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, edi
mov dword [esp + 0xc], esi
shl edx, 6
add edx, edi
mov dword [esp + 8], edx
jmp 0x40cd0c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x40cd92
mov edx, dword [esp + 0xc]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x40cd03
mov ecx, dword [esp + ebx*4 + 0x530]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x530], edi
xor edi, edi
cmp bl, 4
jb 0x40cd6f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
mov edx, ecx
and edx, 2
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
or esi, edx
mov edx, ecx
shr edx, 2
and edx, 1
or edx, esi
mov esi, ecx
shr esi, 3
and esi, 1
lea edi, [esi + edx*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x40cd40
and ebx, 3
je 0x40ccf0
nop
nop
nop
nop
nop
nop
nop
nop
mov edx, ecx
and edx, 1
lea edi, [edx + edi*2]
shr ecx, 1
dec ebx
jne 0x40cd80
jmp 0x40ccf0
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x2c]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40cdc8
mov esi, dword [esp + ecx*4 + 0x28]
dec ecx
test esi, esi
je 0x40cdb0
dec esi
mov dword [esp + ecx*4 + 0x2c], esi
add dword [esp + ecx*4 + 0x30], 2
dec eax
cmp eax, edx
jne 0x40cd9d
jmp 0x40cb32