Function at 0x46fdd4
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 0x2ac]
cmp dword [edi + 0x114], ecx
jne 0x46fca1
mov edx, dword [esp + 0x18]
push edx
mov ecx, edi
call 0x48c0df
test al, al
je 0x46fca1
mov ecx, 0x10
mov eax, ebx
cmp ecx, 4
jb 0x46fe92
mov edx, dword [esp + 0x28]
lea edx, [edx + edi + 0x114]
mov edx, dword [edx + eax]
cmp edx, dword [eax]
jne 0x46fca1
sub ecx, 4
add eax, 4
jmp 0x46fc7e
mov eax, dword [esp + 0x14]
inc eax
add edi, 0x178
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], edi
cmp eax, 4
jb 0x46fc58
mov ecx, dword [esp + 0x2c]
push 0x200
lea eax, [esp + 0x94]
test byte [esp + edx*4], ah
add byte [eax], al
add byte [eax + 0x51], dl
call fcn.0048f6fc
lea eax, [esp + 0x90]
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46fcda
sub eax, edi
mov edi, dword [esp + 0x2ac]
mov ecx, edi
mov edx, 1
shl edx, cl
lea ecx, [esp + 0x30]
push edx
push ecx
lea edx, [esp + 0x78]
push edx
lea ecx, [esp + 0x5c]
push ecx
push 0x10
push ebx
push eax
lea edx, [esp + 0xac]
push edx
call fcn.00479980
push 0x200
lea eax, [esp + 0x94]
push eax
call fcn.0048c092
mov ecx, dword [esi + 0x5e0]
mov eax, ecx
and eax, 3
imul eax, eax, 0x178
add eax, esi
inc ecx
mov dword [esi + 0x5e0], ecx
mov esi, dword [esp + 0x18]
mov dword [eax + 0x114], edi
mov edi, eax
mov ecx, 0x40
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov ecx, dword [ebx]
mov dword [eax + 0x102], ecx
mov edx, dword [ebx + 4]
mov dword [eax + 0x106], edx
mov ecx, dword [ebx + 8]
mov dword [eax + 0x10a], ecx
mov edx, dword [ebx + 0xc]
mov dword [eax + 0x10e], edx
lea edx, [eax + 0x118]
mov edi, edx
mov ecx, 8
lea esi, [esp + 0x50]
rep movsd dword es:[edi], dword [esi]
push 1
lea edi, [eax + 0x138]
mov ecx, 8
lea esi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
push 0x20
lea edi, [eax + 0x158]
mov ecx, 8
lea esi, [esp + 0x78]
push edx
rep movsd dword es:[edi], dword [esi]
call fcn.0048c023
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x46fdca
mov ecx, 8
lea esi, [esp + 0x70]
rep movsd dword es:[edi], dword [esi]
test ebp, ebp
je 0x46fe41
xor eax, eax
mov dword [ebp], eax
mov dword [ebp + 4], eax
inc ebp
add al, 0x8d
jo 0x46fddc
lea ecx, [eax + 2]
xor edx, edx
mov eax, 1
jmp 0x46fde8
movzx ebx, byte [esp + eax + 0x2f]
mov edi, edx
and edi, 7
xor byte [edi + ebp], bl
movzx ebx, byte [esp + eax + 0x30]
add edi, ebp
mov edi, eax
and edi, 7
xor byte [edi + ebp], bl
movzx ebx, byte [esp + ecx + 0x30]
add edi, ebp
mov edi, ecx
and edi, 7
xor byte [edi + ebp], bl
movzx ebx, byte [esp + esi + 0x30]
add edi, ebp
mov edi, esi
and edi, 7
xor byte [edi + ebp], bl
add edi, ebp
add eax, 4
add edx, 4
add ecx, 4
add esi, 4
cmp eax, 0x21
jb 0x46fde8
push 0x20
lea eax, [esp + 0x34]
push eax
call fcn.0048c1ad
mov eax, dword [esp + 0x24]
pop edi
test eax, eax
je 0x46fe6c
mov edx, dword [esp + 0x294]
push eax
push 0x100
lea ecx, [esp + 0x54]
push ecx
mov ecx, dword [esp + 0x28]
push edx
add ecx, 0x5e8
call fcn.004805d8
push 0x20
lea eax, [esp + 0x50]
push eax
call fcn.0048c1e4
mov ecx, dword [esp + 0x28c]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0049a7c1
add esp, 0x284
ret 0x20
push 0
push 0x20
lea ebx, [edi + 0x118]
push ebx
call fcn.0048c10e
push 1
push 0x20
mov ecx, 8
mov esi, ebx
lea edi, [esp + 0x58]
push ebx
rep movsd dword es:[edi], dword [esi]
call fcn.0048c125
mov eax, dword [esp + 0x10]
lea esi, [eax + 0x138]
mov ecx, 8
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
lea esi, [eax + 0x158]
mov ecx, 8
lea edi, [esp + 0x70]
rep movsd dword es:[edi], dword [esi]
jmp 0x46fdb7