Function at 0x4c6018
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x20
mov eax, dword [esp + 0x28]
push ebx
push ebp
push esi
lea ebx, [eax + 0xa]
mov esi, 1
and ebx, 0x80000007
push edi
mov dword [esp + 0x10], esi
jns 0x4c603c
dec ebx
or ebx, 0xfffffff8
inc ebx
je 0x4c6047
mov ecx, 8
sub ecx, ebx
mov ebx, ecx
mov edi, dword [fcn.004b46f4]
call edi
and al, 0xf8
mov dword [esp + 0x18], esi
or al, bl
test ebx, ebx
mov byte [esp + 0x24], al
jle 0x4c6069
call edi
mov byte [esp + esi + 0x24], al
inc esi
dec ebx
jne 0x4c605f
mov edx, dword [esp + 0x44]
mov edi, dword [esp + 0x40]
xor eax, eax
lea ebp, [esp + 0x1c]
mov dword [esp + 0x1c], eax
mov dword [edx], 0
mov dword [esp + 0x14], 0
mov ebx, edi
mov dword [esp + 0x20], eax
sub ebp, edi
cmp esi, 8
jge 0x4c60ad
call dword [fcn.004b46f4]
mov byte [esp + esi + 0x24], al
mov eax, dword [esp + 0x10]
inc esi
inc eax
mov dword [esp + 0x10], eax
cmp esi, 8
jne 0x4c611c
xor eax, eax
mov cl, byte [esp + eax + 0x1c]
mov bl, byte [esp + eax + 0x24]
xor bl, cl
mov byte [esp + eax + 0x24], bl
inc eax
cmp eax, 8
jl 0x4c60b1
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
push edx
lea ecx, [esp + 0x28]
push eax
push ecx
call fcn.004c64f8
add esp, 0xc
mov eax, edi
mov dword [esp + 0x18], ebp
mov ecx, 8
mov dl, byte [eax + ebp]
mov bl, byte [eax]
xor bl, dl
mov byte [eax], bl
inc eax
dec ecx
jne 0x4c60e7
mov ecx, dword [esp + 0x28]
mov ebx, edi
mov edi, eax
mov eax, dword [esp + 0x14]
add eax, 8
sub ebp, 8
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x24]
xor esi, esi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x18], esi
cmp dword [esp + 0x10], 2
jle 0x4c6091
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x34]
test eax, eax
mov dword [esp + 0x40], edx
jle 0x4c61fc
mov ebp, edi
mov edx, ebx
neg ebp
neg edx
cmp esi, 8
jge 0x4c6164
mov eax, dword [esp + 0x40]
mov cl, byte [eax]
inc eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x38]
mov byte [esp + esi + 0x24], cl
inc esi
dec eax
cmp esi, 8
mov dword [esp + 0x38], eax
jne 0x4c61f0
mov esi, ebx
lea eax, [esp + 0x24]
xor ecx, ecx
lea edx, [esp + edx + 0x1c]
sub esi, eax
mov eax, dword [esp + 0x18]
test eax, eax
lea eax, [esp + ecx + 0x24]
je 0x4c618c
lea ebx, [esi + edx]
mov bl, byte [ebx + eax]
jmp 0x4c618f
mov bl, byte [esi + eax]
xor byte [eax], bl
inc ecx
cmp ecx, 8
jl 0x4c6178
mov ecx, dword [esp + 0x3c]
push edi
lea edx, [esp + 0x28]
push ecx
push edx
mov dword [esp + 0x24], 0
call fcn.004c64f8
add esp, 0xc
mov eax, edi
lea esi, [esp + ebp + 0x1c]
mov ecx, 8
mov dl, byte [eax + esi]
mov bl, byte [eax]
xor bl, dl
mov byte [eax], bl
inc eax
dec ecx
jne 0x4c61bd
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x28]
add ecx, 8
mov dword [esp + 0x20], edx
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x24]
mov edx, ebp
mov ebx, edi
sub ebp, 8
mov dword [esp + 0x1c], ecx
mov edi, eax
xor esi, esi
mov eax, dword [esp + 0x38]
test eax, eax
jg 0x4c6143
lea ebp, [esp + 0x1c]
mov dword [esp + 0x10], 1
sub ebp, edi
cmp esi, 8
jge 0x4c6226
mov ecx, dword [esp + 0x10]
lea eax, [esp + esi + 0x24]
inc ecx
inc esi
mov dword [eax], 0
mov dword [esp + 0x10], ecx
cmp esi, 8
jne 0x4c6296
mov esi, ebx
lea edx, [esp + 0x24]
xor ecx, ecx
sub esi, edx
mov bl, byte [esp + ecx + 0x24]
lea eax, [esp + ecx + 0x24]
mov dl, byte [esi + eax]
xor bl, dl
inc ecx
cmp ecx, 8
mov byte [eax], bl
jl 0x4c6232
mov eax, dword [esp + 0x3c]
push edi
lea ecx, [esp + 0x28]
push eax
push ecx
call fcn.004c64f8
add esp, 0xc
mov eax, edi
mov dword [esp + 0x18], ebp
mov ecx, 8
mov dl, byte [eax + ebp]
mov bl, byte [eax]
xor bl, dl
mov byte [eax], bl
inc eax
dec ecx
jne 0x4c6265
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x14]
add ecx, 8
mov ebx, edi
sub ebp, 8
mov dword [esp + 0x20], edx
mov dword [esp + 0x14], ecx
mov edi, eax
xor esi, esi
cmp dword [esp + 0x10], 8
jl 0x4c620a
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
mov dword [ecx], eax
pop ebx
add esp, 0x20
ret