Function at 0x5039fba
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5073cd7
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x295c
call fcn.050704b0
mov eax, dword [0x509ddfc]
xor eax, esp
mov dword [esp + 0x2958], eax
push ebx
push esi
push edi
mov eax, dword [0x509ddfc]
xor eax, esp
push eax
lea eax, [esp + 0x2970]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov eax, dword [edi + 4]
xor ebx, ebx
add eax, 0x60
mov esi, ecx
push ebx
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], edi
call fcn.050148cd
cmp dword [esi], ebx
pop ecx
pop ecx
jne 0x503a03a
mov eax, dword [edi + 4]
push ebx
push 0x88b
push 0x4ce3
push eax
call fcn.05062683
add esp, 0x10
mov dword [esi], eax
mov ecx, edi
mov dword [esp + 0x2c], edi
call fcn.0503f80c
mov dword [esp + 0x2978], ebx
mov dword [esp + 0x10], ebx
jmp 0x503a056
mov edi, dword [esp + 0x1c]
xor esi, esi
lea eax, [esp + 0x4e]
inc esi
mov ecx, esi
shr ecx, 1
cmp dword [esp + 0x10], ebx
movzx edx, cx
movzx ecx, dx
je 0x503a072
mov ecx, 0x8000
cmp dword [esp + 0x10], 1
mov word [eax - 2], cx
movzx ecx, dx
je 0x503a085
mov ecx, 0x8000
cmp dword [esp + 0x10], 2
mov word [eax], cx
movzx ecx, dx
je 0x503a097
mov ecx, 0x8000
cmp dword [esp + 0x10], 3
mov word [eax + 2], cx
movzx ecx, dx
je 0x503a0aa
mov ecx, 0x8000
mov word [eax + 4], cx
add esi, 0x101
add eax, 8
cmp esi, 0x10101
jb 0x503a05d
push ebx
push 0x504c4142
push 0x434d594b
push 0x100
lea eax, [esp + 0x5c]
push eax
push eax
mov ecx, edi
call fcn.0506bbf5
movzx esi, word [esp + 0x846]
movzx edi, word [esp + 0x848]
mov dword [esp + 0x14], ebx
xor ecx, ecx
movzx eax, word [esp + ecx*8 + 0x4e]
sub eax, esi
jns 0x503a0fd
neg eax
mov dword [esp + 0x18], eax
movzx eax, word [esp + ecx*8 + 0x50]
sub eax, edi
jns 0x503a10c
neg eax
movzx ebx, word [esp + 0x84a]
mov edx, eax
movzx eax, word [esp + ecx*8 + 0x52]
sub eax, ebx
jns 0x503a121
neg eax
add eax, edx
add eax, dword [esp + 0x18]
test ecx, ecx
jne 0x503a133
test eax, eax
je 0x503a16a
mov dword [esp + 0x14], eax
cmp eax, dword [esp + 0x14]
ja 0x503a16a
xor edx, edx
shl eax, 0xf
div dword [esp + 0x14]
mov edx, 0x8000
sub edx, eax
mov word [esp + ecx*2 + 0x1f14], dx
inc ecx
cmp ecx, 0x100
jb 0x503a0f2
lea ecx, [esp + 0x1f14]
call fcn.0502f325
test al, al
jne 0x503a176
lea ecx, [esp + 0x1f14]
call fcn.0502f30c
push 8
lea ecx, [esp + 0x1f18]
call fcn.0502f341
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x24]
shl eax, 9
lea edi, [eax + ecx + 4]
mov ecx, 0x80
lea esi, [esp + 0x1f14]
lea eax, [esp + 0x2114]
rep movsd dword es:[edi], dword [esi]
push eax
lea ecx, [esp + 0x1f18]
call fcn.0502f4ac
mov esi, dword [esp + 0x10]
xor ebx, ebx
xor edi, edi
imul esi, esi, 0x12
lea esi, [esp + esi + 0x291c]
mov eax, edi
and eax, 0x1ffff
shl eax, 0xc
push eax
lea ecx, [esp + 0x2118]
call fcn.0502f1e6
mov word [esi], ax
inc edi
inc esi
inc esi
cmp edi, 9
jb 0x503a1c7
inc dword [esp + 0x10]
cmp dword [esp + 0x10], 4
jb 0x503a052
lea eax, [esp + 0x291c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], eax
and dword [esp + 0x10], 0
lea eax, [esp + 0x84e]
mov ecx, dword [esp + 0x10]
movzx esi, word [esp + ecx*2 + 0x292e]
xor edi, edi
movzx edx, word [esp + edi*2 + 0x2940]
xor ecx, ecx
mov ebx, dword [esp + 0x18]
movzx ebx, word [ebx]
mov word [eax - 2], bx
mov bx, word [esp + ecx*2 + 0x2952]
mov word [eax], si
mov word [eax + 2], dx
mov word [eax + 4], bx
inc ecx
add eax, 8
cmp ecx, 9
jb 0x503a22b
inc edi
cmp edi, 9
jb 0x503a221
inc dword [esp + 0x10]
cmp dword [esp + 0x10], 9
jb 0x503a213
mov ecx, dword [esp + 0x1c]
push 0
push 0x504c4142
push 0x434d594b
push 0x2d9
lea eax, [esp + 0x85c]
push eax
push eax
call fcn.0506bbf5
mov eax, dword [esp + 0x24]
push 1
mov ebx, 0x88b
push ebx
push dword [esp + 0x1c]
lea ecx, [esp + 0x44]
push dword [eax]
call fcn.050623fb
lea ecx, [esp + 0x38]
mov byte [esp + 0x2978], 1
call fcn.05062448
lea edi, [esp + 0x84c]
lea esi, [eax + 2]
mov dword [esp + 0x28], 9
mov dword [esp + 0x20], 9
mov dword [esp + 0x10], 9
mov eax, dword [edi]
mov ecx, dword [edi + 4]
shr eax, 0x10
imul eax, eax, 0xff
add eax, 0x4000
shr eax, 0xf
mov byte [esi - 2], al
movzx eax, cx
push eax
mov dword [esp + 0x38], ecx
call fcn.05030efb
mov byte [esi - 1], al
movzx eax, word [esp + 0x3a]
push eax
call fcn.05030efb
mov byte [esi], al
pop ecx
add esi, 3
add edi, 8
dec dword [esp + 0x14]
pop ecx
jne 0x503a2d4
dec dword [esp + 0x20]
jne 0x503a2cc
dec dword [esp + 0x28]
jne 0x503a2c4
lea ecx, [esp + 0x38]
mov byte [esp + 0x2978], 0
call fcn.0506242e
add dword [esp + 0x14], ebx
add dword [esp + 0x18], 2
cmp dword [esp + 0x14], 0x4ce3
jb 0x503a207
mov ecx, dword [esp + 0x1c]
or dword [esp + 0x2978], 0xffffffff
call fcn.0503f832
mov ecx, dword [esp + 0x2970]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x2958]
xor ecx, esp
call fcn.05070186
mov esp, ebp
pop ebp
ret 4