Function at 0x40ef47
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
test al, 7
jne 0x40f332
cmp eax, 0x10
jb 0x40f332
cmp eax, 0x20
ja 0x40f332
test byte [ebp + 8], 3
je 0x40f332
mov cl, byte [esi + 0x208]
xor cl, byte [ebp + 8]
push ebx
push edi
and cl, 3
xor byte [esi + 0x208], cl
shr eax, 2
push 4
pop edi
cmp eax, edi
mov dword [ebp - 8], eax
mov dword [esi], eax
mov ecx, eax
ja 0x40ef98
mov ecx, edi
add ecx, 6
mov dword [esi + 4], ecx
mov ebx, dword [edx]
lea eax, [esi + 8]
mov dword [eax], ebx
mov ebx, dword [edx + 4]
mov dword [esi + 0xc], ebx
mov ebx, dword [edx + 8]
mov dword [esi + 0x10], ebx
mov ebx, dword [edx + 0xc]
lea ecx, [ecx*4 + 4]
mov dword [esi + 0x14], ebx
mov ebx, ecx
mov ecx, dword [ebp - 8]
sub ebx, ecx
sub ecx, edi
lea ebx, [eax + ebx*4]
mov dword [ebp - 8], ebx
je 0x40f151
dec ecx
dec ecx
je 0x40f0c9
dec ecx
dec ecx
jne 0x40f1bb
mov ecx, dword [edx + 0x10]
mov dword [esi + 0x18], ecx
mov ecx, dword [edx + 0x14]
mov dword [esi + 0x1c], ecx
mov ecx, dword [edx + 0x18]
mov dword [esi + 0x20], ecx
mov ecx, dword [edx + 0x1c]
mov dword [esi + 0x24], ecx
mov dword [ebp - 4], 0x452348
mov edx, dword [eax + 0x1c]
mov ebx, edx
shr edx, 0x10
movzx edx, dl
shr ebx, 0x18
mov ebx, dword [ebx*4 + 0x454bc0]
xor ebx, dword [edx*4 + 0x4547c0]
mov edx, dword [eax + 0x1c]
shr edx, 8
movzx edx, dl
xor ebx, dword [edx*4 + str.cwko0]
movzx edx, byte [eax + 0x1c]
xor ebx, dword [edx*4 + 0x454fc0]
mov edx, dword [ebp - 4]
xor ebx, dword [eax]
lea ecx, [eax + 0x20]
xor ebx, dword [edx]
mov edx, dword [eax + 4]
xor edx, ebx
mov dword [ecx], ebx
mov ebx, dword [eax + 8]
xor ebx, edx
mov dword [eax + 0x24], edx
mov edx, dword [eax + 0xc]
xor edx, ebx
mov dword [eax + 0x28], ebx
mov dword [eax + 0x2c], edx
mov dword [ebp - 0x10], edx
mov ebx, edx
shr edx, 0x10
movzx edx, dl
shr ebx, 0x18
mov dword [ebp - 0xc], edx
mov edx, dword [ebx*4 + 0x454fc0]
mov ebx, dword [ebp - 0xc]
xor edx, dword [ebx*4 + 0x454bc0]
mov ebx, dword [ebp - 0x10]
add dword [ebp - 4], edi
shr ebx, 8
movzx ebx, bl
xor edx, dword [ebx*4 + 0x4547c0]
movzx ebx, byte [eax + 0x2c]
xor edx, dword [ebx*4 + str.cwko0]
mov ebx, dword [eax + 0x14]
xor edx, dword [eax + 0x10]
xor ebx, edx
mov dword [eax + 0x30], edx
mov edx, dword [eax + 0x18]
xor edx, ebx
mov dword [eax + 0x38], edx
xor edx, dword [eax + 0x1c]
mov dword [eax + 0x34], ebx
mov dword [eax + 0x3c], edx
mov eax, ecx
cmp eax, dword [ebp - 8]
jb 0x40f002
jmp 0x40f1bb
mov ecx, dword [edx + 0x10]
mov dword [esi + 0x18], ecx
mov ecx, dword [edx + 0x14]
mov dword [esi + 0x1c], ecx
mov dword [ebp - 4], 0x452348
mov ecx, dword [eax + 0x14]
mov edx, ecx
shr ecx, 0x10
shr edx, 0x18
mov edx, dword [edx*4 + 0x454bc0]
movzx ecx, cl
xor edx, dword [ecx*4 + 0x4547c0]
mov ecx, dword [eax + 0x14]
shr ecx, 8
movzx ecx, cl
xor edx, dword [ecx*4 + str.cwko0]
movzx ecx, byte [eax + 0x14]
xor edx, dword [ecx*4 + 0x454fc0]
mov ecx, dword [ebp - 4]
xor edx, dword [eax]
add dword [ebp - 4], edi
xor edx, dword [ecx]
mov ecx, dword [eax + 4]
xor ecx, edx
lea ebx, [eax + 0x18]
mov dword [ebx], edx
mov edx, dword [eax + 8]
xor edx, ecx
mov dword [eax + 0x1c], ecx
mov ecx, dword [eax + 0xc]
xor ecx, edx
mov dword [eax + 0x20], edx
mov edx, dword [eax + 0x10]
xor edx, ecx
mov dword [eax + 0x28], edx
xor edx, dword [eax + 0x14]
mov dword [eax + 0x24], ecx
mov dword [eax + 0x2c], edx
mov eax, ebx
cmp eax, dword [ebp - 8]
jb 0x40f0dc
jmp 0x40f1bb
mov dword [ebp - 4], 0x452348
mov ecx, dword [eax + 0xc]
mov edx, ecx
shr ecx, 0x10
shr edx, 0x18
mov edx, dword [edx*4 + 0x454bc0]
movzx ecx, cl
xor edx, dword [ecx*4 + 0x4547c0]
mov ecx, dword [eax + 0xc]
shr ecx, 8
movzx ecx, cl
xor edx, dword [ecx*4 + str.cwko0]
movzx ecx, byte [eax + 0xc]
xor edx, dword [ecx*4 + 0x454fc0]
mov ecx, dword [ebp - 4]
xor edx, dword [eax]
add dword [ebp - 4], edi
xor edx, dword [ecx]
mov ecx, dword [eax + 8]
lea ebx, [eax + 0x10]
mov dword [ebx], edx
mov edx, dword [eax + 4]
xor edx, dword [ebx]
xor ecx, edx
mov dword [eax + 0x18], ecx
xor ecx, dword [eax + 0xc]
mov dword [eax + 0x14], edx
mov dword [eax + 0x1c], ecx
mov eax, ebx
cmp eax, dword [ebp - 8]
jb 0x40f158
mov cl, byte [esi + 0x208]
xor eax, eax
and cl, 3
inc eax
cmp cl, al
je 0x40f32a
mov ecx, dword [esi + 4]
shl ecx, 4
lea edx, [ecx + esi + 0x108]
lea ecx, [esi + 8]
mov ebx, dword [ecx]
mov dword [edx], ebx
add ecx, edi
mov ebx, dword [ecx]
add edx, edi
mov dword [edx], ebx
add ecx, edi
mov ebx, dword [ecx]
add edx, edi
mov dword [edx], ebx
add ecx, edi
mov ebx, dword [ecx]
add edx, edi
mov dword [edx], ebx
add ecx, edi
sub edx, 0x1c
cmp dword [esi + 4], eax
mov dword [ebp - 8], eax
jbe 0x40f310
mov eax, dword [ecx]
mov ebx, eax
shr eax, 0x10
movzx eax, al
shr ebx, 0x18
mov ebx, dword [ebx*4 + 0x456fc0]
xor ebx, dword [eax*4 + 0x456bc0]
mov eax, dword [ecx]
shr eax, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x4567c0]
movzx eax, byte [ecx]
xor ebx, dword [eax*4 + 0x4563c0]
add ecx, edi
mov dword [edx], ebx
mov eax, dword [ecx]
mov dword [ebp - 4], eax
mov ebx, eax
shr eax, 0x10
movzx eax, al
shr ebx, 0x18
mov ebx, dword [ebx*4 + 0x456fc0]
xor ebx, dword [eax*4 + 0x456bc0]
mov eax, dword [ebp - 4]
shr eax, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x4567c0]
movzx eax, byte [ecx]
xor ebx, dword [eax*4 + 0x4563c0]
add edx, edi
mov dword [edx], ebx
add ecx, edi
mov eax, dword [ecx]
mov dword [ebp - 4], eax
mov ebx, eax
shr eax, 0x10
movzx eax, al
shr ebx, 0x18
mov ebx, dword [ebx*4 + 0x456fc0]
xor ebx, dword [eax*4 + 0x456bc0]
mov eax, dword [ebp - 4]
shr eax, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x4567c0]
movzx eax, byte [ecx]
xor ebx, dword [eax*4 + 0x4563c0]
add edx, edi
mov dword [edx], ebx
add ecx, edi
mov eax, dword [ecx]
mov ebx, eax
mov dword [ebp - 4], eax
shr eax, 0x10
shr ebx, 0x18
mov ebx, dword [ebx*4 + 0x456fc0]
movzx eax, al
xor ebx, dword [eax*4 + 0x456bc0]
mov eax, dword [ebp - 4]
shr eax, 8
movzx eax, al
xor ebx, dword [eax*4 + 0x4567c0]
movzx eax, byte [ecx]
xor ebx, dword [eax*4 + 0x4563c0]
add edx, edi
mov dword [edx], ebx
add ecx, edi
sub edx, 0x1c
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [esi + 4]
jb 0x40f20c
mov eax, dword [ecx]
mov dword [edx], eax
add ecx, edi
mov eax, dword [ecx]
add edx, edi
mov dword [edx], eax
add edx, edi
add ecx, edi
mov eax, dword [ecx]
mov dword [edx], eax
mov eax, dword [ecx + 4]
mov dword [edx + 4], eax
pop edi
mov ax, 1
pop ebx
leave
ret
test eax, eax
je 0x40f341
and byte [esi + 0x208], 0xfc
xor eax, eax
leave
ret
mov ax, word [esi]
shl ax, 2
movsx eax, ax
leave
ret