Function at 0x4979b0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x59f740]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
push esi
push edi
cmp eax, ebx
je 0x497a0a
push eax
call fcn.00510680
mov esi, eax
add esp, 4
mov dword [ebp - 0x34], esi
cmp esi, ebx
je 0x497a0a
push ebx
mov edi, 8
push edi
lea eax, [ebp - 0xc]
push eax
push esi
call fcn.005108e0
push edi
lea ecx, [ebp - 0xc]
push ebx
push ecx
call fcn.00535ff0
add esp, 0x1c
test eax, eax
je 0x497a20
push esi
call fcn.005107e0
add esp, 4
xor eax, eax
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret
push ebx
push ebx
push esi
call fcn.00510870
push ebx
push ebx
push ebx
push 0x573710
call fcn.00539ce0
add esp, 0x1c
mov dword [ebp - 0x10], eax
cmp eax, ebx
je 0x497a01
push eax
call fcn.005364f0
add esp, 4
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x497a79
push ebx
lea edx, [ebp - 0x10]
push ebx
push edx
call fcn.0053ae30
push esi
call fcn.005107e0
add esp, 0x10
xor eax, eax
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
push 0x497990
push esi
push eax
call fcn.00543a00
mov ecx, dword [ebp - 0x10]
push 0x40
push fcn.005187fc
push ecx
mov dword [ebp - 0x28], ebx
call fcn.00543700
push ebx
push eax
call fcn.0051893c
add esp, 0x20
test eax, eax
je 0x497aec
push ebx
lea edx, [ebp - 0x14]
push edx
lea eax, [ebp - 0x10]
push eax
call fcn.0053ae30
mov eax, dword [ebp - 0x28]
add esp, 0xc
cmp eax, ebx
je 0x497aca
push eax
call fcn.0048c260
add esp, 4
mov ecx, dword [ebp - 0x34]
push ecx
call fcn.005107e0
add esp, 4
xor eax, eax
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
push edx
push eax
call fcn.00539da0
lea ecx, [ebp - 0x48]
push ecx
lea edx, [ebp - 0x40]
push edx
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x18]
push ecx
lea edx, [ebp - 0x20]
push edx
mov edx, dword [ebp - 0x14]
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x10]
lea ecx, [ebp - 0x3c]
push ecx
push edx
push eax
call fcn.00542c90
add esp, 0x2c
test eax, eax
jne 0x497b5d
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push ecx
push edx
call fcn.0053aa00
push ebx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
push ecx
call fcn.0053ae30
add esp, 0x14
xor eax, eax
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x20]
cmp eax, 0x10
jne 0x497b70
mov edx, dword [ebp - 0x10]
push edx
call fcn.0053b0f0
jmp 0x497b83
cmp eax, 2
je 0x497b7a
cmp eax, 4
jne 0x497b89
mov eax, dword [ebp - 0x10]
push eax
call fcn.00542260
mov dword [ebp - 0x20], edi
add esp, 4
mov eax, dword [ebp - 0x18]
cmp eax, 3
jne 0x497c92
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.00542c70
add esp, 0xc
test eax, eax
je 0x497bc9
mov eax, dword [ebp - 0x10]
push eax
call fcn.0053b150
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.0053b150
add esp, 8
mov dword [ebp - 0x18], 6
jmp 0x497c27
mov ecx, dword [ebp - 0x14]
lea edx, [ebp - 0x1c]
push edx
mov edx, dword [ebp - 0x10]
lea eax, [ebp - 0x30]
push eax
push ecx
push edx
call fcn.00542d70
mov eax, dword [ebp - 0x20]
add esp, 0x10
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
cmp eax, 2
jne 0x497c22
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.00542c70
add esp, 0xc
test eax, eax
jne 0x497cf0
mov eax, dword [ebp - 0x10]
push eax
mov dword [ebp - 0x24], 0x18
mov dword [ebp - 0x1c], ebx
call fcn.00542240
mov eax, dword [ebp - 0x18]
add esp, 4
cmp eax, 6
jne 0x497c3d
mov edx, dword [ebp - 0x10]
push edx
mov dword [ebp - 0x24], 0x20
mov dword [ebp - 0x1c], ebx
call fcn.00542240
add esp, 4
mov eax, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x3c]
push eax
push ecx
push edx
call fcn.0048c9f0
mov ebx, eax
add esp, 0xc
mov dword [ebp - 0x28], ebx
test ebx, ebx
jne 0x497d08
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
push eax
push ecx
call fcn.0053aa00
push ebx
lea edx, [ebp - 0x14]
push edx
lea eax, [ebp - 0x10]
push eax
call fcn.0053ae30
add esp, 0x14
xor eax, eax
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret
cmp eax, ebx
jne 0x497ccf
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.00542c70
add esp, 0xc
test eax, eax
je 0x497cba
mov eax, dword [ebp - 0x10]
push eax
call fcn.0053b180
jmp 0x497bb4
mov ecx, dword [ebp - 0x20]
mov edx, 1
shl edx, cl
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x1c], edx
jmp 0x497be7
cmp eax, 4
jne 0x497bea
mov eax, dword [ebp - 0x10]
push eax
call fcn.0053b180
add esp, 4
mov dword [ebp - 0x18], 6
jmp 0x497c27
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.0053b150
add esp, 4
mov dword [ebp - 0x18], 6
jmp 0x497c27
mov eax, dword [ebp - 0x18]
cmp eax, 3
jne 0x497d51
mov eax, dword [ebx]
xor esi, esi
add eax, 0x28
cmp dword [ebp - 0x1c], esi
jle 0x497d91
xor ecx, ecx
inc eax
nop
mov edx, dword [ebp - 0x30]
movzx edx, byte [ecx + edx]
mov byte [eax + 1], dl
mov edx, dword [ebp - 0x30]
movzx edx, byte [ecx + edx + 1]
mov byte [eax], dl
mov edx, dword [ebp - 0x30]
movzx edx, byte [ecx + edx + 2]
mov byte [eax - 1], dl
mov byte [eax + 2], 0
inc esi
add ecx, 3
add eax, 4
cmp esi, dword [ebp - 0x1c]
jl 0x497d20
jmp 0x497d91
test eax, eax
jne 0x497d91
mov ecx, dword [ebx]
mov eax, dword [ebp - 0x1c]
add ecx, 0x28
xor edi, edi
test eax, eax
jle 0x497d91
xor esi, esi
add ecx, 2
lea ebx, [eax - 1]
mov eax, esi
cdq
idiv ebx
mov byte [ecx + 1], 0
inc edi
add esi, 0xff
add ecx, 4
mov byte [ecx - 6], al
mov byte [ecx - 5], al
mov byte [ecx - 4], al
mov eax, dword [ebp - 0x1c]
cmp edi, eax
jl 0x497d68
mov ebx, dword [ebp - 0x28]
push 0
push 0
push ebx
call fcn.00442a80
mov edi, dword [ebp - 0x2c]
mov esi, dword [ebx + 0xc]
mov dword [ebp - 0x38], eax
add esp, 0xc
lea eax, [edi*4]
neg esi
call fcn.0051b500
xor eax, eax
mov edx, esp
test edi, edi
jbe 0x497dcb
mov ecx, dword [ebp - 0x38]
mov dword [edx + eax*4], ecx
inc eax
add ecx, esi
cmp eax, dword [ebp - 0x2c]
jb 0x497dc0
mov eax, dword [ebp - 0x10]
push edx
push eax
call fcn.0053a910
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push ecx
push edx
call fcn.0053aa00
push 0
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
push ecx
call fcn.0053ae30
mov edx, dword [ebp - 0x34]
push edx
call fcn.005107e0
add esp, 0x20
mov eax, ebx
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00517235
mov esp, ebp
pop ebp
ret