Function at 0x40c680
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
push ebx
mov ebx, dword [esp + 0x20]
push ebp
push esi
push edi
mov edi, edx
xor esi, esi
xor edx, edx
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], edx
test ebx, ebx
je 0x40c69f
mov byte [ebx], dl
test ecx, ecx
jne 0x40c6ab
push 0xffffffffffffff9a
pop eax
jmp 0x40c8a6
mov ebp, dword [ecx + 0x7c]
mov dword [esp + 0x20], ebp
test ebp, ebp
je 0x40c6a3
cmp dword [ebp], edx
jne 0x40c6bf
push 0xffffffffffffff9c
jmp 0x40c6a5
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40c8a6
cmp eax, dword [ebp + 0x5c]
mov dword [ebp + 0x10], edi
cmova eax, dword [ebp + 0x5c]
mov dword [ebp + 0x14], eax
test eax, eax
jbe 0x40c8a4
cmp dword [ebp + 8], 0
jne 0x40c78b
mov eax, dword [ebp + 0x58]
test eax, eax
je 0x40c78b
mov edx, dword [ebp + 0x68]
mov esi, 0x4000
mov ecx, dword [ebp + 0x60]
cmp eax, esi
push 0
cmovb esi, eax
add edx, dword [ebp + 0x3c]
call fcn.0040bbf8
test eax, eax
jne 0x40c885
push dword [ebp + 0x60]
mov ecx, dword [ebp]
mov edx, esi
push 1
call fcn.0040bc63
cmp eax, 1
jne 0x40c885
add dword [ebp + 0x3c], esi
sub dword [ebp + 0x58], esi
cmp byte [ebp + 0x6c], 0
mov eax, dword [ebp]
mov dword [esp + 0x28], eax
mov dword [ebp + 4], eax
mov dword [ebp + 8], esi
je 0x40c78b
xor edi, edi
test esi, esi
je 0x40c78b
lea ecx, [ebp + 0x6d]
mov ebp, eax
mov dword [esp + 0x1c], ecx
mov eax, dword [ecx + 8]
and eax, 0xfffd
or eax, 2
mov ebx, eax
xor ebx, 1
imul ebx, eax
shr ebx, 8
xor bl, byte [edi + ebp]
mov dl, bl
call fcn.0040b620
mov ecx, dword [esp + 0x1c]
mov byte [edi + ebp], bl
inc edi
cmp edi, esi
jb 0x40c757
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
mov ecx, dword [ebp + 0x79]
mov edx, dword [ebp + 8]
cmp ecx, edx
cmova ecx, edx
test ecx, ecx
je 0x40c7c7
mov eax, dword [ebp + 4]
sub edx, ecx
add eax, ecx
mov bl, byte [eax - 1]
sub dword [ebp + 0x5c], ecx
sub dword [ebp + 0x79], ecx
mov byte [esp + 0x28], bl
mov ebx, dword [esp + 0x2c]
mov dword [ebp + 8], edx
mov dword [ebp + 4], eax
jne 0x40c7c7
mov al, byte [esp + 0x28]
cmp al, byte [ebp + 0x7d]
jne 0x40c88a
cmp dword [ebp + 0x64], 0
jne 0x40c831
mov edi, dword [ebp + 8]
cmp dword [ebp + 0x14], edi
cmovb edi, dword [ebp + 0x14]
xor edx, edx
test edi, edi
je 0x40c7ee
mov eax, dword [ebp + 4]
mov ecx, dword [ebp + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, edi
jb 0x40c7dd
mov esi, dword [ebp + 0x10]
mov edx, esi
mov ecx, dword [ebp + 0x50]
push edi
call fcn.0040b53a
sub dword [ebp + 0x5c], edi
sub dword [ebp + 8], edi
sub dword [ebp + 0x14], edi
add dword [ebp + 4], edi
add dword [ebp + 0x18], edi
mov edx, dword [esp + 0x14]
mov dword [ebp + 0x50], eax
lea eax, [esi + edi]
mov esi, dword [esp + 0x18]
add esi, edi
mov dword [ebp + 0x10], eax
cmp dword [ebp + 0x5c], 0
mov dword [esp + 0x18], esi
jne 0x40c876
test ebx, ebx
je 0x40c876
mov byte [ebx], 1
jmp 0x40c876
mov esi, dword [ebp + 0x18]
lea ecx, [ebp + 4]
mov edi, dword [ebp + 0x10]
call fcn.0040b8b2
mov ebx, dword [ebp + 0x18]
mov edx, edi
mov ecx, dword [ebp + 0x50]
sub ebx, esi
push ebx
mov dword [esp + 0x18], eax
call fcn.0040b53a
mov esi, dword [esp + 0x18]
sub dword [ebp + 0x5c], ebx
add esi, ebx
mov edx, dword [esp + 0x14]
mov dword [ebp + 0x50], eax
mov dword [esp + 0x18], esi
cmp edx, 1
je 0x40c899
cmp dword [ebp + 0x5c], 0
je 0x40c899
test edx, edx
jne 0x40c895
cmp dword [ebp + 0x14], 0
jbe 0x40c891
mov ebx, dword [esp + 0x2c]
jmp 0x40c6e0
or eax, 0xffffffff
jmp 0x40c8a6
push 0xffffffffffffff96
jmp 0x40c6a5
test edx, edx
je 0x40c8a4
mov eax, edx
jmp 0x40c8a6
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x40c8a4
mov byte [ecx], 1
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 8