Function at 0x51f150
Capabilities:
Encrypt data using rc4 prga
Resolve function by parsing pe exports

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x51f521
sub esp, 0x54
mov eax, dword [esp + 0x64]
shl eax, 6
movzx edx, byte [esp + 0x70]
test dl, dl
je 0x51f17c
or eax, 0x20
mov edx, dword [esp + 0x68]
cmp edx, 0x1f
jl 0x51f204
mov ebx, dword [esp + 0x5c]
lea ebp, [ebx + 1]
mov esi, dword [esp + 0x60]
cmp esi, ebp
jb 0x51f19a
mov ecx, dword [esp + 0x58]
jmp 0x51f1e0
mov byte [esp + 0x23], al
lea eax, [0x60da40]
mov dword [esp], eax
mov ecx, dword [esp + 0x58]
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], ebp
call fcn.004476d0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
lea ebp, [ecx + 1]
mov ebx, dword [esp + 0x5c]
mov ecx, eax
mov esi, edx
movzx eax, byte [esp + 0x23]
mov edx, dword [esp + 0x68]
mov dword [esp + 0x34], ebp
or eax, 0x1f
mov byte [ecx + ebx], al
mov eax, edx
sar edx, 0x1f
mov dword [esp + 0x2c], edx
mov ebx, edx
mov edi, eax
xor eax, eax
mov dword [esp + 0x24], eax
mov eax, edi
jmp 0x51f3df
or eax, edx
mov edx, dword [esp + 0x5c]
lea ebx, [edx + 1]
mov ebp, dword [esp + 0x60]
cmp ebp, ebx
jb 0x51f21b
mov ecx, dword [esp + 0x58]
jmp 0x51f25d
mov byte [esp + 0x23], al
lea eax, [0x60da40]
mov dword [esp], eax
mov ecx, dword [esp + 0x58]
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], ebx
call fcn.004476d0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
lea ebx, [ecx + 1]
mov ecx, eax
mov ebp, edx
movzx eax, byte [esp + 0x23]
mov edx, dword [esp + 0x5c]
mov byte [ecx + edx], al
mov dword [esp + 0x4c], ebx
mov eax, dword [esp + 0x6c]
cmp eax, 0x80
jl 0x51f278
mov edx, eax
mov esi, 1
jmp 0x51f2cb
lea edx, [ebx + 1]
cmp ebp, edx
jae 0x51f2b4
lea eax, [0x60da40]
mov dword [esp], eax
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], edx
call fcn.004476d0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
lea edx, [eax + 1]
mov eax, dword [esp + 0x6c]
mov ebx, dword [esp + 0x4c]
mov byte [ecx + ebx], al
mov dword [esp + 0x74], ecx
mov dword [esp + 0x78], edx
mov dword [esp + 0x7c], ebp
add esp, 0x54
ret
inc esi
sar eax, 8
cmp eax, 0xff
jg 0x51f2c7
lea eax, [ebx + 1]
cmp ebp, eax
jae 0x51f314
mov dword [esp + 0x28], esi
lea edx, [0x60da40]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], eax
call fcn.004476d0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
inc eax
mov edx, dword [esp + 0x6c]
mov ebx, dword [esp + 0x4c]
mov esi, dword [esp + 0x28]
or esi, 0xffffff80
xchg esi, eax
mov byte [ecx + ebx], al
xchg esi, eax
nop
mov ebx, edx
mov esi, 1
jmp 0x51f32a
inc esi
sar edx, 8
cmp edx, 0xff
jg 0x51f326
jmp 0x51f345
mov byte [edi + eax], bl
mov eax, dword [esp + 0x4c]
mov ebx, edx
mov eax, esi
mov ecx, edi
mov esi, dword [esp + 0x4c]
test esi, esi
jle 0x51f3b4
lea edx, [esi - 1]
mov dword [esp + 0x4c], edx
shl edx, 3
cmp edx, 0x20
sbb edi, edi
lea esi, [eax + 1]
xchg edi, ebx
not ebx
xchg edi, ebx
or edx, edi
mov edi, ecx
mov ecx, edx
mov edx, ebx
sar ebx, cl
cmp ebp, esi
jae 0x51f334
mov dword [esp + 0x48], ebx
mov dword [esp + 0x38], eax
lea ecx, [0x60da40]
mov dword [esp], ecx
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov dword [esp + 0xc], ebp
mov dword [esp + 0x10], esi
call fcn.004476d0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x1c]
lea esi, [eax + 1]
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x6c]
mov ebx, dword [esp + 0x48]
mov edi, ecx
jmp 0x51f334
mov edx, eax
jmp 0x51f2b7
shr eax, 7
mov ebx, edx
shl edx, 0x19
or eax, edx
sar ebx, 7
mov edx, dword [esp + 0x24]
inc edx
mov ebp, dword [esp + 0x34]
mov edi, dword [esp + 0x68]
mov dword [esp + 0x24], edx
mov edx, ebx
mov ebx, dword [esp + 0x2c]
test edx, edx
setg bl
test eax, eax
xchg edi, ebx
seta bl
xchg edi, ebx
test edx, edx
xchg ebp, ebx
sete bl
xchg ebp, ebx
and ebp, edi
or ebx, ebp
test bl, bl
jne 0x51f3bb
mov eax, dword [esp + 0x24]
dec eax
mov edx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x68]
mov ebp, dword [esp + 0x34]
jmp 0x51f427
mov byte [ecx + ebp], dl
mov edx, edi
lea edi, [ebx - 1]
mov ebx, dword [esp + 0x68]
mov eax, edi
mov ebp, esi
mov esi, edx
mov edx, dword [esp + 0x2c]
test eax, eax
jl 0x51f518
mov dword [esp + 0x30], eax
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x3c], esi
mov dword [esp + 0x50], ecx
lea edi, [eax + eax*2]
lea esi, [eax + edi*2]
mov dword [esp + 0x48], esi
cmp esi, 0x20
sbb ebp, ebp
lea edi, [eax + edi*2 - 0x20]
mov dword [esp + 0x44], edi
xchg edi, ebx
neg ebx
xchg edi, ebx
cmp edi, 0x20
sbb eax, eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x44]
cmp eax, 0x20
sbb eax, eax
shr esi, 5
cmp esi, 1
sbb esi, esi
mov ecx, dword [esp + 0x48]
shr ebx, cl
and ebx, ebp
mov ecx, edi
mov ebp, edx
shl edx, cl
mov edi, dword [esp + 0x40]
and edx, edi
or edx, ebx
not eax
mov ecx, dword [esp + 0x44]
or ecx, eax
mov eax, ebp
sar ebp, cl
xor esi, 0xffffffff
and ebp, esi
or ebp, edx
mov edx, ebp
and ebp, 0x7f
mov ebx, dword [esp + 0x30]
test ebx, ebx
je 0x51f4b1
or edx, 0xffffff80
jmp 0x51f4b3
mov edx, ebp
mov ebp, dword [esp + 0x4c]
lea esi, [ebp + 1]
mov edi, dword [esp + 0x3c]
cmp edi, esi
jb 0x51f4cb
mov ecx, dword [esp + 0x50]
jmp 0x51f411
mov byte [esp + 0x22], dl
lea eax, [0x60da40]
mov dword [esp], eax
mov ecx, dword [esp + 0x50]
mov dword [esp + 4], ecx
mov dword [esp + 8], ebp
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], esi
call fcn.004476d0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
inc eax
movzx edx, byte [esp + 0x22]
mov ebx, dword [esp + 0x30]
mov ebp, dword [esp + 0x4c]
mov edi, esi
mov esi, eax
mov eax, dword [esp + 0x2c]
jmp 0x51f411
mov ebx, ebp
mov ebp, esi
jmp 0x51f260
call fcn.0045d190
jmp fcn.0051f150