Function at 0x4975c0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x50
mov dword [esp + 0x1c], ecx
mov eax, dword [edx]
mov dword [esp + 0x28], eax
test eax, eax
jle 0x49785f
mov esi, edx
movzx eax, byte [ebp + 0x10]
mov edi, dword [ebp + 0xc]
mov ebx, eax
and bl, 1
xor bl, 0x51
movzx ecx, al
and al, 0xfd
mov edx, dword [esp + 0x1c]
cmp byte [edx + 0x17], 0
movzx eax, al
cmovne eax, ecx
mov ecx, dword [edx + 8]
mov dword [esp + 0x14], ecx
movzx eax, al
mov dword [esp + 0x20], eax
dec edi
mov dword [esp + 0x2c], edi
add esi, 0x14
mov byte [esp + 7], bl
movzx eax, bl
mov dword [esp + 0x24], eax
xor ebx, ebx
jmp 0x497642
mov esi, dword [esp + 0x10]
inc ebx
add esi, 0x10
cmp ebx, dword [esp + 0x28]
jge 0x49785f
mov edi, dword [esi - 0xc]
test byte [esp + 0x20], 4
je 0x4976b0
movzx eax, word [esi]
test eax, eax
je 0x4976b0
test byte [esp + 0x20], 8
jne 0x49777d
add eax, dword [esp + 0x2c]
mov ecx, dword [ebp + 8]
add ecx, ebx
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x14]
mov edx, dword [ecx + 0x6c]
cmp dword [ecx + 0x70], edx
jle 0x497787
mov dword [esp + 0xc], edx
inc edx
mov dword [ecx + 0x6c], edx
mov edi, dword [ecx + 0x68]
mov ecx, dword [esp + 0xc]
lea ecx, [ecx + ecx*4]
movzx edx, byte [esp + 7]
mov byte [edi + ecx*4], dl
mov word [edi + ecx*4 + 2], 0
mov dword [edi + ecx*4 + 4], eax
mov eax, dword [esp + 0x10]
jmp 0x497821
test byte [esp + 0x20], 2
jne 0x497710
mov dword [esp + 0x10], esi
mov eax, dword [ebp + 8]
lea esi, [ebx + eax]
mov ecx, dword [esp + 0x1c]
mov edx, edi
push esi
call fcn.00494230
add esp, 4
mov dword [esp + 0xc], esi
cmp eax, esi
je 0x497630
cmp byte [esp + 7], 0x50
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
jne 0x4977f0
mov edx, dword [ecx]
mov edi, 0x53e0e4
cmp byte [edx + 0x57], 0
je 0x497796
cmp byte [edi], 0x50
je 0x4977aa
jmp 0x4977f0
pcmpeqd xmm0, xmm0
movdqa xmmword [esp + 0x30], xmm0
mov dword [esp + 0x44], 0xffffffff
mov dword [esp + 0x40], 0xffffffff
mov word [esp + 0x44], 2
mov dword [esp + 0x34], 0x499e30
mov dword [esp + 0x38], 0x499fa0
mov dword [esp + 0x48], 0
test edi, edi
je 0x497764
lea ecx, [esp + 0x30]
mov edx, edi
call fcn.00499fb0
cmp word [esp + 0x44], 0
je 0x4976b7
mov eax, dword [ebp + 8]
add eax, ebx
mov ecx, dword [esp + 0x1c]
mov edx, edi
push eax
call fcn.00496f00
add esp, 4
jmp 0x497634
dec ebx
dec dword [esp + 0x28]
jmp 0x497634
mov edx, dword [esp + 0x24]
push 0
push dword [esp + 0x14]
jmp 0x497849
mov edi, dword [ecx + 0x68]
mov edx, dword [ecx + 0x6c]
lea edx, [edx + edx*4]
lea edi, [edi + edx*4]
add edi, 0xffffffec
cmp byte [edi], 0x50
jne 0x4977f0
mov edx, dword [edi + 0xc]
inc edx
mov dword [esp + 8], eax
mov dword [esp + 0x18], edi
mov eax, dword [esp + 0x18]
mov edi, dword [eax + 4]
add edi, edx
cmp edi, dword [esp + 8]
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x14]
jne 0x4977f0
mov eax, dword [esp + 0x18]
mov edi, dword [eax + 8]
add edi, edx
cmp edi, dword [esp + 0xc]
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x14]
jne 0x4977f0
cmp word [edi + 2], 0
je 0x497857
nop
mov edx, dword [ecx + 0x6c]
cmp dword [ecx + 0x70], edx
jle 0x49783f
mov dword [esp + 8], edx
inc edx
mov dword [ecx + 0x6c], edx
mov edi, dword [ecx + 0x68]
mov ecx, dword [esp + 8]
lea ecx, [ecx + ecx*4]
movzx edx, byte [esp + 7]
mov byte [edi + ecx*4], dl
mov word [edi + ecx*4 + 2], 0
mov dword [edi + ecx*4 + 4], eax
mov eax, dword [esp + 0xc]
mov dword [edi + ecx*4 + 8], eax
mov dword [edi + ecx*4 + 0xc], 0
mov dword [edi + ecx*4 + 0x10], 0
mov byte [edi + ecx*4 + 1], 0
jmp 0x497634
mov edx, dword [esp + 0x24]
push 0
push dword [esp + 0x10]
push eax
call fcn.004747e0
add esp, 0xc
jmp 0x497634
mov dword [edi + 0xc], edx
jmp 0x497634
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret