Function at 0x40cdc0
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [0x42ad1c]
sub esp, 0x30
push ebx
push ebp
mov ebp, dword [ecx*4 + 0x42aa90]
test ebp, ebp
je 0x40d0cf
mov edx, dword [ecx*4 + 0x42a9d0]
xor eax, eax
test edx, edx
jbe 0x40ce04
mov bl, byte [eax + ebp]
mov cl, al
add cl, 0x42
xor bl, cl
mov byte [eax + ebp], bl
mov edx, dword [0x42ad1c]
inc eax
cmp eax, dword [edx*4 + 0x42a9d0]
jb 0x40cde7
xor eax, eax
mov ax, word [ebp]
add ebp, 2
test eax, eax
jbe 0x40d0cf
push esi
push edi
mov dword [esp + 0x34], eax
mov eax, dword [ebp]
mov ecx, dword [ebp + 4]
add ebp, 4
mov dword [esp + 0x24], eax
add ebp, 8
mov dword [esp + 0x14], ecx
or ecx, 0xffffffff
xor eax, eax
mov dl, byte [ebp]
inc ebp
mov edi, ebp
mov byte [esp + 0x13], dl
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ebp
push ebx
lea edx, [ecx + ebp + 1]
or ecx, 0xffffffff
mov edi, edx
mov esi, edx
repne scasb al, byte es:[edi]
mov eax, dword [0x42a8b4]
mov edi, dword [esp + 0x18]
not ecx
dec ecx
push eax
lea ebp, [edx + ecx + 1]
mov dword [esp + 0x40], ebp
add ebp, edi
call fcn.0040c7b0
push 0xffdc
push esi
push 0
call fcn.0040c670
mov edi, eax
add esp, 0x14
test edi, edi
mov dword [esp + 0x3c], edi
je 0x40d0be
lea ecx, [edi + edi + 1]
push ecx
call fcn.00419e90
lea edx, [edi + 1]
mov dword [esp + 0x34], eax
push edx
push esi
push eax
call fcn.0040c670
mov eax, dword [0x42a8b4]
push 2
push eax
call fcn.00401140
mov ebx, eax
add esp, 0x18
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
jne 0x40ceea
test byte [esp + 0x13], 8
je 0x40d0b1
mov ecx, dword [0x42a8b4]
push ecx
call fcn.00401190
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
je 0x40d0b1
test byte [esp + 0x13], 8
je 0x40cf63
push ebx
call fcn.004012c0
mov esi, eax
mov al, byte [esp + 0x17]
add esp, 4
test al, 0x10
je 0x40d07f
cmp esi, 2
jb 0x40d07f
lea edx, [esi - 2]
push edx
push ebx
call fcn.00401260
lea eax, [esp + 0x30]
push 2
push eax
push ebx
call fcn.004011c0
mov eax, dword [esp + 0x3c]
add esp, 0x14
cmp ax, 0xa0d
je 0x40d07f
cmp ax, 0xd0a
je 0x40d07f
lea ecx, [esp + 0x28]
push 2
push ecx
push ebx
mov dword [esp + 0x34], 0xa0d
call fcn.00401200
add esp, 0xc
add esi, 2
jmp 0x40d07f
cmp dword [esp + 0x24], 0xffffffff
jne 0x40d086
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40d0a8
push ebx
call fcn.004012c0
add esp, 4
cmp eax, 0x8000
mov esi, eax
jb 0x40cf91
mov esi, 0x8000
lea edx, [esp + 0x18]
sub eax, esi
push edx
push esi
mov dword [esp + 0x24], eax
call fcn.00402180
add esp, 8
test eax, eax
je 0x40d0a8
mov eax, dword [esp + 0x18]
push esi
push eax
push ebx
call fcn.004011c0
add esp, 0xc
mov dword [esp + 0x2c], 0
mov eax, esi
mov ecx, dword [esp + 0x1c]
mov edx, 0x4000
test ecx, ecx
jne 0x40cfda
sub eax, dword [esp + 0x14]
inc eax
mov edx, eax
mov eax, dword [esp + 0x18]
test edx, edx
je 0x40d000
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x38]
mov esi, eax
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x40cff8
inc eax
dec edx
jne 0x40cfe2
jmp 0x40cffc
test edx, edx
jne 0x40d050
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40d06a
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x2c]
mov ecx, 0x1000
lea eax, [edi + 0x4000]
mov esi, eax
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x1c]
mov esi, 0x4000
add edx, esi
cmp edi, esi
mov dword [esp + 0x2c], edx
ja 0x40d034
mov esi, edi
push esi
push eax
push ebx
call fcn.004011c0
add esp, 0xc
sub edi, esi
mov dword [esp + 0x1c], edi
lea eax, [esi + 0x4000]
jmp 0x40cfc6
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0x20]
sub eax, esi
add eax, edx
add eax, ecx
mov dword [esp + 0x24], eax
lea ecx, [esp + 0x18]
push ecx
call fcn.00402200
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x40]
add esp, 4
cmp esi, 0xffffffff
je 0x40d0a8
jmp 0x40d08a
mov esi, dword [esp + 0x24]
push esi
push ebx
call fcn.00401260
mov edx, dword [esp + 0x38]
push edi
push edx
push ebx
call fcn.00401200
push 0
push ebx
call fcn.004012a0
add esp, 0x1c
push ebx
call fcn.004013c0
add esp, 4
mov eax, dword [esp + 0x30]
push eax
call fcn.00419ff3
add esp, 4
mov eax, dword [esp + 0x34]
dec eax
mov dword [esp + 0x34], eax
jne 0x40ce1b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret