Function at 0x4777a0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x54
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
mov edx, dword [ebp + 0xc]
xor eax, eax
push ebx
mov ebx, dword [edx]
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp + 0x20]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov eax, dword [ebp + 0x30]
mov dword [esp + 0x50], eax
lea edx, [ecx + 6]
push esi
mov esi, dword [ebp + 0x34]
mov eax, 0xfffffffe
mov dword [esp + 0x58], ebx
mov dword [esp + 0x10], edx
cmp byte [ebx], 0x7e
push edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x28], eax
jne 0x477821
movzx eax, byte [ebx + 3]
movzx edx, byte [ebx + 4]
shl eax, 8
or eax, edx
mov dword [esp + 0x3c], eax
mov word [esp + 0x54], ax
mov eax, dword [esi + 0x20]
mov dword [esp + 0x50], eax
xor edx, edx
lea eax, [esp + 0x50]
mov word [esp + 0x56], dx
mov dword [esi + 0x20], eax
mov byte [ebx + 1], 0
lea eax, [ebx + 1]
mov dword [esp + 0x48], eax
lea eax, [ebx + 2]
mov byte [eax], 0
mov edi, dword [esi + 0x34]
mov dword [esp + 0x4c], eax
mov eax, dword [ebp + 0x38]
neg eax
lea ebx, [ebx + ecx + 3]
sbb eax, eax
lea ecx, [esp + 0x14]
and eax, ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], eax
cmp dword [ebp + 0x1c], 0
mov dword [esp + 0x1c], ebx
je 0x477867
mov edx, dword [esp + 0x40]
mov dword [esi + 0x34], edx
cmp dword [ebp + 0x18], 0
je 0x477886
mov byte [ebx], 0x76
inc ebx
mov word [ebx], 0
mov dword [esp + 0x38], ebx
add ebx, 2
add dword [esp + 0x14], 3
mov dword [esp + 0x1c], ebx
push eax
mov eax, dword [ebp + 0x24]
push esi
push eax
lea ecx, [esp + 0x64]
push ecx
mov ecx, dword [ebp + 0x14]
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x48]
push eax
push ecx
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x3c]
push eax
lea ecx, [ebp + 8]
push ecx
call fcn.00474340
add esp, 0x28
test eax, eax
je 0x4779fc
mov eax, dword [esi + 0x34]
cmp eax, edi
jle 0x4778c8
mov dword [esp + 0x30], eax
cmp dword [ebp + 0x38], 0
mov ebx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
jne 0x477987
cmp byte [eax], 0x71
mov edx, dword [esp + 0x34]
je 0x4778f1
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov dword [esp + 0x10], ecx
jmp 0x477944
mov ecx, dword [esp + 0x28]
test ecx, ecx
js 0x477910
cmp ecx, edx
je 0x477924
cmp dword [esp + 0x10], 0
jge 0x477908
mov dword [esp + 0x10], ecx
mov dword [esp + 0x28], 0xffffffff
test edx, edx
js 0x477924
mov ecx, dword [esp + 0x24]
test ecx, ecx
jns 0x477928
mov ecx, edx
mov dword [esp + 0x24], ecx
jmp 0x477928
mov ecx, dword [esp + 0x24]
mov edx, ecx
xor edx, dword [esp + 0x10]
test edx, 0xfffffdff
je 0x477940
mov dword [esp + 0x10], 0xffffffff
jmp 0x477944
or dword [esp + 0x10], ecx
cmp dword [ebp + 0x18], 0
je 0x477987
mov ecx, dword [ebp + 8]
push esi
shr ecx, 0xb
push 0
and ecx, 1
push ecx
push eax
mov byte [ebx], 0
call fcn.00472b80
add esp, 0x10
cmp eax, 0xfffffffd
jne 0x477971
mov dword [esi + 0x58], 1
jmp 0x477983
test eax, eax
js 0x4779ea
mov edi, dword [esp + 0x38]
mov edx, eax
sar edx, 8
mov byte [edi], dl
mov byte [edi + 1], al
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
cmp byte [edi], 0x7c
jne 0x477a0e
cmp dword [ebp + 0x38], 0
je 0x4779b9
mov eax, dword [ebp + 0xc]
add dword [esp + 0x14], 3
mov ecx, dword [eax]
mov edx, dword [ebp + 0x20]
mov eax, dword [esp + 0x44]
inc edi
mov dword [esp + 0x20], edi
mov edi, dword [esp + 0x30]
lea ebx, [ecx + edx + 3]
jmp 0x477856
mov ecx, ebx
sub ecx, eax
mov byte [ebx], 0x71
mov dl, bl
sar ecx, 8
sub dl, al
mov eax, dword [esp + 0x44]
mov byte [ebx + 1], cl
mov byte [ebx + 2], dl
mov dword [esp + 0x18], ebx
mov dword [esp + 0x5c], ebx
add ebx, 3
inc edi
mov dword [esp + 0x20], edi
mov edi, dword [esp + 0x30]
jmp 0x477856
mov edx, dword [ebp + 0x14]
sub eax, 0xfffffffe
neg eax
sbb eax, eax
and eax, 0xfffffff5
add eax, 0x24
mov dword [edx], eax
mov eax, dword [esp + 0x20]
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x38]
test ecx, ecx
jne 0x477a46
mov ecx, ebx
sub ecx, eax
lea esp, [esp]
movzx esi, byte [eax + 1]
movzx edx, byte [eax + 2]
shl esi, 8
or esi, edx
mov edx, ecx
sar edx, 8
mov byte [eax + 2], cl
mov byte [eax + 1], dl
sub eax, esi
mov ecx, esi
test esi, esi
jg 0x477a20
mov esi, dword [ebp + 0x34]
mov ecx, dword [ebp + 0x38]
mov eax, dword [esp + 0x2c]
mov edx, ebx
sub edx, eax
sar edx, 8
mov byte [ebx], 0x72
mov byte [ebx + 1], dl
mov dl, bl
sub dl, al
mov byte [ebx + 2], dl
add ebx, 3
cmp dword [esp + 0x3c], 0
jle 0x477ac3
mov edx, dword [esi + 0x20]
cmp word [edx + 6], 0
je 0x477abb
mov ecx, ebx
sub ecx, eax
push ecx
push eax
add eax, 3
push eax
call fcn.0047f5f0
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x54]
add ebx, 3
mov byte [ecx], 0x7b
mov eax, ebx
sub eax, ecx
sar eax, 8
mov byte [edx], al
mov edx, dword [esp + 0x58]
mov cl, bl
sub cl, byte [esp + 0x38]
add esp, 0xc
mov byte [edx], cl
mov byte [ebx], 0x72
mov byte [ebx + 1], al
mov byte [ebx + 2], cl
mov ecx, dword [ebp + 0x38]
add ebx, 3
add dword [esp + 0x14], 6
mov eax, dword [esi + 0x20]
mov edx, dword [eax]
mov dword [esi + 0x20], edx
mov eax, dword [esp + 0x30]
mov edx, dword [ebp + 0xc]
mov dword [esi + 0x34], eax
mov eax, dword [ebp + 0x10]
mov dword [edx], ebx
mov edx, dword [ebp + 0x28]
mov dword [eax], edi
mov eax, dword [esp + 0x28]
mov dword [edx], eax
mov edx, dword [ebp + 0x2c]
mov eax, dword [esp + 0x10]
mov dword [edx], eax
test ecx, ecx
je 0x477b11
mov eax, dword [ecx]
mov edx, dword [esp + 0x14]
mov esi, 0x7fffffeb
sub esi, eax
cmp esi, edx
jge 0x477b0d
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
add eax, edx
mov dword [ecx], eax
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret