Function at 0x404850
Capabilities:
Encode data using xor

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x14
push ebx
lea ebx, [eax + 0xa]
push ebp
push esi
and ebx, 0x80000007
push edi
jns 0x40486b
dec ebx
or ebx, 0xfffffff8
inc ebx
je 0x404876
mov ecx, 8
sub ecx, ebx
mov ebx, ecx
mov edi, dword [sym.imp.MSVCRT.dll_rand]
call edi
and al, 0xf8
mov edx, ebx
or al, bl
dec ebx
test edx, edx
mov byte [esp + 0x14], al
mov esi, 1
je 0x40489d
inc ebx
call edi
mov byte [esp + esi + 0x14], al
inc esi
dec ebx
jne 0x404893
mov ecx, dword [esp + 0x38]
mov edi, dword [esp + 0x34]
xor eax, eax
lea ebx, [esp + 0x1c]
mov dword [esp + 0x1c], eax
lea ebp, [esp + 0x1c]
mov dword [esp + 0x20], eax
mov dword [ecx], eax
mov dword [esp + 0x10], 1
sub ebx, edi
cmp esi, 8
jge 0x4048df
call dword [sym.imp.MSVCRT.dll_rand]
mov byte [esp + esi + 0x14], al
mov eax, dword [esp + 0x10]
inc esi
inc eax
mov dword [esp + 0x10], eax
cmp esi, 8
jne 0x404947
lea edx, [esp + 0x14]
xor ecx, ecx
sub ebp, edx
lea eax, [esp + ecx + 0x14]
mov dl, byte [eax + ebp]
xor byte [eax], dl
inc ecx
cmp ecx, 8
jl 0x4048e9
mov eax, dword [esp + 0x30]
push edi
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.004046b0
add esp, 0xc
mov eax, edi
mov dword [esp + 0x34], ebx
mov esi, 8
mov dl, byte [ebx + eax]
mov cl, byte [eax]
xor cl, dl
mov byte [eax], cl
inc eax
dec esi
jne 0x404916
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x20], edx
xor esi, esi
mov edx, dword [ecx]
mov ebp, edi
add edx, 8
mov edi, eax
mov dword [ecx], edx
sub ebx, 8
cmp dword [esp + 0x10], 2
jle 0x4048c3
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4049f9
lea ebx, [esp + 0x1c]
sub ebx, edi
cmp esi, 8
jge 0x404985
mov eax, dword [esp + 0x28]
inc esi
mov cl, byte [eax]
inc eax
mov byte [esp + esi + 0x13], cl
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
dec eax
cmp esi, 8
mov dword [esp + 0x2c], eax
jne 0x4049ed
lea edx, [esp + 0x14]
xor ecx, ecx
sub ebp, edx
lea eax, [esp + ecx + 0x14]
mov dl, byte [eax + ebp]
xor byte [eax], dl
inc ecx
cmp ecx, 8
jl 0x40498f
mov eax, dword [esp + 0x30]
push edi
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.004046b0
add esp, 0xc
mov eax, edi
mov dword [esp + 0x34], ebx
mov esi, 8
mov dl, byte [ebx + eax]
mov cl, byte [eax]
xor cl, dl
mov byte [eax], cl
inc eax
dec esi
jne 0x4049bc
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x20], edx
xor esi, esi
mov edx, dword [ecx]
mov ebp, edi
add edx, 8
mov edi, eax
mov dword [ecx], edx
sub ebx, 8
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x404964
lea ebx, [esp + 0x1c]
mov dword [esp + 0x10], 1
sub ebx, edi
cmp esi, 8
jge 0x404a1e
mov eax, dword [esp + 0x10]
mov byte [esp + esi + 0x14], 0
inc esi
inc eax
mov dword [esp + 0x10], eax
cmp esi, 8
jne 0x404a86
lea eax, [esp + 0x14]
xor ecx, ecx
sub ebp, eax
lea eax, [esp + ecx + 0x14]
mov dl, byte [eax + ebp]
xor byte [eax], dl
inc ecx
cmp ecx, 8
jl 0x404a28
mov eax, dword [esp + 0x30]
push edi
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.004046b0
add esp, 0xc
mov eax, edi
mov dword [esp + 0x34], ebx
mov esi, 8
mov dl, byte [ebx + eax]
mov cl, byte [eax]
xor cl, dl
mov byte [eax], cl
inc eax
dec esi
jne 0x404a55
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x20], edx
xor esi, esi
mov edx, dword [ecx]
mov ebp, edi
add edx, 8
mov edi, eax
mov dword [ecx], edx
sub ebx, 8
cmp dword [esp + 0x10], 7
jle 0x404a07
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret