Function at 0x6040cf50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xc
mov dword [ebp - 0x14], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0x10], 0
mov ebx, dword [ebp + 0xc]
mov esi, dword [eax + 0x20]
test esi, esi
je 0x6040d104
mov esi, dword [eax + 0x1c]
cmp esi, 1
je 0x6040d0b5
xor ecx, ecx
cmp ecx, esi
jae 0x6040cf9b
lea esi, [esi]
cmp byte [ecx + ebx], 0
jne 0x6040cf9b
inc ecx
cmp ecx, esi
jb 0x6040cf90
cmp ecx, esi
je 0x6040cfd6
xor ecx, ecx
cmp ecx, esi
jae 0x6040cfcd
xor edx, edx
inc ecx
mov dl, byte [ebx]
inc ebx
mov eax, edx
shl eax, 0x11
lea eax, [eax + edx]
mov edx, dword [ebp - 0x10]
add edx, eax
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp - 0x10]
shr eax, 2
xor edi, eax
cmp ecx, esi
mov dword [ebp - 0x10], edi
jb 0x6040cfa5
mov ecx, dword [ebp - 0x14]
inc ecx
mov dword [ebp - 0x14], ecx
jmp 0x6040cf84
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x14]
shl eax, 0x11
mov edi, dword [ebp - 0x10]
add eax, edx
mov edx, dword [ebp - 0x14]
imul edx, esi
add edi, eax
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x10]
shr eax, 2
mov ecx, dword [ebp - 0x14]
xor ebx, eax
add ecx, esi
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 8]
xor edx, edx
mov eax, dword [ebp - 0x10]
div dword [ecx + 4]
mov eax, dword [ecx]
mov dword [ebp - 0x18], edx
mov ebx, dword [eax + edx*4]
test ebx, ebx
je 0x6040d02e
cld
mov eax, dword [ebp - 0x10]
cmp dword [ebx + 8], eax
je 0x6040d084
mov ebx, dword [ebx]
test ebx, ebx
jne 0x6040d020
mov edx, dword [ebp + 0x14]
xor eax, eax
test edx, edx
je 0x6040d07c
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
push eax
push 0
call fcn.6040cee0
add esp, 0x10
mov ebx, eax
xor eax, eax
test ebx, ebx
je 0x6040d07c
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
mov dword [ebx + 0xc], ecx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov dword [ebx + 8], edx
mov dword [ebx + 4], eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ecx]
mov dword [ebx + 0x10], eax
mov ecx, dword [ebp - 0x18]
mov eax, dword [edx + ecx*4]
mov dword [ebx], eax
mov dword [edx + ecx*4], ebx
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebx + 0xc]
jne 0x6040d028
mov esi, dword [ebx + 4]
cmp edx, edx
mov edi, dword [ebp + 0xc]
mov ecx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x6040d028
mov ecx, dword [ebp + 0x10]
cmp dword [ebx + 0x10], ecx
jae 0x6040d07a
mov dword [ebx + 0xc], 0
mov dword [ebx + 0x10], 0
jmp 0x6040d02e
xor edx, edx
mov dl, byte [ebx]
inc ebx
test edx, edx
je 0x6040d0ec
mov eax, edx
mov ecx, dword [ebp - 0x10]
shl eax, 0x11
mov edi, dword [ebp - 0x14]
inc edi
lea eax, [eax + edx]
mov dword [ebp - 0x14], edi
add ecx, eax
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x10]
shr eax, 2
xor edx, eax
mov dword [ebp - 0x10], edx
xor edx, edx
mov dl, byte [ebx]
inc ebx
test edx, edx
jne 0x6040d0be
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x14]
shl eax, 0x11
mov ecx, dword [ebp - 0x10]
add eax, ebx
add ecx, eax
mov dword [ebp - 0x10], ecx
jmp 0x6040cff2
mov eax, dword [ebp + 8]
xor ecx, ecx
mov esi, dword [eax + 0x1c]
cmp dword [ebp - 0x14], esi
jae 0x6040d139
xor edx, edx
inc ecx
mov dl, byte [ebx]
inc ebx
mov eax, edx
shl eax, 0x11
lea eax, [eax + edx]
mov edx, dword [ebp - 0x10]
add edx, eax
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp - 0x10]
shr eax, 2
xor edi, eax
cmp ecx, esi
mov dword [ebp - 0x10], edi
jb 0x6040d111
mov dword [ebp - 0x14], esi
jmp 0x6040d008