Function at 0x50d960
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x12c
mov eax, dword [0x562940]
xor eax, dword [esp + 0x12c]
push ebx
push ebp
mov ebp, dword [esp + 0x138]
push esi
push edi
mov edi, dword [ebp + 0x14]
mov esi, dword [edi + 4]
test esi, esi
mov ebx, dword [edi]
mov dword [esp + 0x138], eax
mov dword [esp + 0x30], edi
jne 0x50d9ae
push ebp
call dword [edi + 0xc]
add esp, 4
test al, al
je 0x50dc78
mov eax, dword [edi + 4]
mov ebx, dword [edi]
mov dword [esp + 0x10], eax
mov esi, eax
xor eax, eax
mov ah, byte [ebx]
dec esi
inc ebx
test esi, esi
mov dword [esp + 0x14], eax
jne 0x50d9da
push ebp
call dword [edi + 0xc]
add esp, 4
test al, al
je 0x50dc78
mov ecx, dword [edi + 4]
mov ebx, dword [edi]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], ecx
mov esi, ecx
movzx edx, byte [ebx]
add eax, edx
dec esi
sub eax, 2
inc ebx
test eax, eax
mov dword [esp + 0x14], eax
jle 0x50dc54
test esi, esi
jne 0x50da0e
push ebp
call dword [edi + 0xc]
add esp, 4
test al, al
je 0x50dc78
mov eax, dword [edi + 4]
mov ebx, dword [edi]
mov dword [esp + 0x10], eax
mov esi, eax
movzx eax, byte [ebx]
mov ecx, dword [ebp]
mov dword [ecx + 0x14], 0x4d
mov edx, dword [ebp]
mov dword [esp + 0x34], eax
mov dword [edx + 0x18], eax
mov eax, dword [ebp]
push 1
dec esi
push ebp
inc ebx
call dword [eax + 4]
add esp, 8
mov byte [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov edi, 1
test esi, esi
jne 0x50da67
mov esi, dword [esp + 0x30]
push ebp
call dword [esi + 0xc]
add esp, 4
test al, al
je 0x50dc78
mov ecx, dword [esi + 4]
mov ebx, dword [esi]
mov dword [esp + 0x10], ecx
mov esi, ecx
mov dl, byte [ebx]
mov byte [esp + edi + 0x1c], dl
movzx eax, dl
mov edx, dword [esp + 0x18]
dec esi
add edx, eax
inc ebx
inc edi
cmp edi, 0x10
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], edx
jle 0x50da45
mov eax, dword [ebp]
mov edx, dword [esp + 0x14]
movzx ecx, byte [esp + 0x1d]
sub edx, 0x11
add eax, 0x18
mov dword [esp + 0x14], edx
movzx edx, byte [esp + 0x1e]
mov dword [eax], ecx
movzx ecx, byte [esp + 0x1f]
mov dword [eax + 4], edx
movzx edx, byte [esp + 0x20]
mov dword [eax + 8], ecx
movzx ecx, byte [esp + 0x21]
mov dword [eax + 0xc], edx
movzx edx, byte [esp + 0x22]
mov dword [eax + 0x10], ecx
movzx ecx, byte [esp + 0x23]
mov dword [eax + 0x14], edx
movzx edx, byte [esp + 0x24]
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], edx
mov eax, dword [ebp]
mov edi, 0x53
mov dword [eax + 0x14], edi
mov ecx, dword [ebp]
push 2
push ebp
call dword [ecx + 4]
mov eax, dword [ebp]
movzx edx, byte [esp + 0x2d]
movzx ecx, byte [esp + 0x2e]
add eax, 0x18
mov dword [eax], edx
movzx edx, byte [esp + 0x2f]
mov dword [eax + 4], ecx
movzx ecx, byte [esp + 0x30]
mov dword [eax + 8], edx
movzx edx, byte [esp + 0x31]
mov dword [eax + 0xc], ecx
movzx ecx, byte [esp + 0x32]
mov dword [eax + 0x10], edx
movzx edx, byte [esp + 0x33]
mov dword [eax + 0x14], ecx
movzx ecx, byte [esp + 0x34]
mov dword [eax + 0x18], edx
mov dword [eax + 0x1c], ecx
mov edx, dword [ebp]
mov dword [edx + 0x14], edi
mov eax, dword [ebp]
push 2
push ebp
call dword [eax + 4]
mov eax, dword [esp + 0x28]
add esp, 0x10
cmp eax, 0x100
jg 0x50db52
cmp eax, dword [esp + 0x14]
jle 0x50db65
mov ecx, dword [ebp]
mov dword [ecx + 0x14], 0x1a
mov edx, dword [ebp]
push ebp
call dword [edx]
add esp, 4
mov eax, dword [esp + 0x18]
xor edi, edi
test eax, eax
jle 0x50dba7
nop
test esi, esi
jne 0x50db96
mov esi, dword [esp + 0x30]
push ebp
call dword [esi + 0xc]
add esp, 4
test al, al
je 0x50dc78
mov eax, dword [esi + 4]
mov ebx, dword [esi]
mov dword [esp + 0x10], eax
mov esi, eax
mov eax, dword [esp + 0x18]
mov cl, byte [ebx]
dec esi
inc ebx
mov byte [esp + edi + 0x38], cl
inc edi
cmp edi, eax
mov dword [esp + 0x10], esi
jl 0x50db70
mov edx, dword [esp + 0x14]
sub edx, eax
mov eax, dword [esp + 0x34]
test al, 0x10
mov dword [esp + 0x14], edx
je 0x50dbc5
sub eax, 0x10
lea esi, [ebp + eax*4 + 0xb0]
jmp 0x50dbcc
lea esi, [ebp + eax*4 + 0xa0]
test eax, eax
jl 0x50dbd5
cmp eax, 4
jl 0x50dbee
mov edx, dword [ebp]
mov dword [edx + 0x14], 0x1b
mov ecx, dword [ebp]
mov dword [ecx + 0x18], eax
mov edx, dword [ebp]
push ebp
call dword [edx]
add esp, 4
cmp dword [esi], 0
jne 0x50dc0c
mov eax, dword [ebp + 4]
push 0x112
push 0
push ebp
call dword [eax]
mov byte [eax + 0x111], 0
add esp, 0xc
mov dword [esi], eax
mov ecx, dword [esi]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x20]
mov dword [ecx], edx
mov edx, dword [esp + 0x24]
mov dword [ecx + 4], eax
mov eax, dword [esp + 0x28]
mov dword [ecx + 8], edx
mov dl, byte [esp + 0x2c]
mov dword [ecx + 0xc], eax
mov eax, dword [esp + 0x14]
mov byte [ecx + 0x10], dl
mov edi, dword [esi]
add edi, 0x11
test eax, eax
mov ecx, 0x40
lea esi, [esp + 0x38]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x30]
mov esi, dword [esp + 0x10]
jg 0x50d9f0
mov dword [edi], ebx
mov dword [edi + 4], esi
mov al, 1
mov ecx, dword [esp + 0x138]
xor ecx, dword [esp + 0x13c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x12c
jmp fcn.00523319
xor al, al
jmp 0x50dc5b