Function at 0x40f350
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x58c
push ebx
push ebp
push esi
push 0x44
xor ebp, ebp
lea eax, [esp + 0x54]
push ebp
push eax
call fcn.004e01d0
mov ebx, dword [esp + 0x5a8]
mov esi, dword [esp + 0x5ac]
add esp, 0xc
mov ecx, ebx
mov edx, esi
lea ecx, [ecx]
mov eax, dword [ecx]
inc dword [esp + eax*4 + 0x50]
lea eax, [esp + eax*4 + 0x50]
add ecx, 4
sub edx, 1
jne 0x40f380
cmp dword [esp + 0x50], esi
jne 0x40f3a7
pop esi
pop ebp
lea eax, [edx + 2]
pop ebx
add esp, 0x58c
ret 0x1c
mov edx, dword [esp + 0x5b4]
mov esi, dword [edx]
mov dword [esp + 0x10], esi
mov ecx, 1
lea esp, [esp]
cmp dword [esp + ecx*4 + 0x50], ebp
jne 0x40f3cc
inc ecx
cmp ecx, 0x10
jbe 0x40f3c0
mov dword [esp + 0xc], ecx
cmp esi, ecx
jae 0x40f3da
mov dword [esp + 0x10], ecx
mov esi, ecx
mov eax, 0x10
nop
cmp dword [esp + eax*4 + 0x50], ebp
jne 0x40f3eb
sub eax, 1
jne 0x40f3e0
mov dword [esp + 0x34], eax
cmp esi, eax
jbe 0x40f3f9
mov dword [esp + 0x10], eax
mov esi, eax
push edi
mov edi, 1
shl edi, cl
mov dword [edx], esi
cmp ecx, eax
jae 0x40f414
sub edi, dword [esp + ecx*4 + 0x54]
js 0x40f420
inc ecx
add edi, edi
cmp ecx, eax
jb 0x40f407
mov ecx, dword [esp + eax*4 + 0x54]
sub edi, ecx
mov dword [esp + 0x4c], edi
jns 0x40f432
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x58c
ret 0x1c
add ecx, edi
mov dword [esp + eax*4 + 0x54], ecx
xor ecx, ecx
sub eax, 1
mov dword [esp + 0x9c], ebp
je 0x40f463
xor edx, edx
jmp 0x40f450
add ecx, dword [esp + edx + 0x58]
add edx, 4
sub eax, 1
mov dword [esp + edx + 0x9c], ecx
jne 0x40f450
push 0x480
lea ecx, [esp + 0x120]
push ebp
push ecx
call fcn.004e01d0
add esp, 0xc
xor edx, edx
jmp 0x40f480
mov eax, dword [ebx]
add ebx, 4
cmp eax, ebp
je 0x40f4a1
mov ecx, dword [esp + eax*4 + 0x98]
lea eax, [esp + eax*4 + 0x98]
mov dword [esp + ecx*4 + 0x11c], edx
inc ecx
mov dword [eax], ecx
inc edx
cmp edx, dword [esp + 0x5a4]
jb 0x40f480
lea edx, [esp + 0x11c]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x10]
mov eax, esi
xor ebx, ebx
neg eax
cmp edx, dword [esp + 0x38]
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x98], ebp
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0xdc], ebp
mov dword [esp + 0x48], ebp
mov dword [esp + 0x40], ebp
jg 0x40f75e
lea ecx, [edx - 1]
mov dword [esp + 0x34], ecx
lea ecx, [esp + edx*4 + 0x54]
mov dword [esp + 0x30], ecx
jmp 0x40f500
mov ecx, dword [esp + 0x30]
mov ecx, dword [ecx]
mov dword [esp + 0x1c], ecx
test ecx, ecx
je 0x40f746
dec dword [esp + 0x1c]
lea ecx, [eax + esi]
cmp edx, ecx
jle 0x40f62c
mov edx, dword [esp + 0x1c]
inc edx
mov edi, eax
mov dword [esp + 0x50], edx
mov dword [esp + 0x3c], ecx
sub edi, esi
mov edx, dword [esp + 0x38]
inc dword [esp + 0x18]
add dword [esp + 0x3c], esi
add eax, esi
sub edx, eax
add edi, esi
mov dword [esp + 0x44], eax
cmp edx, esi
jbe 0x40f54e
mov edx, esi
mov ebx, dword [esp + 0x10]
sub ebx, eax
mov eax, 1
mov ecx, ebx
shl eax, cl
cmp eax, dword [esp + 0x50]
jbe 0x40f588
mov esi, dword [esp + 0x30]
or ecx, 0xffffffff
sub ecx, dword [esp + 0x1c]
inc ebx
add eax, ecx
cmp ebx, edx
jae 0x40f588
mov ecx, dword [esi + 4]
add esi, 4
add eax, eax
cmp eax, ecx
jbe 0x40f588
inc ebx
sub eax, ecx
cmp ebx, edx
jb 0x40f575
mov ecx, ebx
mov eax, 1
shl eax, cl
lea edx, [eax*8 + 8]
push edx
mov dword [esp + 0x44], eax
call fcn.004df966
add esp, 4
test eax, eax
je 0x40f77f
mov edx, dword [esp + 0x5b4]
lea ecx, [eax + 8]
mov ebp, ecx
mov dword [edx], ecx
mov ecx, dword [esp + 0x18]
add eax, 4
lea esi, [esp + ecx*4 + 0xdc]
mov dword [esp + 0x5b4], eax
mov dword [eax], 0
mov dword [esp + 0x48], ebp
mov dword [esi], ebp
test ecx, ecx
je 0x40f612
mov eax, dword [esp + 0x2c]
mov dword [esp + ecx*4 + 0x98], eax
mov cl, byte [esp + 0x14]
mov byte [esp + 0x25], cl
mov ecx, edi
add bl, 0x10
shr eax, cl
mov ecx, dword [esi - 4]
mov byte [esp + 0x24], bl
mov esi, dword [esp + 0x24]
mov edx, ebp
mov dword [ecx + eax*8], esi
mov dword [esp + 0x28], edx
mov dword [ecx + eax*8 + 4], edx
mov edx, dword [esp + 0x3c]
cmp dword [esp + 0x10], edx
mov eax, dword [esp + 0x44]
mov esi, dword [esp + 0x14]
jg 0x40f532
mov ebx, dword [esp + 0x2c]
mov cl, byte [esp + 0x10]
mov edx, dword [esp + 0x5a4]
sub cl, al
mov byte [esp + 0x25], cl
mov ecx, dword [esp + 0x20]
lea edx, [esp + edx*4 + 0x11c]
cmp ecx, edx
jb 0x40f653
mov byte [esp + 0x24], 0x63
jmp 0x40f69d
mov ecx, dword [ecx]
mov edx, dword [esp + 0x5a8]
cmp ecx, edx
jae 0x40f672
cmp ecx, 0x100
setb dl
add dl, 0xf
mov byte [esp + 0x24], dl
jmp 0x40f694
mov edi, dword [esp + 0x5b0]
test edi, edi
je 0x40f69d
sub ecx, edx
add ecx, ecx
add ecx, ecx
mov dl, byte [ecx + edi]
mov byte [esp + 0x24], dl
mov edx, dword [esp + 0x5ac]
mov ecx, dword [ecx + edx]
add dword [esp + 0x20], 4
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x10]
sub ecx, eax
mov edi, 1
shl edi, cl
mov edx, ebx
mov ecx, eax
shr edx, cl
cmp edx, dword [esp + 0x40]
jae 0x40f6e0
lea ebx, [edi*8]
lea ecx, [ebp + edx*8]
mov ebp, dword [esp + 0x24]
mov dword [ecx], ebp
mov ebp, dword [esp + 0x28]
mov dword [ecx + 4], ebp
add edx, edi
add ecx, ebx
cmp edx, dword [esp + 0x40]
jb 0x40f6c1
mov ebp, dword [esp + 0x48]
mov ebx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x34]
mov edx, 1
shl edx, cl
test ebx, edx
je 0x40f6f8
nop
xor ebx, edx
shr edx, 1
test ebx, edx
jne 0x40f6f0
mov edi, 1
mov ecx, eax
shl edi, cl
xor ebx, edx
mov edx, dword [esp + 0x18]
mov dword [esp + 0x2c], ebx
dec edi
and edi, ebx
cmp edi, dword [esp + edx*4 + 0x98]
je 0x40f733
sub eax, esi
mov edi, 1
mov ecx, eax
shl edi, cl
dec edx
dec edi
and edi, ebx
cmp edi, dword [esp + edx*4 + 0x98]
jne 0x40f717
mov dword [esp + 0x18], edx
cmp dword [esp + 0x1c], 0
mov edx, dword [esp + 0x10]
jne 0x40f512
mov edi, dword [esp + 0x4c]
add dword [esp + 0x30], 4
inc dword [esp + 0x34]
inc edx
cmp edx, dword [esp + 0x38]
mov dword [esp + 0x10], edx
jle 0x40f500
test edi, edi
je 0x40f770
mov eax, 1
cmp dword [esp + 0x5a4], eax
jne 0x40f772
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58c
ret 0x1c
cmp dword [esp + 0x18], 0
je 0x40f7a6
mov eax, dword [esp + 0xdc]
test eax, eax
je 0x40f7a6
mov esi, dword [eax - 4]
sub eax, 8
push eax
call fcn.004df10f
add esp, 4
mov eax, esi
test esi, esi
jne 0x40f791
mov ecx, 0x5275b8
call fcn.0043d390
pop edi
pop esi
pop ebp
mov eax, 3
pop ebx
add esp, 0x58c
ret 0x1c