Function at 0x4049fa
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x6c
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x98]
mov ebx, ecx
push eax
lea ecx, [esp + 0x64]
call fcn.00401aec
cmp dword [esp + 0x74], 8
lea edx, [esp + 0x60]
push dword [esp + 0x70]
cmovae edx, dword [esp + 0x64]
call fcn.00404972
push 0
push 1
lea ecx, [esp + 0x68]
mov esi, eax
call fcn.00402572
xor edx, edx
mov ecx, 0x98967f
mov eax, esi
div ecx
inc edx
mov dword [0x497560], edx
call fcn.0040493f
mov eax, dword [esp + 0x90]
lea ecx, [esp + 0x80]
xor edx, edx
cmp dword [esp + 0x94], 8
push 0xf
cmovae ecx, dword [esp + 0x84]
pop ebp
push dword [esp + 0x80]
mov dword [esp + 0x48], ebp
lea eax, [ecx + eax*2]
mov dword [esp + 0x44], edx
lea ecx, [esp + 0x84]
mov byte [esp + 0x34], dl
cmovae ecx, dword [esp + 0x84]
push eax
push ecx
lea ecx, [esp + 0x6c]
mov dword [esp + 0x80], ebp
mov dword [esp + 0x7c], edx
mov byte [esp + 0x6c], dl
call fcn.00405052
cmp dword [esp + 0x44], 0x10
lea eax, [esp + 0x30]
push 0xffffffffffffffff
cmovae eax, dword [esp + 0x34]
lea ecx, [esp + 0x34]
sub ecx, eax
xor ebp, ebp
push ebp
lea eax, [esp + 0x68]
push eax
push ebp
push ecx
lea ecx, [esp + 0x44]
call fcn.00404d1a
push ebp
push 1
lea ecx, [esp + 0x68]
call fcn.00401e61
cmp dword [esp + 0x44], 0x10
lea eax, [esp + 0x30]
lea ecx, [esp + 0x60]
cmovae eax, dword [esp + 0x30]
push eax
call fcn.00401abf
lea edx, [esp + 0x60]
lea ecx, [esp + 0x48]
call fcn.004030fe
push ebp
push 1
lea ecx, [esp + 0x68]
call fcn.00401e61
push dword [esp + 0x58]
call fcn.0040dcc3
pop ecx
mov ecx, dword [esp + 0x58]
xor edi, edi
mov ebp, eax
test ecx, ecx
je 0x404b51
cmp dword [esp + 0x5c], 0x10
lea esi, [esp + 0x48]
cmovae esi, dword [esp + 0x48]
call fcn.0040493f
xor al, byte [esi + edi]
mov byte [edi + ebp], al
inc edi
mov ecx, dword [esp + 0x58]
cmp edi, ecx
jb 0x404b2f
push dword [esp + 0x80]
and dword [esp + 0x2c], 0
lea eax, [ecx + ebp]
push eax
push ebp
lea ecx, [esp + 0x24]
mov dword [esp + 0x38], 0xf
mov byte [esp + 0x24], 0
call fcn.00404c79
and dword [ebx + 0x10], 0
lea esi, [esp + 0x18]
xor eax, eax
mov dword [ebx + 0x14], 7
mov word [ebx], ax
mov ecx, ebx
cmp dword [esp + 0x2c], 0x10
lea eax, [esp + 0x18]
cmovae esi, dword [esp + 0x18]
add esi, dword [esp + 0x28]
cmp dword [esp + 0x2c], 0x10
cmovae eax, dword [esp + 0x18]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x14]
push eax
call fcn.0040241d
cmp dword [ebx + 0x14], 8
mov ebp, dword [eax]
jb 0x404bc4
mov edi, dword [ebx]
jmp 0x404bc6
mov edi, ebx
push dword [esp + 0x80]
and dword [esp + 0x74], 0
lea ecx, [esp + 0x64]
push esi
push dword [esp + 0x18]
xor eax, eax
mov dword [esp + 0x80], 7
mov word [esp + 0x6c], ax
call fcn.004050c7
cmp dword [ebx + 0x14], 8
jb 0x404bfc
mov eax, dword [ebx]
jmp 0x404bfe
mov eax, ebx
test ebp, ebp
je 0x404c06
sub ebp, edi
sar ebp, 1
test edi, edi
je 0x404c0e
sub edi, eax
sar edi, 1
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x68]
mov ecx, ebx
push eax
push ebp
push edi
call fcn.004020cd
xor ebp, ebp
lea ecx, [esp + 0x60]
xor esi, esi
push ebp
inc esi
push esi
call fcn.00402572
push ebp
push esi
lea ecx, [esp + 0x20]
call fcn.00401e61
push ebp
push esi
lea ecx, [esp + 0x50]
call fcn.00401e61
push ebp
push esi
lea ecx, [esp + 0x38]
call fcn.00401e61
push ebp
push esi
lea ecx, [esp + 0x88]
call fcn.00402572
push ebp
push esi
lea ecx, [esp + 0xa0]
call fcn.00402572
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x6c
ret 0x30