Function at 0x40c9fd
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0xc], edx
push edi
xor ebx, ebx
mov dword [ebp - 0x2c], esi
and dword [ebp - 0x14], ebx
mov edi, dword [esi + 0xc]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x1c], edi
mov ecx, dword [edi + 0x44]
add ecx, 0x24
call fcn.00406292
mov dword [ebp - 0x34], eax
test eax, eax
jle 0x40ce26
mov byte [ebp - 8], bl
cmp byte [ebp + 0x10], bl
je 0x40ca7b
mov ecx, dword [esi]
call fcn.004088be
mov edi, dword [ebp + 0xc]
cmp edi, eax
ja 0x40ca78
lea eax, [ebp - 1]
mov edx, edi
push ebx
push eax
mov ecx, esi
call fcn.0040a32f
pop ecx
pop ecx
test eax, eax
jne 0x40cee0
mov eax, dword [ebp - 8]
cmp byte [ebp - 1], 2
push 1
movzx eax, al
pop ecx
cmove eax, ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
mov dword [eax], edi
mov edi, dword [ebp - 0x1c]
mov ecx, dword [edi + 0x48]
call fcn.004096f7
test eax, eax
jne 0x40cee0
mov ecx, dword [edi + 0x44]
mov edx, dword [ebp - 0x34]
add ecx, 0x24
dec edx
call fcn.004062b1
mov eax, ebx
mov dword [ebp - 0x14], eax
test eax, eax
je 0x40caa8
mov ecx, dword [ebx + 0x44]
jmp 0x40caae
mov ecx, dword [edi + 0x44]
add ecx, 0x20
call fcn.00406292
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x30], eax
push 0
push ecx
mov edx, eax
mov ecx, esi
call fcn.0040ab97
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40ce1f
mov ebx, dword [ebp - 0x28]
mov dword [ebp - 0x3c], ebx
mov eax, dword [ebx + 0x44]
mov dword [ebp - 0x18], eax
lea ecx, [eax + 4]
call fcn.00406292
mov ecx, dword [ebp - 8]
mov edx, eax
mov dword [ebp - 0x24], edx
test edx, edx
jne 0x40cb27
test cl, cl
jne 0x40cb27
mov ecx, dword [ebx + 0x48]
call fcn.004096f7
mov edi, eax
test edi, edi
jne 0x40cecf
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x30]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebx + 0x44]
mov ecx, dword [ecx + 0x44]
mov eax, dword [eax]
mov dword [ecx + 0x20], eax
mov eax, dword [ebp - 0xc]
mov dword [eax], ebx
jmp 0x40cc46
movzx eax, word [esi + 0x1e]
shr eax, 2
sub eax, 8
cmp edx, eax
jg 0x40ce17
test cl, cl
je 0x40cc50
mov ecx, dword [ebp - 0x30]
cmp dword [ebp + 0xc], ecx
jne 0x40cc50
mov eax, dword [ebp - 0xc]
mov byte [ebp - 8], 0
mov dword [eax], ebx
mov ecx, dword [ebx + 0x48]
call fcn.004096f7
mov edi, eax
test edi, edi
jne 0x40cecf
mov edx, dword [ebx + 0x44]
cmp dword [ebp - 0x24], eax
jne 0x40cb93
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x40cb87
mov ecx, dword [ebp - 0x1c]
mov eax, dword [edx]
mov ecx, dword [ecx + 0x44]
mov dword [ecx + 0x20], eax
jmp 0x40cc46
mov ecx, dword [eax + 0x44]
mov eax, dword [edx]
mov dword [ecx], eax
jmp 0x40cc46
lea ecx, [edx + 8]
call fcn.00406292
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x30], eax
push 0
push ecx
mov edx, eax
mov ecx, esi
call fcn.0040ab97
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40cecf
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 0x48]
call fcn.004096f7
mov ecx, dword [ebp - 0x20]
mov edi, eax
test edi, edi
jne 0x40ceca
mov eax, dword [ebx + 0x44]
mov ecx, dword [ecx + 0x44]
mov edx, dword [ebp - 0x24]
dec edx
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 0x44]
add ecx, 4
call fcn.004062b1
mov eax, edx
shl eax, 2
push eax
mov eax, dword [ebx + 0x44]
add eax, 0xc
push eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x44]
add eax, 8
push eax
call fcn.00455d50
mov ecx, dword [ebp - 0x20]
add esp, 0xc
call fcn.0040ac1b
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x40cc26
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 0x44]
add ecx, 0x20
jmp 0x40cc3e
mov ecx, dword [eax + 0x48]
call fcn.004096f7
mov edi, eax
test edi, edi
jne 0x40cecf
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx + 0x44]
mov edx, dword [ebp - 0x30]
call fcn.004062b1
xor ebx, ebx
mov dword [ebp - 0x28], ebx
jmp 0x40cdf1
mov ecx, dword [ebx + 0x48]
call fcn.004096f7
mov edi, eax
mov dword [ebp - 0x38], edi
test edi, edi
jne 0x40cecf
cmp dword [ebp + 0xc], eax
jbe 0x40cce8
mov ecx, dword [ebp - 0x18]
xor edx, edx
mov dword [ebp - 0x10], edx
lea ecx, [ecx + 8]
call fcn.00406292
sub eax, dword [ebp + 0xc]
xor edx, edx
inc edx
mov ecx, edx
mov dword [ebp - 0x30], edx
cmp dword [ebp - 0x24], edx
jle 0x40ccef
mov ebx, dword [ebp - 0x24]
mov edx, eax
mov edi, dword [ebp - 0x10]
neg edx
test eax, eax
cmovns edx, eax
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x18]
lea ecx, [ecx + 2]
mov esi, edx
lea ecx, [eax + ecx*4]
call fcn.00406292
sub eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x30]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [ebp - 0x34]
cmp eax, edx
cmovl edx, eax
cmp eax, esi
mov dword [ebp - 0x34], edx
cmovge ecx, edi
mov edi, ecx
mov ecx, dword [ebp - 0x30]
inc ecx
mov dword [ebp - 0x30], ecx
cmp ecx, ebx
jl 0x40cc9c
mov ebx, dword [ebp - 0x3c]
mov esi, dword [ebp - 0x2c]
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp - 0x38]
mov dword [ebp - 0x10], eax
jmp 0x40ccf2
xor eax, eax
mov dword [ebp - 0x10], eax
jmp 0x40ccf2
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx + eax*4]
add ecx, 8
call fcn.00406292
cmp byte [ebp - 8], 0
je 0x40cd0f
cmp eax, dword [ebp + 0xc]
jne 0x40cdf1
mov edi, dword [ebp + 8]
mov dword [edi], eax
mov ecx, dword [esi]
call fcn.004088be
cmp dword [edi], eax
ja 0x40ce0f
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x10]
lea eax, [ecx - 1]
cmp edx, eax
jge 0x40cd41
mov eax, dword [ebp - 0x18]
mov esi, dword [ebp - 0x18]
mov eax, dword [eax + ecx*4 + 4]
mov dword [esi + edx*4 + 8], eax
mov esi, dword [ebp - 0x2c]
lea edx, [ecx - 1]
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx + 4]
call fcn.004062b1
mov edx, dword [edi]
xor eax, eax
inc eax
mov ecx, esi
push eax
push dword [ebp - 0xc]
call fcn.0040ab97
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x40cded
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov edi, dword [eax + 0x48]
mov eax, dword [edi]
mov dword [ebp - 0x3c], eax
cmp byte [eax + 4], 0
je 0x40cdd0
cmp byte [edi + 0x1f], 0
jne 0x40cdd0
cmp byte [eax + 0x13], 0
jne 0x40cdd0
mov ecx, dword [eax + 0x54]
mov esi, dword [edi + 4]
mov edx, esi
shr edx, 3
and esi, 7
movzx eax, byte [edx + ecx]
bts eax, esi
mov byte [edx + ecx], al
xor eax, eax
mov ecx, dword [ebp - 0x3c]
inc eax
mov byte [edi + 0x1c], al
mov byte [edi + 0x20], 0
cmp byte [ecx + 9], 0
je 0x40cdcd
mov esi, dword [edi + 4]
mov edx, esi
mov ecx, dword [ecx + 0x58]
and esi, 7
shr edx, 3
movzx eax, byte [edx + ecx]
bts eax, esi
mov byte [edx + ecx], al
mov esi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
mov ecx, dword [ecx + 0x48]
call fcn.004096f7
mov edi, eax
test edi, edi
je 0x40cded
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call fcn.0040ac1b
mov byte [ebp - 8], 0
mov ecx, dword [ebp - 0x14]
call fcn.0040ac1b
and dword [ebp - 0x14], 0
cmp byte [ebp - 8], 0
je 0x40cecf
mov edi, dword [ebp - 0x1c]
jmp 0x40ca9a
push 0xb
pop eax
jmp 0x40cee0
push 0xb
pop edi
jmp 0x40cecf
xor ebx, ebx
jmp 0x40cecf
mov ecx, dword [esi]
call fcn.004088be
lea edi, [eax + 1]
mov eax, dword [ebp + 8]
mov dword [eax], edi
mov ecx, dword [esi + 0x18]
test ecx, ecx
je 0x40ce59
lea edi, [ecx + 1]
xor edx, edx
mov dword [eax], edi
mov eax, 0x40000000
movzx ecx, word [esi + 0x1c]
div ecx
inc eax
cmp edi, eax
jne 0x40ce59
mov eax, dword [ebp + 8]
inc edi
mov dword [eax], edi
mov dword [ebp - 0x30], edi
cmp byte [esi + 0x16], bl
je 0x40ce91
mov edx, edi
mov dword [ebp - 0x30], edi
mov ecx, esi
call fcn.0040a264
cmp eax, edi
mov eax, dword [ebp + 8]
jne 0x40ce94
inc edi
xor edx, edx
mov dword [eax], edi
mov eax, 0x40000000
movzx ecx, word [esi + 0x1c]
div ecx
inc eax
cmp edi, eax
mov eax, dword [ebp + 8]
jne 0x40ce97
inc edi
mov dword [eax], edi
jmp 0x40ce97
mov eax, dword [ebp + 8]
mov edi, dword [ebp - 0x30]
cmp dword [esi + 0x18], ebx
je 0x40cea1
mov dword [esi + 0x18], edi
mov edi, dword [eax]
push 0
push dword [ebp - 0xc]
mov edx, edi
mov ecx, esi
call fcn.0040ab97
pop ecx
pop ecx
test eax, eax
jne 0x40cee0
mov esi, dword [ebp - 0xc]
mov ecx, dword [esi]
mov ecx, dword [ecx + 0x48]
call fcn.004096f7
mov edi, eax
test edi, edi
je 0x40cecf
mov ecx, dword [esi]
call fcn.0040ac1b
mov ecx, ebx
call fcn.0040ac1b
mov ecx, dword [ebp - 0x14]
call fcn.0040ac1b
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret