Function at 0x40d49c
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x30
mov eax, dword [0x4c3014]
xor eax, esp
mov dword [esp + 0x2c], eax
push ebx
push ebp
push esi
push edi
push 0x268
mov ebx, ecx
mov ebp, edx
push 0
push ebx
mov dword [esp + 0x34], ebx
call fcn.0047ed30
xor eax, eax
lea edi, [esp + 0x38]
stosd dword es:[edi], eax
lea esi, [ebx + 0x148]
add esp, 0xc
cmp dword [0x4c6fb0], 0
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
je 0x40d52a
lea eax, [esi + 0xc]
mov dword [esi], 1
mov dword [esi + 8], eax
mov eax, dword [esp + 0x44]
cmp eax, 0x10
je 0x40d510
cmp eax, 0x18
je 0x40d507
cmp eax, 0x20
jne 0x40d517
mov dword [esi + 4], 0xe
jmp 0x40d517
mov dword [esi + 4], 0xc
jmp 0x40d517
mov dword [esi + 4], 0xa
push eax
mov edx, ebp
mov ecx, esi
call fcn.0040c4f3
pop ecx
test eax, eax
jne 0x40d6ef
lea eax, [esp + 0x2c]
mov ecx, esi
push eax
mov edx, eax
call fcn.0040c725
pop ecx
test eax, eax
jne 0x40d6ef
movzx esi, byte [esp + 0x2c]
xor edx, edx
movzx eax, byte [esp + 0x2d]
xor ebp, ebp
movzx ecx, byte [esp + 0x30]
movzx edi, byte [esp + 0x34]
shl esi, 8
or esi, eax
shl ecx, 8
movzx eax, byte [esp + 0x2e]
shl esi, 8
or esi, eax
shl edi, 8
movzx eax, byte [esp + 0x2f]
shl esi, 8
or esi, eax
movzx eax, byte [esp + 0x31]
or ecx, eax
mov dword [ebx + 0xdc], esi
movzx eax, byte [esp + 0x32]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x33]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x35]
or edi, eax
or edx, ecx
movzx eax, byte [esp + 0x36]
movzx ecx, byte [esp + 0x38]
shl edi, 8
or edi, eax
shl ecx, 8
movzx eax, byte [esp + 0x37]
shl edi, 8
or edi, eax
mov dword [esp + 0x18], edx
movzx eax, byte [esp + 0x39]
or ecx, eax
mov dword [ebx + 0xd8], edx
movzx eax, byte [esp + 0x3a]
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x3b]
shl ecx, 8
or ecx, eax
xor eax, eax
or ebp, ecx
mov dword [ebx + 0x98], eax
or edi, eax
mov dword [esp + 0x14], ebp
push 4
mov dword [ebx + 0x58], ebp
mov dword [ebx + 0x5c], edi
mov dword [ebx + 0x9c], eax
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], eax
pop ebp
mov eax, dword [esp + 0x14]
shrd dword [esp + 0x14], edi, 1
mov ecx, dword [esp + 0x18]
and eax, 1
shl ecx, 0x1f
shr edi, 1
or edi, ecx
imul edx, eax, 0xe1000000
mov ecx, dword [esp + 0x18]
xor eax, eax
or dword [esp + 0x14], eax
shrd ecx, esi, 1
mov dword [ebx + ebp*8 + 0x1c], edi
shr esi, 1
xor eax, ecx
mov ecx, dword [esp + 0x14]
xor esi, edx
mov dword [ebx + ebp*8 + 0x18], ecx
mov dword [ebx + ebp*8 + 0x98], eax
mov dword [ebx + ebp*8 + 0x9c], esi
sar ebp, 1
mov dword [esp + 0x18], eax
test ebp, ebp
jg 0x40d608
push 2
pop edx
mov dword [esp + 0x18], edx
lea ebp, [edx + 0x13]
lea ebp, [ebx + ebp*8]
mov ecx, dword [ebp]
lea eax, [edx + 3]
mov dword [esp + 0x14], ecx
lea eax, [ebx + eax*8]
mov ecx, dword [ebp + 4]
mov dword [esp + 0x1c], ecx
mov ecx, dword [eax]
mov dword [esp + 0x20], ecx
mov ecx, dword [eax + 4]
mov dword [esp + 0x24], ecx
cmp edx, 1
jle 0x40d6de
lea edi, [ebx + 0x20]
sub ebp, eax
lea ebx, [edx - 1]
mov edx, dword [esp + 0x14]
lea esi, [eax + 8]
mov ecx, dword [edi + 0x80]
mov eax, dword [edi + 0x84]
xor ecx, edx
xor eax, dword [esp + 0x1c]
mov dword [esi + ebp], ecx
mov dword [esi + ebp + 4], eax
mov ecx, dword [edi]
lea edi, [edi + 8]
mov eax, dword [edi - 4]
xor ecx, dword [esp + 0x20]
xor eax, dword [esp + 0x24]
mov dword [esi], ecx
lea esi, [esi + 8]
mov dword [esi - 4], eax
sub ebx, 1
jne 0x40d6a0
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 0x28]
add edx, edx
mov dword [esp + 0x18], edx
cmp edx, 0x10
jl 0x40d665
xor eax, eax
mov ecx, dword [esp + 0x3c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0047c71d
add esp, 0x30
ret