Function at 0x40c9a6
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov esi, edx
xor edi, edi
xor edx, edx
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edx
test ecx, ecx
je 0x40cbbd
mov ebp, dword [ecx + 0x7c]
mov dword [esp + 0x24], ebp
test ebp, ebp
je 0x40cbbd
cmp dword [ebp], edx
jne 0x40c9de
push 0xffffffffffffff9c
jmp 0x40cbbf
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x40cbc0
mov ecx, dword [ebp + 0x5c]
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x14], eax
cmp eax, ecx
jbe 0x40c9fc
mov dword [ebp + 0x14], ecx
mov eax, ecx
test eax, eax
je 0x40cbb9
mov edi, dword [ebp + 8]
test edi, edi
jne 0x40cab6
mov eax, dword [ebp + 0x58]
test eax, eax
je 0x40cab6
mov edx, dword [ebp + 0x68]
mov esi, 0x4000
mov ecx, dword [ebp + 0x60]
cmp eax, esi
push edi
cmovb esi, eax
add edx, dword [ebp + 0x3c]
call fcn.0040bff8
pop ecx
test eax, eax
jne 0x40cbb0
push dword [ebp + 0x60]
mov ecx, dword [ebp]
mov edx, esi
push 1
call fcn.0040c060
pop ecx
pop ecx
cmp eax, 1
jne 0x40cbb0
add dword [ebp + 0x3c], esi
mov edi, esi
sub dword [ebp + 0x58], esi
cmp byte [ebp + 0x6c], 0
mov ecx, dword [ebp]
mov dword [esp + 0x20], ecx
mov dword [ebp + 4], ecx
mov dword [ebp + 8], esi
je 0x40cab6
and dword [esp + 0x1c], 0
test esi, esi
je 0x40cab6
lea edi, [ebp + 0x70]
mov ebp, dword [esp + 0x1c]
mov eax, dword [edi + 8]
and eax, 0xfffd
or eax, 2
mov ebx, eax
xor ebx, 1
imul ebx, eax
shr ebx, 8
xor bl, byte [ecx + ebp]
mov ecx, edi
mov dl, bl
call fcn.0040b941
mov ecx, dword [esp + 0x20]
mov byte [ecx + ebp], bl
inc ebp
cmp ebp, esi
jb 0x40ca81
mov ebp, dword [esp + 0x24]
mov edi, dword [ebp + 8]
mov edx, dword [ebp + 0x7c]
mov ecx, edi
cmp edx, edi
cmovbe ecx, edx
test ecx, ecx
je 0x40caea
mov eax, dword [ebp + 4]
sub edi, ecx
add eax, ecx
mov bl, byte [eax - 1]
sub dword [ebp + 0x5c], ecx
sub edx, ecx
mov dword [ebp + 8], edi
mov dword [ebp + 4], eax
mov dword [ebp + 0x7c], edx
jne 0x40caea
cmp bl, byte [ebp + 0x80]
jne 0x40cbb5
cmp dword [ebp + 0x64], 0
jne 0x40cb5e
mov eax, dword [ebp + 0x14]
cmp eax, edi
mov ebx, eax
mov dword [esp + 0x1c], eax
cmovae ebx, edi
xor edx, edx
test ebx, ebx
je 0x40cb1f
mov eax, dword [ebp + 4]
mov ecx, dword [ebp + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, ebx
jb 0x40cb04
mov eax, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
mov dword [esp + 0x1c], eax
mov esi, dword [ebp + 0x10]
mov edx, esi
mov ecx, dword [ebp + 0x50]
push ebx
call fcn.0040b85b
sub dword [ebp + 0x5c], ebx
sub edi, ebx
add dword [ebp + 4], ebx
add dword [ebp + 0x18], ebx
mov edx, dword [esp + 0x1c]
mov dword [ebp + 0x50], eax
mov eax, dword [esp + 0x20]
sub eax, ebx
mov dword [ebp + 8], edi
mov edi, dword [esp + 0x18]
mov dword [ebp + 0x14], eax
add edi, ebx
lea eax, [esi + ebx]
mov dword [esp + 0x18], edi
pop ecx
mov dword [ebp + 0x10], eax
jmp 0x40cb9e
mov esi, dword [ebp + 0x18]
lea ecx, [ebp + 4]
mov edi, dword [ebp + 0x10]
call fcn.0040bbee
mov ebx, dword [ebp + 0x18]
mov edx, edi
mov ecx, dword [ebp + 0x50]
sub ebx, esi
push ebx
mov dword [esp + 0x1c], eax
call fcn.0040b85b
mov edi, dword [esp + 0x18]
sub dword [ebp + 0x5c], ebx
add edi, ebx
mov edx, dword [esp + 0x1c]
mov dword [ebp + 0x50], eax
mov dword [esp + 0x18], edi
pop ecx
cmp edx, 1
je 0x40cbb9
test edx, edx
jne 0x40cbac
cmp dword [ebp + 0x14], 0
ja 0x40ca04
test edx, edx
je 0x40cbb9
mov eax, edx
jmp 0x40cbc0
or eax, 0xffffffff
jmp 0x40cbc0
push 0xffffffffffffff96
jmp 0x40cbbf
mov eax, edi
jmp 0x40cbc0
push 0xffffffffffffff9a
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret