Function at 0x40650a
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
mov ebx, dword [ebp + 8]
push edi
xor edi, edi
cmp ebx, edi
jne 0x406523
push 0xffffffffffffff9a
pop eax
jmp 0x40676e
cmp dword [ebx + 0x38], edi
je 0x40651b
cmp dword [ebx + 0x9c], edi
je 0x406537
push ebx
call fcn.004062b9
pop ecx
push esi
lea eax, [ebp - 4]
push eax
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0xc]
push eax
mov esi, ebx
call fcn.00405ed7
add esp, 0xc
test eax, eax
je 0x406559
push 0xffffffffffffff99
jmp 0x406711
push 0x90
call fcn.004017f5
mov esi, eax
cmp esi, edi
pop ecx
mov dword [ebp - 8], esi
je 0x40670f
push 0x4000
call fcn.004017f5
cmp eax, edi
pop ecx
mov ecx, dword [ebp + 8]
mov dword [esi + 0x44], ecx
mov ecx, dword [ebp - 4]
mov dword [esi + 0x48], ecx
mov ecx, dword [ebp + 0x14]
mov dword [esi], eax
mov dword [esi + 0x4c], edi
mov dword [esi + 0x8c], ecx
jne 0x4065a6
push esi
call fcn.00401809
pop ecx
jmp 0x40670f
mov eax, dword [ebp + 0xc]
cmp eax, edi
mov dword [esi + 0x40], edi
je 0x4065b5
mov ecx, dword [ebx + 0x54]
mov dword [eax], ecx
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
je 0x4065e7
push 6
pop edx
mov dword [ecx], edx
mov eax, dword [ebx + 0x50]
and eax, edx
push 2
pop edx
sub eax, edx
je 0x4065e1
sub eax, edx
je 0x4065dd
sub eax, edx
jne 0x4065e7
mov dword [ecx], 1
jmp 0x4065e7
mov dword [ecx], edx
jmp 0x4065e7
mov dword [ecx], 9
mov eax, dword [ebx + 0x5c]
mov dword [esi + 0x50], edi
mov dword [esi + 0x54], eax
mov eax, dword [ebx + 0x54]
mov dword [esi + 0x84], eax
mov eax, dword [ebx + 0x20]
mov dword [esi + 0x80], eax
lea edi, [esi + 0x60]
push 8
pop ecx
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 0x2c]
mov edi, dword [ebp - 8]
xor esi, esi
mov dword [edi + 0x88], eax
mov dword [edi + 0x18], esi
cmp dword [ebx + 0x54], 8
jne 0x40665a
cmp dword [ebp + 0x14], esi
jne 0x40665a
push 0x38
push 0x407244
lea eax, [edi + 4]
push 0xfffffffffffffff1
push eax
mov dword [edi + 0x24], esi
mov dword [edi + 0x28], esi
mov dword [edi + 0x2c], esi
mov dword [eax], esi
mov dword [edi + 8], esi
call fcn.00403037
add esp, 0x10
cmp eax, esi
jne 0x40676d
mov dword [edi + 0x40], 1
mov eax, dword [ebx + 0x60]
mov ecx, dword [ebp - 0xc]
mov dword [edi + 0x58], eax
mov eax, dword [ebx + 0x64]
mov dword [edi + 0x5c], eax
mov eax, dword [ebx + 0x98]
lea eax, [eax + ecx + 0x1e]
mov dword [edi + 0x3c], eax
mov dword [edi + 8], esi
mov dword [ebx + 0x9c], edi
mov edi, dword [ebp + 0x18]
cmp edi, esi
je 0x40676b
call fcn.00401e89
mov dword [ebx + 0xb0], eax
lea esi, [ebx + 0xa4]
mov dword [ebp - 0xc], eax
mov dword [esi], 0x12345678
mov dword [esi + 4], 0x23456789
mov dword [esi + 8], 0x34567890
mov al, byte [edi]
mov dword [ebp + 8], edi
jmp 0x4066d2
mov edi, dword [ebp - 0xc]
movsx eax, al
push eax
mov ecx, esi
call fcn.004058a1
add esp, 4
inc dword [ebp + 8]
mov eax, dword [ebp + 8]
mov al, byte [eax]
test al, al
jne 0x4066b9
mov eax, dword [ebx + 0x9c]
mov ecx, dword [eax + 0x88]
add ecx, dword [eax + 0x3c]
push 0
push ecx
push dword [ebx + 0x20]
push dword [ebx + 0x1c]
call dword [ebx + 0x10]
add esp, 0x10
test eax, eax
jne 0x40670f
push 0xc
lea eax, [ebp - 0x18]
push eax
push dword [ebx + 0x20]
push dword [ebx + 0x1c]
call dword [ebx + 4]
add esp, 0x10
cmp eax, 0xc
jae 0x406714
push 0xffffffffffffff98
pop eax
jmp 0x40676d
and dword [ebp + 8], 0
mov eax, dword [ebx + 0xac]
mov edi, dword [ebp + 8]
and eax, 0xfffd
or eax, 2
mov ecx, eax
xor ecx, 1
imul ecx, eax
lea edi, [ebp + edi - 0x18]
shr ecx, 8
xor byte [edi], cl
movsx eax, byte [edi]
mov edi, dword [ebx + 0xb0]
push eax
mov ecx, esi
call fcn.004058a1
add esp, 4
inc dword [ebp + 8]
cmp dword [ebp + 8], 0xc
jl 0x406718
mov eax, dword [ebx + 0x9c]
add dword [eax + 0x3c], 0xc
mov dword [ebx + 0xa0], 1
xor eax, eax
pop esi
pop edi
pop ebx
leave
ret