Function at 0x40f610
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
push ebp
mov ebp, dword [esp + 0x20]
push esi
push edi
xor edi, edi
cmp ebp, edi
mov esi, ecx
jne 0x40f62d
pop edi
pop esi
xor al, al
pop ebp
add esp, 0x18
ret 8
mov eax, dword [esp + 0x2c]
push ebx
push edi
push edi
push ebp
mov dword [esi + 0x18], eax
call fcn.0041d579
push ebp
push 1
lea ecx, [esp + 0x40]
push 4
push ecx
mov dword [esp + 0x48], edi
call fcn.0041d49e
mov eax, dword [esp + 0x48]
add esp, 0x1c
cmp eax, 0x4034b50
mov ebx, 2
jne 0x40f678
test byte [esi + 0x18], 1
mov dword [esi + 0x14], edi
jne 0x40f6b3
pop ebx
pop edi
pop esi
xor al, al
pop ebp
add esp, 0x18
ret 8
push ebp
call fcn.0040f5a0
add esp, 4
test al, al
je 0x40f6a2
mov edx, dword [esi + 0x18]
shr edx, 1
test dl, 1
mov dword [esi + 0x14], 1
jne 0x40f6b3
pop ebx
pop edi
pop esi
xor al, al
pop ebp
add esp, 0x18
ret 8
mov eax, dword [esi + 0x18]
shr eax, 2
test al, 1
mov dword [esi + 0x14], ebx
je 0x40f850
push ebx
push 0xffffffffffffffea
push ebp
call fcn.0041d579
push ebp
call fcn.0041d374
xor ecx, ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
push ebp
mov dword [esp + 0x2c], ecx
push 1
mov dword [esp + 0x34], ecx
lea edx, [esp + 0x28]
mov dword [esp + 0x38], ecx
push 0x16
push edx
mov edi, eax
mov word [esp + 0x44], cx
call fcn.0041d49e
mov eax, dword [esi + 0x14]
add esp, 0x20
cmp eax, ebx
jl 0x40f72b
xor ecx, ecx
lea ebx, [ebx]
mov al, byte [esp + ecx + 0x10]
mov byte [esp + 0x2c], al
mov al, byte [esp + 0x2c]
ror al, 4
xor al, 0x5c
add al, 0xe6
xor al, 0x39
add al, 0x7b
sub al, 0xba
mov byte [esp + 0x2c], al
mov dl, byte [esp + 0x2c]
mov byte [esp + ecx + 0x10], dl
inc ecx
cmp ecx, 0x16
jl 0x40f700
mov eax, dword [esp + 0x10]
cmp eax, 0x5030208
je 0x40f748
cmp eax, 0x5030207
je 0x40f748
cmp eax, 0x6054b50
jne 0x40f66c
mov ecx, dword [esp + 0x1c]
push 0
sub edi, ecx
push edi
push ebp
call fcn.0041d579
movzx eax, word [esp + 0x24]
mov ecx, dword [esp + 0x28]
lea edx, [ecx + eax*4]
push edx
call fcn.0042aabe
mov ecx, dword [esp + 0x2c]
mov edi, eax
movzx eax, word [esp + 0x28]
lea ecx, [ecx + eax*4]
mov edx, ecx
shr ecx, 2
mov dword [esi + 8], edi
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
push ebp
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x30]
mov ecx, dword [esi + 8]
push 1
push eax
push ecx
call fcn.0041d49e
mov eax, dword [esi + 0x14]
add esp, 0x20
cmp eax, ebx
jl 0x40f7b6
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 8]
push edx
push eax
call fcn.0040f510
add esp, 8
mov ecx, dword [esp + 0x1c]
mov eax, dword [esi + 8]
lea edx, [eax + ecx]
mov cx, word [esp + 0x18]
xor edi, edi
test cx, cx
mov dword [esi + 0xc], edx
jbe 0x40f828
nop
mov ecx, dword [esi + 0xc]
mov dword [ecx + edi*4], eax
mov ecx, dword [eax]
cmp ecx, 0x2014b50
mov edx, eax
je 0x40f7ea
cmp ecx, 0x5024b80
jne 0x40f83d
xor ecx, ecx
add eax, 0x2e
cmp word [edx + 0x1c], cx
jbe 0x40f808
cmp byte [ecx + eax], 0x2f
jne 0x40f7ff
mov byte [ecx + eax], 0x5c
movzx ebx, word [edx + 0x1c]
inc ecx
cmp ecx, ebx
jl 0x40f7f5
movzx ecx, word [edx + 0x20]
movzx ebx, word [edx + 0x1e]
movzx edx, word [edx + 0x1c]
add ecx, ebx
add edx, eax
lea eax, [edx + ecx]
mov cx, word [esp + 0x18]
movzx edx, cx
inc edi
cmp edi, edx
jl 0x40f7d0
pop ebx
movzx ecx, cx
pop edi
mov dword [esi + 4], ebp
mov dword [esi + 0x10], ecx
pop esi
mov al, 1
pop ebp
add esp, 0x18
ret 8
mov eax, dword [esi + 8]
push eax
call fcn.0042aac3
add esp, 4
mov dword [esi + 8], 0
pop ebx
pop edi
pop esi
xor al, al
pop ebp
add esp, 0x18
ret 8