Function at 0x46b9c0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x30
push ebx
mov ebx, dword [esp + 0x3c]
push ebp
mov ebp, dword [esp + 0x3c]
push esi
push edi
mov dword [esp + 0x44], 0
cmp ecx, 0x3000
je 0x46b9ec
mov byte [esp + 0x10], 0
cmp ecx, 0x4000
jne 0x46b9f1
mov byte [esp + 0x10], 1
movzx eax, byte [esp + 0x10]
mov edx, dword [esp + 0x58]
neg eax
sbb eax, eax
push 0
and eax, 0x1a1
add eax, 0x60
push 0
push eax
mov eax, dword [edx]
push ebp
lea esi, [esp + 0x28]
call fcn.00468d40
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x46bc76
push 0xbc
push eax
push ebp
call fcn.00493620
mov eax, 0x10000
mov dword [ebp + 0x30], eax
mov dword [ebp + 0x3c], eax
movzx eax, byte [esp + 0x1c]
mov esi, 0xffff
add esp, 0xc
neg eax
sbb eax, eax
and eax, 0x1d1
add eax, 0x30
mov dword [ebp + 0x20], 0xff9c0000
mov dword [ebp + 0x24], 0x320000
mov dword [ebp + 0x2c], 2
mov dword [ebp + 0x9c], 0x2210
mov dword [ebp], esi
mov dword [ebp + 4], esi
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], esi
mov dword [ebp + 0x10], esi
mov dword [ebp + 0x14], esi
mov dword [ebp + 0x80], esi
mov dword [ebp + 0x84], esi
mov dword [ebp + 0x88], esi
mov dword [ebp + 0xac], esi
mov dword [ebp + 0xb8], eax
cmp dword [ebx + 0xc], edi
je 0x46bafb
mov eax, dword [esp + 0x4c]
lea ecx, [esp + 0x14]
push ecx
lea edx, [esp + 0x48]
push edx
push eax
mov esi, ebx
call fcn.0046a2c0
mov edi, eax
add esp, 0xc
mov esi, 0xffff
test edi, edi
jne 0x46bae5
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x44]
add ecx, eax
push ecx
lea edi, [esp + 0x1c]
call fcn.00469a70
add esp, 4
mov edi, eax
cmp dword [ebx + 0xc], 0
je 0x46bb3b
cmp dword [ebx + 0x20], 0
jne 0x46bb4d
mov ecx, dword [ebx]
lea eax, [esp + 0x44]
push eax
push ecx
jmp 0x46bb45
mov ecx, dword [ebx + 0x14]
mov edx, dword [esp + 0x50]
push ecx
push edx
call fcn.0043ef10
mov edi, eax
add esp, 8
test edi, edi
jne 0x46bc76
mov ecx, dword [ebx + 0x18]
mov edx, dword [esp + 0x50]
lea eax, [esp + 0x44]
push eax
push ecx
push edx
call fcn.00443560
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x46bc76
mov ecx, dword [ebx + 0x18]
jmp 0x46bad0
mov eax, dword [esp + 0x50]
lea edx, [esp + 0x44]
push edx
push eax
call fcn.00441480
add esp, 8
test edi, edi
jne 0x46bc76
cmp dword [ebp + 0x84], esi
jne 0x46bc76
mov eax, dword [esp + 0x58]
push edi
push edi
push ebp
call fcn.0046b800
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x46bc76
cmp byte [esp + 0x10], al
jne 0x46bc1c
mov edx, dword [esp + 0x5c]
mov ecx, dword [edx + 0x80]
cmp dword [ecx + 0x3c], 0xffffffff
jne 0x46bbc3
mov edx, dword [edx + 0x60]
mov eax, dword [edx + 0x44]
mov dword [ebp + 0x288], eax
mov ecx, dword [edx + 0x44]
test ecx, ecx
je 0x46bc07
mov eax, ecx
shl eax, 0xd
xor eax, ecx
mov ecx, eax
shr ecx, 0x11
xor eax, ecx
mov ecx, eax
shl ecx, 5
xor ecx, eax
jl 0x46bba7
mov dword [edx + 0x44], ecx
jmp 0x46bc07
mov ecx, dword [ecx + 0x3c]
mov dword [ebp + 0x288], ecx
mov eax, dword [edx + 0x80]
cmp dword [eax + 0x3c], 0
je 0x46bc07
lea ecx, [eax + 0x3c]
mov eax, dword [ecx]
lea ecx, [ecx]
mov esi, eax
shl esi, 0xd
xor eax, esi
mov esi, eax
shr esi, 0x11
xor eax, esi
mov esi, eax
shl esi, 5
xor esi, eax
mov dword [ecx], esi
mov ecx, dword [edx + 0x80]
mov eax, dword [ecx + 0x3c]
add ecx, 0x3c
test eax, eax
js 0x46bbe0
cmp dword [ebp + 0x288], 0
jne 0x46bc1c
mov ecx, dword [ebp + 0x214]
mov dword [ebp + 0x288], ecx
mov eax, dword [ebp + 0x218]
test eax, eax
je 0x46bc76
mov edx, dword [ebp + 0x74]
add edx, eax
add edx, dword [esp + 0x54]
mov eax, dword [esp + 0x50]
push edx
push eax
call fcn.0043ef10
mov edi, eax
add esp, 8
test edi, edi
jne 0x46bc76
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x50]
push ecx
lea esi, [ebp + 0x260]
push 1
call fcn.00469e10
mov edi, eax
add esp, 8
test edi, edi
jne 0x46bc76
push eax
push eax
add ebp, 0x284
push ebp
push esi
call fcn.0046a150
add esp, 0x10
mov edi, eax
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x18]
mov ecx, dword [eax]
push edx
push ecx
call fcn.0043fac0
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret