Function at 0x497077
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd0
mov eax, dword [0x58a06c]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0xc8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xcc], eax
push edi
mov eax, dword [esi]
mov dword [ebp - 0xc4], edx
mov dword [ebp - 0xb8], esi
and dword [eax + 8], 0
call fcn.0049680d
mov edx, dword [esi]
test eax, eax
jne 0x4970d1
mov edx, dword [edx + 8]
mov ecx, esi
push eax
call fcn.0049623e
pop ecx
xor eax, eax
jmp 0x4975b6
mov edi, dword [edx + 8]
xor ebx, ebx
push 3
pop ecx
inc ebx
mov dword [ebp - 0xac], edi
cmp edi, ecx
jne 0x497106
cmp dword [esi + 0x47ec], ecx
je 0x4970fe
cmp dword [esi + 0x47e8], 0
jne 0x497106
cmp dword [esi + 0x47e4], 0
jne 0x497106
mov dword [ebp - 0xb4], ebx
jmp 0x49710d
and dword [ebp - 0xb4], 0
and dword [ebp - 0xa4], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0x18], xmm0
test edi, edi
jle 0x49721d
lea ebx, [esi + 0x46a0]
lea edi, [ebp - 0x90]
mov dword [ebp - 0xa0], ebx
mov eax, dword [esi]
mov eax, dword [eax]
add eax, ecx
push eax
call fcn.005089f8
mov dword [ebx + 0x34], eax
pop ecx
test eax, eax
je 0x497290
mov eax, dword [esi + 0x4684]
cdq
idiv dword [ebx]
and dword [edi + 0x10], 0
mov dword [ebp - 0xa8], eax
mov dword [edi], eax
mov eax, dword [esi + 0x4688]
cdq
idiv dword [ebx + 4]
xor edx, edx
mov ebx, eax
mov eax, dword [ebp - 0xa8]
mov ecx, ebx
mov dword [edi + 4], ebx
sar ecx, 1
dec eax
mov dword [edi + 0xc], ecx
mov ecx, dword [esi]
mov ecx, dword [ecx]
add eax, ecx
mov ecx, dword [ebp - 0xa8]
div ecx
mov dword [edi + 8], eax
mov eax, dword [ebp - 0xa0]
mov eax, dword [eax + 0x28]
mov dword [edi - 4], eax
mov dword [edi - 8], eax
xor eax, eax
inc eax
cmp ecx, eax
jne 0x4971bf
cmp ebx, eax
jne 0x4971b3
mov eax, 0x49698f
jmp 0x4971e1
cmp ebx, 2
jne 0x4971dc
mov eax, 0x496997
jmp 0x4971e1
cmp ecx, 2
jne 0x4971dc
cmp ebx, eax
jne 0x4971cf
mov eax, 0x4969da
jmp 0x4971e1
cmp ebx, 2
jne 0x4971dc
mov eax, dword [esi + 0x4814]
jmp 0x4971e1
mov eax, 0x496cc5
mov ebx, dword [ebp - 0xa0]
mov dword [edi - 0xc], eax
add ebx, 0x48
mov eax, dword [ebp - 0xa4]
add edi, 0x20
inc eax
mov dword [ebp - 0xa0], ebx
push 3
mov dword [ebp - 0xa4], eax
pop ecx
cmp eax, dword [ebp - 0xac]
jl 0x497135
mov edx, dword [esi]
xor ebx, ebx
mov edi, dword [ebp - 0xac]
inc ebx
push ebx
push dword [edx + 4]
mov edx, dword [edx]
push 4
pop ecx
call fcn.0049261c
mov edx, dword [esi]
mov dword [ebp - 0xbc], eax
pop ecx
pop ecx
test eax, eax
je 0x497292
xor ecx, ecx
mov dword [ebp - 0xa4], ecx
cmp dword [edx + 4], ecx
jbe 0x497573
mov eax, dword [edx]
mov ebx, dword [ebp - 0xbc]
and dword [ebp - 0xa0], 0
imul eax, ecx
lea ebx, [ebx + eax*4]
mov dword [ebp - 0xb0], ebx
test edi, edi
jle 0x497324
lea ebx, [esi + 0x46bc]
mov esi, dword [ebp - 0xac]
lea edi, [ebp - 0x84]
mov eax, dword [edi - 8]
sar eax, 1
cmp dword [edi], eax
jl 0x4972b5
mov eax, dword [edi - 0x10]
mov ecx, dword [edi - 0x14]
jmp 0x4972bb
mov edx, dword [esi]
mov edx, dword [edx + 8]
mov ecx, esi
push 0
call fcn.0049623e
mov eax, dword fs:[0x2c]
mov eax, dword [eax]
mov dword [eax + 0x10], str.outofmem
jmp 0x4970c9
mov eax, dword [edi - 0x14]
mov ecx, dword [edi - 0x10]
push dword [edi - 0xc]
push dword [edi - 4]
push ecx
push eax
push dword [ebx + 0x18]
call dword [edi - 0x18]
mov ecx, dword [ebp - 0xa0]
add esp, 0x14
mov dword [ebp + ecx*4 - 0x18], eax
mov eax, dword [edi]
inc eax
mov dword [edi], eax
cmp eax, dword [edi - 8]
jl 0x4972fb
and dword [edi], 0
inc dword [edi + 4]
mov eax, dword [edi + 4]
mov edx, dword [edi - 0x10]
mov dword [edi - 0x14], edx
cmp eax, dword [ebx]
jge 0x4972fb
mov eax, dword [ebx + 4]
add eax, edx
mov dword [edi - 0x10], eax
inc ecx
add edi, 0x20
add ebx, 0x48
mov dword [ebp - 0xa0], ecx
cmp ecx, esi
jl 0x49727f
mov esi, dword [ebp - 0xb8]
mov ebx, dword [ebp - 0xb0]
mov ecx, dword [ebp - 0xa4]
mov edx, dword [esi]
cmp dword [edx + 8], 3
jne 0x4973a6
cmp dword [ebp - 0xb4], 0
je 0x49738a
and dword [ebp - 0xa0], 0
cmp dword [edx], 0
jbe 0x497558
mov eax, dword [ebp - 0x14]
lea ecx, [ebx + 2]
mov edi, dword [ebp - 0x18]
mov edx, eax
mov ebx, dword [ebp - 0x10]
sub edi, eax
sub ebx, eax
mov al, byte [edx + edi]
inc dword [ebp - 0xa0]
mov byte [ecx - 2], al
mov al, byte [edx]
mov byte [ecx - 1], al
mov al, byte [edx + ebx]
inc edx
mov byte [ecx], al
lea ecx, [ecx + 4]
mov byte [ecx - 3], 0xff
mov eax, dword [esi]
mov esi, dword [ebp - 0xa0]
cmp esi, dword [eax]
mov esi, dword [ebp - 0xb8]
jb 0x497355
jmp 0x497552
push 4
push dword [edx]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push dword [ebp - 0x18]
push ebx
call dword [esi + 0x4810]
add esp, 0x18
jmp 0x497552
cmp dword [edx + 8], 4
jne 0x49752d
mov eax, dword [esi + 0x47e8]
test eax, eax
jne 0x497496
and dword [ebp - 0xb0], eax
cmp dword [edx], eax
jbe 0x497558
mov edx, dword [ebp - 0xc]
lea eax, [ebx + 2]
mov edi, dword [ebp - 0x18]
mov ecx, edx
mov ebx, dword [ebp - 0x14]
sub edi, edx
mov dword [ebp - 0xa8], eax
sub ebx, edx
mov eax, dword [ebp - 0x10]
sub eax, edx
mov dword [ebp - 0xa0], edx
mov dword [ebp - 0xc0], eax
movzx edx, byte [ecx]
movzx ecx, byte [edi + ecx]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0xa8]
shr eax, 8
mov byte [ecx - 2], al
mov eax, dword [ebp - 0xa0]
movzx ecx, byte [ebx + eax]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0xa8]
shr eax, 8
mov byte [ecx - 1], al
mov eax, dword [ebp - 0xc0]
mov ecx, dword [ebp - 0xa0]
movzx ecx, byte [eax + ecx]
imul ecx, edx
mov edx, dword [ebp - 0xb0]
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
mov ecx, dword [ebp - 0xa8]
shr eax, 8
mov byte [ecx], al
mov byte [ecx + 1], 0xff
add ecx, 4
mov eax, dword [esi]
inc edx
mov dword [ebp - 0xa8], ecx
mov ecx, dword [ebp - 0xa0]
inc ecx
mov dword [ebp - 0xb0], edx
mov dword [ebp - 0xa0], ecx
cmp edx, dword [eax]
jb 0x4973f5
jmp 0x497552
mov ecx, dword [edx]
mov edx, dword [esi + 0x4810]
push 4
push ecx
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push dword [ebp - 0x18]
push ebx
cmp eax, 2
jne 0x497526
call edx
mov eax, dword [esi]
xor edi, edi
add esp, 0x18
cmp dword [eax], edi
jbe 0x497552
add ebx, 2
mov eax, dword [ebp - 0xc]
movzx edx, byte [edi + eax]
mov al, byte [ebx - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 2], al
mov al, byte [ebx - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 1], al
mov al, byte [ebx]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
inc edi
mov byte [ebx], al
lea ebx, [ebx + 4]
mov eax, dword [esi]
cmp edi, dword [eax]
jb 0x4974c4
jmp 0x497552
call edx
jmp 0x49739e
xor edi, edi
cmp dword [edx], edi
jbe 0x497558
lea ecx, [ebx + 1]
mov eax, dword [ebp - 0x18]
mov al, byte [edi + eax]
inc edi
mov byte [ecx + 1], al
mov byte [ecx], al
lea ecx, [ecx + 4]
mov byte [ecx - 5], al
mov byte [ecx - 2], 0xff
mov eax, dword [esi]
cmp edi, dword [eax]
jb 0x497536
mov ecx, dword [ebp - 0xa4]
mov edx, dword [esi]
inc ecx
mov edi, dword [ebp - 0xac]
mov dword [ebp - 0xa4], ecx
cmp ecx, dword [edx + 4]
jb 0x49724a
xor ebx, ebx
inc ebx
mov edx, dword [edx + 8]
mov ecx, esi
push 0
call fcn.0049623e
mov eax, dword [esi]
pop ecx
mov ecx, dword [ebp - 0xc4]
mov eax, dword [eax]
mov dword [ecx], eax
mov eax, dword [esi]
mov ecx, dword [ebp - 0xc8]
mov eax, dword [eax + 4]
mov dword [ecx], eax
mov ecx, dword [ebp - 0xcc]
test ecx, ecx
je 0x4975b0
mov eax, dword [esi]
push 3
pop edx
cmp dword [eax + 8], edx
cmovge ebx, edx
mov dword [ecx], ebx
mov eax, dword [ebp - 0xbc]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.005000f2
leave
ret