Function at 0x40f1f1
Capabilities:
Encode data using xor

Disassembly:
push ebp
lea ebp, [esp - 0x70]
mov eax, 0x21b8
call fcn.004131b0
and dword [ebp + 0x60], 0
push esi
mov esi, dword [ebx + 0xa4]
push edi
mov edi, 0xfff
push edi
lea eax, [ebp - 0x2147]
push 0
push eax
mov dword [ebp + 0x5c], esi
mov byte [ebp - 0x2148], 0
call sub.msvcrt.dll_memset
push edi
lea eax, [ebp - 0x1147]
push 0
push eax
mov byte [ebp - 0x1148], 0
call sub.msvcrt.dll_memset
mov eax, dword [esi + 0x68]
add esp, 0x18
cmp eax, 0xbb8
jae 0x40f47b
push eax
lea edi, [esi + 0xa0]
lea eax, [ebp - 0x2148]
push edi
push eax
call sub.msvcrt.dll_memcpy
push dword [esi + 0x68]
lea eax, [ebp - 0x1148]
push edi
push eax
call sub.msvcrt.dll_memcpy
xor eax, eax
mov byte [ebp + 0x44], 0
lea edi, [ebp + 0x45]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x3f
stosb byte es:[edi], al
lea eax, [ebp + 5]
push 0
push eax
mov byte [ebp + 4], 0
call sub.msvcrt.dll_memset
add esi, 0x84
lea edi, [ebp + 0x44]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
add esp, 0x24
movsd dword es:[edi], dword [esi]
mov edi, dword [ebp + 0x5c]
lea eax, [ebp + 4]
push eax
mov byte [ebp + 0x57], 1
push dword [edi + 0x94]
lea eax, [ebp + 0x44]
push eax
push dword [ebp + 0x7c]
mov esi, 0x8004
push ebx
call fcn.0040f054
lea eax, [ebp + 0x18]
push eax
mov byte [ebp + 0x57], 2
push dword [edi + 0x94]
lea eax, [ebp + 0x44]
push eax
push dword [ebp + 0x7c]
push ebx
call fcn.0040f054
and dword [ebp + 0x68], 0
push 6
pop ecx
lea eax, [ebp + 0x68]
push eax
push 0x24
lea eax, [ebp - 0x48]
push eax
push dword [ebx]
mov eax, dword [ebx + 0xb4]
mov byte [ebp - 0x48], 8
mov dword [ebp - 0x44], 0x6603
mov byte [ebp - 0x47], 2
mov dword [ebp - 0x40], 0x18
lea esi, [ebp + 4]
lea edi, [ebp - 0x3c]
rep movsd dword es:[edi], dword [esi]
call fcn.0040ff2f
cmp dword [ebp + 0x68], 0
je 0x40f476
xor eax, eax
mov dword [ebp + 0x6c], eax
jmp 0x40f334
mov eax, dword [ebp + 0x6c]
and dword [ebp + 0x64], 0
lea edi, [ebp + eax - 0x1148]
lea esi, [ebp + eax - 0x2148]
lea eax, [ebp + 0x64]
movsd dword es:[edi], dword [esi]
push eax
push dword [ebp + 0x68]
mov eax, dword [ebx + 0xb4]
mov dword [ebp + 0x58], 8
movsd dword es:[edi], dword [esi]
call fcn.0040fef3
mov edi, dword [ebp + 0x6c]
lea eax, [ebp + 0x58]
push eax
mov eax, dword [ebx + 0xb4]
lea edi, [ebp + edi - 0x1148]
push edi
push dword [ebp + 0x64]
call fcn.0040ff78
push dword [ebp + 0x64]
mov eax, dword [ebx + 0xb4]
call fcn.0040ff18
mov eax, dword [ebp + 0x6c]
test eax, eax
lea esi, [ebp + 0x1c]
jbe 0x40f39d
lea esi, [ebp + eax - 0x2150]
xor eax, eax
mov cl, byte [eax + esi]
xor byte [edi + eax], cl
inc eax
cmp eax, 8
jb 0x40f39f
add dword [ebp + 0x6c], 8
mov eax, dword [ebp + 0x5c]
mov ecx, dword [ebp + 0x6c]
cmp ecx, dword [eax + 0x68]
jb 0x40f331
push dword [ebp + 0x68]
mov eax, dword [ebx + 0xb4]
call fcn.0040ff18
push 0x7f
lea eax, [ebp - 0xc7]
push 0
push eax
mov byte [ebp - 0xc8], 0
call sub.msvcrt.dll_memset
push 0x7f
lea eax, [ebp - 0x147]
push 0
push eax
mov byte [ebp - 0x148], 0
call sub.msvcrt.dll_memset
add esp, 0x18
lea eax, [ebp - 0xc8]
push eax
push 0x10
lea eax, [ebp - 0x1148]
push eax
push 0x14
push dword [ebp + 0x7c]
mov esi, 0x8004
push 0x40
push esi
push ebx
call fcn.0040ef58
lea eax, [ebp - 0x148]
push eax
push 0x40
lea eax, [ebp - 0x1120]
push eax
push 0x14
lea eax, [ebp - 0xc8]
push eax
push 0x40
push esi
push ebx
call fcn.0040ef58
push 5
pop ecx
lea edi, [ebp - 0x1138]
lea esi, [ebp - 0x148]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x40f476
push dword [ebp + 0x78]
lea eax, [ebp - 0x1120]
push 0x40
push eax
push 0x8004
mov eax, ebx
mov dword [ebp + 0x60], 1
call fcn.0040ebe6
mov eax, dword [ebp + 0x60]
jmp 0x40f487
mov dword [ebx + 0x31c], 0xfffffffe
xor eax, eax
pop edi
pop esi
add ebp, 0x70
leave
ret 8