Function at 0x502ae62
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x504efd4
call fcn.05040548
sub esp, 0xa5c
push ebx
push esi
xor ebx, ebx
push edi
mov esi, ecx
push ebx
mov dword [ebp - 0x24], esi
call fcn.05008155
cmp dword [esi], ebx
mov edi, dword [ebp + 8]
pop ecx
jne 0x502aea3
mov eax, dword [edi + 4]
push ebx
push 0x300
push 0x3000
push eax
call fcn.0502998c
add esp, 0x10
mov dword [esi], eax
mov ecx, edi
mov dword [ebp - 0x30], edi
call fcn.0500a674
push 1
mov dword [ebp - 4], ebx
lea ecx, [ebp - 0xa64]
pop edx
mov eax, edx
add edx, 0x101
shr eax, 1
mov word [ecx - 2], ax
mov word [ecx], ax
mov word [ecx + 2], ax
add ecx, 8
cmp edx, 0x10101
jb 0x502aeb9
mov esi, 0x50524742
push ebx
push esi
mov ebx, pe_nt_image_headers32
push esi
lea eax, [ebp - 0xa68]
push ebx
push eax
lea eax, [ebp - 0xa68]
mov ecx, edi
push eax
call fcn.05012525
lea ecx, [ebp - 0x264]
lea eax, [ebp - 0xa66]
mov dword [ebp - 0x14], ebx
movzx edx, word [eax + 2]
movzx edi, word [eax + 4]
imul edx, edx, 0x25c3
imul edi, edi, 0x70a
add edx, edi
movzx edi, word [eax]
imul edi, edi, 0x1333
add eax, 8
lea edx, [edx + edi + 0x2000]
shr edx, 0xe
mov word [ecx], dx
inc ecx
inc ecx
dec dword [ebp - 0x14]
jne 0x502af0b
lea ecx, [ebp - 0x264]
call fcn.0503f9ad
test al, al
jne 0x502af5b
lea ecx, [ebp - 0x264]
call fcn.0503f994
push 2
lea ecx, [ebp - 0x264]
call fcn.0503f9cd
mov eax, dword [ebp - 0x24]
lea edx, [ebp - 0x264]
add eax, 0x204
mov edi, ebx
mov cx, word [edx]
mov word [eax - 0x200], cx
mov word [eax], cx
mov word [eax + 0x200], cx
inc eax
inc eax
inc edx
inc edx
dec edi
jne 0x502af78
lea eax, [ebp - 0xa68]
lea ecx, [ebp - 0x264]
push eax
call fcn.0503fb4d
lea edi, [ebp - 0x64]
mov dword [ebp - 0x10], 7
mov eax, dword [ebp - 0x10]
push 0xf
xor edx, edx
pop ecx
div ecx
lea ecx, [ebp - 0xa68]
push eax
call fcn.0503f87f
add dword [ebp - 0x10], 0x8000
mov word [edi], ax
inc edi
inc edi
cmp dword [ebp - 0x10], 0x80007
jb 0x502afaf
and dword [ebp - 0x10], 0
lea eax, [ebp - 0x64]
mov dword [ebp - 0x14], eax
mov edi, 0x4000
lea ecx, [ebp - 0x64]
lea eax, [ebp - 0xa64]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], 0x10
lea ecx, [ebp - 0x64]
mov dword [ebp - 0x18], 0x10
mov edx, dword [ebp - 0x14]
mov dx, word [edx]
mov word [eax - 2], dx
mov edx, dword [ebp - 0x20]
mov dx, word [edx]
mov word [eax], dx
mov dx, word [ecx]
mov word [eax + 2], dx
add eax, 8
inc ecx
inc ecx
dec dword [ebp - 0x18]
jne 0x502b006
add dword [ebp - 0x20], 2
dec dword [ebp - 0x1c]
jne 0x502affc
mov ecx, dword [ebp + 8]
push 0
push esi
push esi
lea eax, [ebp - 0xa68]
push ebx
push eax
lea eax, [ebp - 0xa68]
push eax
call fcn.05012525
mov eax, dword [ebp - 0x24]
push 1
push 0x300
lea ecx, [ebp - 0x44]
push dword [ebp - 0x10]
push dword [eax]
call fcn.0502968c
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 1
call fcn.050296d8
lea ecx, [ebp - 0xa68]
add eax, 2
mov dword [ebp - 0x18], 0x10
mov dword [ebp - 0x1c], 0x10
mov edx, dword [ecx]
add ecx, 8
mov dword [ebp - 0x2c], edx
mov edx, dword [ecx - 4]
mov dword [ebp - 0x28], edx
movzx edx, word [ebp - 0x2a]
imul edx, edx, 0xff
add edx, edi
shr edx, 0xf
mov byte [eax - 2], dl
movzx edx, word [ebp - 0x28]
imul edx, edx, 0xff
add edx, edi
shr edx, 0xf
mov byte [eax - 1], dl
movzx edx, word [ebp - 0x26]
imul edx, edx, 0xff
add edx, edi
shr edx, 0xf
mov byte [eax], dl
add eax, 3
dec dword [ebp - 0x1c]
jne 0x502b088
dec dword [ebp - 0x18]
jne 0x502b081
and byte [ebp - 4], 0
lea ecx, [ebp - 0x44]
call fcn.050296bf
add dword [ebp - 0x10], 0x300
add dword [ebp - 0x14], 2
cmp dword [ebp - 0x10], 0x3000
jb 0x502afe9
mov ecx, dword [ebp + 8]
or dword [ebp - 4], 0xffffffff
call fcn.0500a69a
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 4