Function at 0x4d476e
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [ebp + 0x14]
push ebx
push esi
push edi
mov edi, dword [eax]
mov esi, ecx
mov ecx, dword [eax + 4]
push 0
mov dword [ebp - 0x4c], ecx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 0xc]
push 0x58c454
mov dword [ebp - 0x44], eax
mov eax, dword [ebp + 0xc]
push 0x58c438
push 0
push dword [ebp + 8]
lea eax, [eax + ecx - 1]
mov dword [ebp - 0x48], ecx
mov dword [ebp + 0xc], eax
call fcn.0050caf3
push 0
push 0x58c4d0
push 0x58c438
push 0
push dword [ebp + 8]
mov ebx, eax
call fcn.0050caf3
add esp, 0x28
test ebx, ebx
je 0x4d4fa7
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x4c]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x94]
test al, al
je 0x4d4fa7
push dword [esi + 0xa0]
mov eax, dword [ebx]
push dword [esi + 0x9c]
mov ecx, ebx
push dword [esi + 0x98]
push dword [esi + 0x94]
call dword [eax + 0x38]
mov dword [ebp + 0x14], eax
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x3c]
cmp dword [ebx + 0x20], 0
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 8]
push 0x5942a0
jne 0x4d4bd9
mov eax, dword [eax + 4]
imul eax, dword [ebp - 0x4c]
lea ecx, [eax + edi]
mov eax, dword [ebp + 0x14]
lea eax, [eax + ecx*4]
mov dword [ebp + 0x14], eax
mov eax, dword [esi + 0x50]
imul eax, dword [ebp + 0x10]
mov edi, dword [ebp + 0x18]
cdq
and edx, 3
add eax, edx
mov edx, dword [esi + 0x64]
sar eax, 2
add eax, dword [ebp + 0xc]
push edi
lea ebx, [edx + eax*4]
mov eax, dword [ebp - 0x38]
add ecx, eax
mov eax, dword [esi + 0x98]
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x9c]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0xa0]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], ecx
mov dword [ebp - 8], eax
call fcn.004be4c1
test al, al
pop ecx
pop ecx
je 0x4d4a01
mov eax, dword [ebp - 0x44]
test eax, eax
jle 0x4d4f9d
mov dword [ebp - 0x24], eax
mov edi, 0xff00ff
mov ecx, 0xff00
mov eax, dword [ebp - 4]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp + 0x10], eax
mov eax, dword [ebp - 0x48]
test eax, eax
mov dword [ebp + 0x18], ebx
mov dword [ebp - 8], eax
jle 0x4d49cf
mov eax, dword [ebp + 0x10]
mov edx, dword [eax]
mov eax, dword [ebp - 0x1c]
mov al, byte [eax]
movzx ebx, al
cmp ebx, dword [ebp - 8]
mov dword [ebp - 0x3c], edx
mov byte [ebp + 0xf], al
jle 0x4d48e2
mov al, byte [ebp - 8]
mov byte [ebp + 0xf], al
mov ebx, edx
shr ebx, 0x18
mov edx, 0x100
sub edx, ebx
cmp edx, 1
jne 0x4d491d
movzx eax, al
test eax, eax
jle 0x4d49bc
mov dword [ebp + 0xc], eax
mov edx, dword [ebp + 0x10]
mov ebx, dword [ebp + 0x18]
mov edx, dword [edx]
sub dword [ebp + 0x18], 4
add dword [ebp + 0x10], 4
dec dword [ebp + 0xc]
mov dword [ebx], edx
jne 0x4d4901
jmp 0x4d49bc
cmp edx, 0x100
jne 0x4d4938
movzx eax, al
mov edx, eax
shl edx, 2
sub dword [ebp + 0x18], edx
add dword [ebp + 0x10], edx
jmp 0x4d49bc
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ebx, eax
add dword [ebp + 0x10], 4
and ebx, edi
imul ebx, edx
and eax, ecx
imul eax, edx
mov edx, dword [ebp + 0x18]
sub dword [ebp + 0x18], 4
shr ebx, 8
shr eax, 8
and ebx, edi
add ebx, dword [ebp - 0x3c]
and eax, ecx
add eax, ebx
mov dword [edx], eax
movzx eax, byte [ebp + 0xf]
cmp eax, 1
mov dword [ebp - 0x38], eax
jle 0x4d49bc
dec eax
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
mov dword [ebp - 0x3c], eax
shr eax, 0x18
add dword [ebp + 0x10], 4
mov edx, 0x100
sub edx, eax
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ebx, eax
and ebx, edi
imul ebx, edx
and eax, ecx
imul eax, edx
mov edx, dword [ebp + 0x18]
sub dword [ebp + 0x18], 4
shr ebx, 8
and ebx, edi
add ebx, dword [ebp - 0x3c]
shr eax, 8
and eax, ecx
add eax, ebx
dec dword [ebp + 0xc]
mov dword [edx], eax
jne 0x4d4975
mov eax, dword [ebp - 0x38]
sub dword [ebp - 8], eax
add dword [ebp - 0x1c], eax
cmp dword [ebp - 8], 0
jg 0x4d48c4
mov ebx, dword [ebp - 0x14]
mov eax, dword [esi + 0x50]
cdq
and edx, 3
add eax, edx
mov edx, dword [ebp + 0x14]
sar eax, 2
lea ebx, [ebx + eax*4]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
add dword [ebp - 4], eax
dec dword [ebp - 0x24]
lea edx, [edx + eax*4]
mov dword [ebp - 0x14], ebx
mov dword [ebp + 0x14], edx
jne 0x4d48a7
jmp 0x4d4f9d
mov ecx, dword [edi + 0xc]
mov eax, dword [edi]
imul eax, ecx
cdq
mov dword [ebp - 0x18], ecx
mov ecx, 0xff
mov ebx, ecx
idiv ebx
mov dword [ebp - 0x30], eax
mov eax, dword [edi + 4]
imul eax, dword [ebp - 0x18]
cdq
idiv ebx
mov dword [ebp - 0x28], eax
mov eax, dword [edi + 8]
imul eax, dword [ebp - 0x18]
cdq
idiv ecx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x44]
test eax, eax
jle 0x4d4f9d
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp + 0x14]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x48]
test eax, eax
mov dword [ebp + 0x18], eax
jle 0x4d4ba4
mov edx, dword [ebp - 0x20]
mov dl, byte [edx]
mov eax, dword [ecx]
movzx edi, dl
cmp edi, dword [ebp + 0x18]
jle 0x4d4a70
mov dl, byte [ebp + 0x18]
shr eax, 0x18
mov ebx, 0xff
cmp eax, ebx
jne 0x4d4ad9
cmp dword [ebp - 0x18], ebx
jne 0x4d4aef
movzx eax, dl
test eax, eax
mov dword [ebp - 0x1c], eax
jle 0x4d4b94
mov dword [ebp + 0x10], eax
mov eax, dword [ecx]
mov edx, eax
and edx, dword [ebp - 8]
mov edi, eax
and edi, dword [ebp - 0xc]
imul edx, dword [ebp - 0x24]
and eax, dword [ebp - 0x10]
imul edi, dword [ebp - 0x28]
imul eax, dword [ebp - 0x30]
shr edx, 8
and edx, dword [ebp - 8]
shr edi, 8
and edi, dword [ebp - 0xc]
shr eax, 8
and eax, dword [ebp - 0x10]
add edx, edi
add edx, eax
mov eax, dword [ebp + 0xc]
sub dword [ebp + 0xc], 4
add ecx, 4
dec dword [ebp + 0x10]
mov dword [eax], edx
jne 0x4d4a92
jmp 0x4d4b91
test eax, eax
jne 0x4d4aef
movzx eax, dl
mov edx, eax
shl edx, 2
sub dword [ebp + 0xc], edx
add ecx, edx
jmp 0x4d4b94
movzx eax, dl
test eax, eax
mov dword [ebp - 0x1c], eax
jle 0x4d4b94
mov dword [ebp - 0x34], eax
jmp 0x4d4b07
mov ebx, 0xff
mov edi, dword [ecx]
mov eax, edi
shr eax, 0x18
imul eax, dword [ebp - 0x18]
xor edx, edx
div ebx
add ecx, 4
mov dword [ebp + 0x10], ecx
mov dword [ebp - 0x2c], edi
and edi, dword [ebp - 8]
mov ecx, 0x100
imul edi, dword [ebp - 0x24]
sub ecx, eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov edx, eax
and edx, dword [ebp - 8]
mov dword [ebp - 0x3c], ecx
imul edx, ecx
add edx, edi
mov edi, eax
and edi, dword [ebp - 0xc]
and eax, dword [ebp - 0x10]
imul edi, ecx
mov ecx, dword [ebp - 0x2c]
imul eax, dword [ebp - 0x3c]
and ecx, dword [ebp - 0xc]
shr edx, 8
imul ecx, dword [ebp - 0x28]
and edx, dword [ebp - 8]
add edi, ecx
mov ecx, dword [ebp - 0x2c]
and ecx, dword [ebp - 0x10]
shr edi, 8
imul ecx, dword [ebp - 0x30]
and edi, dword [ebp - 0xc]
add eax, ecx
mov ecx, dword [ebp + 0x10]
shr eax, 8
and eax, dword [ebp - 0x10]
add edx, edi
add edx, eax
mov eax, dword [ebp + 0xc]
sub dword [ebp + 0xc], 4
dec dword [ebp - 0x34]
mov dword [eax], edx
jne 0x4d4b02
mov eax, dword [ebp - 0x1c]
sub dword [ebp + 0x18], eax
add dword [ebp - 0x20], eax
cmp dword [ebp + 0x18], 0
jg 0x4d4a5e
mov eax, dword [esi + 0x50]
mov ecx, dword [ebp - 0x14]
cdq
and edx, 3
add eax, edx
sar eax, 2
lea eax, [ecx + eax*4]
mov ecx, dword [ebp + 0x14]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
add dword [ebp - 4], eax
dec dword [ebp - 0x38]
lea ecx, [ecx + eax*4]
mov dword [ebp + 0x14], ecx
jne 0x4d4a41
jmp 0x4d4f9d
mov ecx, dword [eax + 4]
mov eax, dword [esi + 0x50]
imul ecx, dword [ebp - 0x4c]
imul eax, dword [ebp + 0x10]
mov ebx, dword [ebx + 0x24]
cdq
and edx, 3
add eax, edx
mov edx, dword [esi + 0x64]
sar eax, 2
add eax, dword [ebp + 0xc]
add ebx, ecx
lea eax, [edx + eax*4]
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x98]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x9c]
add ecx, edi
add ecx, dword [ebp - 0x38]
add ebx, edi
mov edi, dword [ebp + 0x18]
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0xa0]
push edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 8], ecx
mov dword [ebp - 0x14], eax
call fcn.004be4c1
test al, al
pop ecx
pop ecx
je 0x4d4dbf
mov eax, dword [ebp - 0x44]
test eax, eax
jle 0x4d4f9d
mov dword [ebp - 0x38], eax
mov edi, 0xff00ff
mov ecx, 0xff00
mov eax, dword [ebp - 4]
mov dword [ebp + 0x18], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x48]
test eax, eax
mov dword [ebp + 0x10], ebx
mov dword [ebp - 0x14], eax
jle 0x4d4d8e
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax]
mov edx, dword [ebp + 0x14]
mov edx, dword [edx + eax*4]
mov eax, dword [ebp - 0x20]
mov al, byte [eax]
movzx ebx, al
cmp ebx, dword [ebp - 0x14]
mov dword [ebp - 0x3c], edx
mov byte [ebp + 0xf], al
jle 0x4d4c96
mov al, byte [ebp - 0x14]
mov byte [ebp + 0xf], al
mov ebx, edx
shr ebx, 0x18
mov edx, 0x100
sub edx, ebx
cmp edx, 1
jne 0x4d4cd7
movzx eax, al
test eax, eax
jle 0x4d4d7b
mov dword [ebp + 0xc], eax
mov edx, dword [ebp + 0x10]
movzx edx, byte [edx]
mov ebx, dword [ebp + 0x14]
mov edx, dword [ebx + edx*4]
mov ebx, dword [ebp + 0x18]
sub dword [ebp + 0x18], 4
inc dword [ebp + 0x10]
dec dword [ebp + 0xc]
mov dword [ebx], edx
jne 0x4d4cb5
jmp 0x4d4d7b
cmp edx, 0x100
jne 0x4d4cf2
movzx eax, al
mov edx, eax
imul edx, edx, 0xfffffffc
add dword [ebp + 0x18], edx
add dword [ebp + 0x10], eax
jmp 0x4d4d7b
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ebx, eax
inc dword [ebp + 0x10]
and ebx, edi
imul ebx, edx
and eax, ecx
imul eax, edx
mov edx, dword [ebp + 0x18]
sub dword [ebp + 0x18], 4
shr ebx, 8
shr eax, 8
and ebx, edi
add ebx, dword [ebp - 0x3c]
and eax, ecx
add eax, ebx
mov dword [edx], eax
movzx eax, byte [ebp + 0xf]
cmp eax, 1
mov dword [ebp - 0x34], eax
jle 0x4d4d7b
dec eax
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0x10]
movzx eax, byte [eax]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + eax*4]
mov dword [ebp - 0x3c], eax
shr eax, 0x18
inc dword [ebp + 0x10]
mov edx, 0x100
sub edx, eax
mov eax, dword [ebp + 0x18]
mov eax, dword [eax]
mov ebx, eax
and ebx, edi
imul ebx, edx
and eax, ecx
imul eax, edx
mov edx, dword [ebp + 0x18]
sub dword [ebp + 0x18], 4
shr ebx, 8
and ebx, edi
add ebx, dword [ebp - 0x3c]
shr eax, 8
and eax, ecx
add eax, ebx
dec dword [ebp + 0xc]
mov dword [edx], eax
jne 0x4d4d2e
mov eax, dword [ebp - 0x34]
sub dword [ebp - 0x14], eax
add dword [ebp - 0x20], eax
cmp dword [ebp - 0x14], 0
jg 0x4d4c71
mov ebx, dword [ebp - 0x18]
mov eax, dword [esi + 0x50]
cdq
and edx, 3
add eax, edx
mov edx, dword [ebp - 4]
sar eax, 2
lea eax, [edx + eax*4]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
add dword [ebp - 8], eax
add ebx, eax
dec dword [ebp - 0x38]
mov dword [ebp - 0x18], ebx
jne 0x4d4c54
jmp 0x4d4f9d
mov ecx, dword [edi + 0xc]
mov eax, dword [edi]
imul eax, ecx
cdq
mov dword [ebp - 0x1c], ecx
mov ecx, 0xff
mov ebx, ecx
idiv ebx
mov dword [ebp - 0x2c], eax
mov eax, dword [edi + 4]
imul eax, dword [ebp - 0x1c]
cdq
idiv ebx
mov dword [ebp - 0x34], eax
mov eax, dword [edi + 8]
imul eax, dword [ebp - 0x1c]
cdq
idiv ecx
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x44]
test eax, eax
jle 0x4d4f9d
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 0x18]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x48]
test eax, eax
mov dword [ebp + 0x18], eax
jle 0x4d4f73
movzx eax, byte [ecx]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + eax*4]
mov edx, dword [ebp - 0x24]
mov dl, byte [edx]
movzx edi, dl
cmp edi, dword [ebp + 0x18]
jle 0x4d4e35
mov dl, byte [ebp + 0x18]
shr eax, 0x18
mov ebx, 0xff
cmp eax, ebx
jne 0x4d4ea3
cmp dword [ebp - 0x1c], ebx
jne 0x4d4eb9
movzx eax, dl
test eax, eax
mov dword [ebp - 0x20], eax
jle 0x4d4f63
mov dword [ebp + 0x10], eax
movzx eax, byte [ecx]
mov edx, dword [ebp + 0x14]
mov eax, dword [edx + eax*4]
mov edx, eax
and edx, dword [ebp - 0x14]
mov edi, eax
and edi, dword [ebp - 0x10]
imul edx, dword [ebp - 0x38]
and eax, dword [ebp - 0xc]
imul edi, dword [ebp - 0x34]
imul eax, dword [ebp - 0x2c]
shr edx, 8
and edx, dword [ebp - 0x14]
shr edi, 8
and edi, dword [ebp - 0x10]
shr eax, 8
and eax, dword [ebp - 0xc]
add edx, edi
add edx, eax
mov eax, dword [ebp + 0xc]
sub dword [ebp + 0xc], 4
inc ecx
dec dword [ebp + 0x10]
mov dword [eax], edx
jne 0x4d4e57
jmp 0x4d4f60
test eax, eax
jne 0x4d4eb9
movzx eax, dl
mov edx, eax
imul edx, edx, 0xfffffffc
add dword [ebp + 0xc], edx
add ecx, eax
jmp 0x4d4f63
movzx eax, dl
test eax, eax
mov dword [ebp - 0x20], eax
jle 0x4d4f63
mov dword [ebp - 0x28], eax
jmp 0x4d4ed1
mov ebx, 0xff
movzx eax, byte [ecx]
mov edx, dword [ebp + 0x14]
mov edi, dword [edx + eax*4]
mov eax, edi
shr eax, 0x18
imul eax, dword [ebp - 0x1c]
xor edx, edx
div ebx
inc ecx
mov dword [ebp + 0x10], ecx
mov dword [ebp - 0x30], edi
and edi, dword [ebp - 0x14]
mov ecx, 0x100
imul edi, dword [ebp - 0x38]
sub ecx, eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov edx, eax
and edx, dword [ebp - 0x14]
mov dword [ebp - 0x40], ecx
imul edx, ecx
add edx, edi
mov edi, eax
and edi, dword [ebp - 0x10]
and eax, dword [ebp - 0xc]
imul edi, ecx
mov ecx, dword [ebp - 0x30]
imul eax, dword [ebp - 0x40]
and ecx, dword [ebp - 0x10]
shr edx, 8
imul ecx, dword [ebp - 0x34]
and edx, dword [ebp - 0x14]
add edi, ecx
mov ecx, dword [ebp - 0x30]
and ecx, dword [ebp - 0xc]
shr edi, 8
imul ecx, dword [ebp - 0x2c]
and edi, dword [ebp - 0x10]
add eax, ecx
mov ecx, dword [ebp + 0x10]
shr eax, 8
and eax, dword [ebp - 0xc]
add edx, edi
add edx, eax
mov eax, dword [ebp + 0xc]
sub dword [ebp + 0xc], 4
dec dword [ebp - 0x28]
mov dword [eax], edx
jne 0x4d4ecc
mov eax, dword [ebp - 0x20]
sub dword [ebp + 0x18], eax
add dword [ebp - 0x24], eax
cmp dword [ebp + 0x18], 0
jg 0x4d4e1c
mov eax, dword [esi + 0x50]
mov ecx, dword [ebp - 4]
cdq
and edx, 3
add eax, edx
sar eax, 2
lea eax, [ecx + eax*4]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
add dword [ebp - 0x18], eax
add dword [ebp - 8], eax
dec dword [ebp - 0x3c]
jne 0x4d4dff
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x98]
pop edi
pop esi
pop ebx
leave
ret 0x14