Function at 0x40f332
Capabilities:
Encode data using xor

Disassembly:
push ebp
lea ebp, [esp - 0x70]
mov eax, 0x21b8
call fcn.004133a0
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 0x40f5bc
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.0040f195
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.0040f195
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.00410126
cmp dword [ebp + 0x68], 0
je 0x40f5b7
xor eax, eax
mov dword [ebp + 0x6c], eax
jmp 0x40f475
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.004100ea
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.0041016f
push dword [ebp + 0x64]
mov eax, dword [ebx + 0xb4]
call fcn.0041010f
mov eax, dword [ebp + 0x6c]
test eax, eax
lea esi, [ebp + 0x1c]
jbe 0x40f4de
lea esi, [ebp + eax - 0x2150]
xor eax, eax
mov cl, byte [eax + esi]
xor byte [edi + eax], cl
inc eax
cmp eax, 8
jb 0x40f4e0
add dword [ebp + 0x6c], 8
mov eax, dword [ebp + 0x5c]
mov ecx, dword [ebp + 0x6c]
cmp ecx, dword [eax + 0x68]
jb 0x40f472
push dword [ebp + 0x68]
mov eax, dword [ebx + 0xb4]
call fcn.0041010f
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.0040f099
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.0040f099
push 5
pop ecx
lea edi, [ebp - 0x1138]
lea esi, [ebp - 0x148]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x40f5b7
push dword [ebp + 0x78]
lea eax, [ebp - 0x1120]
push 0x40
push eax
push 0x8004
mov eax, ebx
mov dword [ebp + 0x60], 1
call fcn.0040ed27
mov eax, dword [ebp + 0x60]
jmp 0x40f5c8
mov dword [ebx + 0x31c], 0xfffffffe
xor eax, eax
pop edi
pop esi
add ebp, 0x70
leave
ret 8