Function at 0x40bb1c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe8
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40bb39
mov eax, 0xffffff9a
jmp 0x40bda0
mov ebx, eax
cmp dword [ebx + 0x38], 0
jne 0x40bb4b
mov eax, 0xffffff9a
jmp 0x40bda0
cmp dword [ebx + 0x9c], 0
je 0x40bb5b
push eax
call fcn.0040c158
pop ecx
lea edx, [ebp - 0xc]
push edx
lea ecx, [ebp - 8]
push ecx
lea eax, [ebp - 4]
push eax
push ebx
call fcn.0040b91c
add esp, 0x10
test eax, eax
je 0x40bb7e
mov eax, 0xffffff99
jmp 0x40bda0
push 0x90
call fcn.0041fe70
pop ecx
mov esi, eax
test esi, esi
jne 0x40bb99
mov eax, 0xffffff98
jmp 0x40bda0
push 0x4000
call fcn.0041fe70
pop ecx
mov dword [esi], eax
mov edx, dword [ebp - 8]
xor eax, eax
mov dword [esi + 0x44], edx
mov ecx, dword [ebp - 0xc]
mov dword [esi + 0x48], ecx
mov dword [esi + 0x4c], eax
mov edx, dword [ebp + 0x14]
mov dword [esi + 0x8c], edx
cmp dword [esi], 0
jne 0x40bbda
test esi, esi
je 0x40bbd0
push esi
call fcn.0041fe80
pop ecx
mov eax, 0xffffff98
jmp 0x40bda0
xor edx, edx
mov dword [esi + 0x40], edx
cmp dword [ebp + 0xc], 0
je 0x40bbed
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebx + 0x54]
mov dword [ecx], eax
test edi, edi
je 0x40bc22
mov dword [edi], 6
mov edx, dword [ebx + 0x50]
and edx, 6
sub edx, 2
je 0x40bc1c
sub edx, 2
je 0x40bc14
sub edx, 2
jne 0x40bc22
mov dword [edi], 1
jmp 0x40bc22
mov dword [edi], 2
jmp 0x40bc22
mov dword [edi], 9
mov eax, dword [ebx + 0x54]
test eax, eax
je 0x40bc2c
cmp eax, 8
mov edx, dword [ebx + 0x5c]
xor ecx, ecx
mov dword [esi + 0x54], edx
mov dword [esi + 0x50], ecx
mov eax, dword [ebx + 0x54]
lea edi, [esi + 0x60]
mov dword [esi + 0x84], eax
mov ecx, 8
mov edx, dword [ebx + 0x20]
mov dword [esi + 0x80], edx
push esi
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
pop esi
mov eax, dword [ebx + 0x2c]
xor edx, edx
mov dword [esi + 0x88], eax
mov dword [esi + 0x18], edx
cmp dword [ebx + 0x54], 8
jne 0x40bcae
cmp dword [ebp + 0x14], 0
jne 0x40bcae
xor ecx, ecx
xor eax, eax
mov dword [esi + 0x24], ecx
mov dword [esi + 0x28], eax
xor edx, edx
xor ecx, ecx
mov dword [esi + 0x2c], edx
mov dword [esi + 4], ecx
xor eax, eax
lea edx, [esi + 4]
mov dword [esi + 8], eax
push 0x38
push 0x431221
push 0xfffffffffffffff1
push edx
call fcn.004070b0
add esp, 0x10
test eax, eax
jne 0x40bda0
mov dword [esi + 0x40], 1
mov ecx, dword [ebx + 0x60]
mov dword [esi + 0x58], ecx
mov eax, dword [ebx + 0x64]
mov dword [esi + 0x5c], eax
mov edx, dword [ebx + 0x98]
add edx, dword [ebp - 4]
add edx, 0x1e
mov dword [esi + 0x3c], edx
xor ecx, ecx
mov dword [esi + 8], ecx
mov dword [ebx + 0x9c], esi
cmp dword [ebp + 0x18], 0
je 0x40bd9e
call fcn.00404b4c
mov esi, eax
lea eax, [ebx + 0xa4]
mov dword [ebx + 0xb0], esi
push esi
push eax
mov edx, dword [ebp + 0x18]
push edx
call fcn.0040ad3c
add esp, 0xc
push 0
mov eax, dword [ebx + 0x9c]
mov edx, dword [eax + 0x3c]
add edx, dword [eax + 0x88]
push edx
mov ecx, dword [ebx + 0x20]
push ecx
mov eax, dword [ebx + 0x1c]
push eax
call dword [ebx + 0x10]
add esp, 0x10
test eax, eax
je 0x40bd2a
mov eax, 0xffffff98
jmp 0x40bda0
push 0xc
lea edx, [ebp - 0x18]
push edx
mov ecx, dword [ebx + 0x20]
push ecx
mov eax, dword [ebx + 0x1c]
push eax
call dword [ebx + 4]
add esp, 0x10
cmp eax, 0xc
jae 0x40bd4a
mov eax, 0xffffff98
jmp 0x40bda0
xor edi, edi
lea esi, [ebp - 0x18]
mov eax, dword [ebx + 0xb0]
push eax
lea edx, [ebx + 0xa4]
push edx
call fcn.0040acb8
add esp, 8
xor byte [esi], al
mov cl, byte [esi]
movsx eax, cl
push eax
mov edx, dword [ebx + 0xb0]
push edx
lea ecx, [ebx + 0xa4]
push ecx
call fcn.0040ace0
add esp, 0xc
inc edi
inc esi
cmp edi, 0xc
jl 0x40bd4f
mov eax, dword [ebx + 0x9c]
add dword [eax + 0x3c], 0xc
mov dword [ebx + 0xa0], 1
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret