Function at 0x495850
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x597670]
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 0x4958aa
push eax
call fcn.00508510
mov esi, eax
add esp, 4
mov dword [ebp - 0x34], esi
cmp esi, ebx
je 0x4958aa
push ebx
mov edi, 8
push edi
lea eax, [ebp - 0xc]
push eax
push esi
call fcn.00508770
push edi
lea ecx, [ebp - 0xc]
push ebx
push ecx
call fcn.0052de70
add esp, 0x1c
test eax, eax
je 0x4958c0
push esi
call fcn.00508670
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.0050f0b5
mov esp, ebp
pop ebp
ret
push ebx
push ebx
push esi
call fcn.00508700
push ebx
push ebx
push ebx
push 0x56b6e0
call fcn.00531b60
add esp, 0x1c
mov dword [ebp - 0x10], eax
cmp eax, ebx
je 0x4958a1
push eax
call fcn.0052e370
add esp, 4
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x495919
push ebx
lea edx, [ebp - 0x10]
push ebx
push edx
call fcn.00532cb0
push esi
call fcn.00508670
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.0050f0b5
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
push 0x495830
push esi
push eax
call fcn.0053b880
mov ecx, dword [ebp - 0x10]
push 0x40
push fcn.0051067c
push ecx
mov dword [ebp - 0x28], ebx
call fcn.0053b580
push ebx
push eax
call fcn.005107bc
add esp, 0x20
test eax, eax
je 0x49598c
push ebx
lea edx, [ebp - 0x14]
push edx
lea eax, [ebp - 0x10]
push eax
call fcn.00532cb0
mov eax, dword [ebp - 0x28]
add esp, 0xc
cmp eax, ebx
je 0x49596a
push eax
call fcn.0048a110
add esp, 4
mov ecx, dword [ebp - 0x34]
push ecx
call fcn.00508670
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.0050f0b5
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
push edx
push eax
call fcn.00531c20
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.0053ab10
add esp, 0x2c
test eax, eax
jne 0x4959fd
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push ecx
push edx
call fcn.00532880
push ebx
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
push ecx
call fcn.00532cb0
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.0050f0b5
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x20]
cmp eax, 0x10
jne 0x495a10
mov edx, dword [ebp - 0x10]
push edx
call fcn.00532f70
jmp 0x495a23
cmp eax, 2
je 0x495a1a
cmp eax, 4
jne 0x495a29
mov eax, dword [ebp - 0x10]
push eax
call fcn.0053a0e0
mov dword [ebp - 0x20], edi
add esp, 4
mov eax, dword [ebp - 0x18]
cmp eax, 3
jne 0x495b32
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.0053aaf0
add esp, 0xc
test eax, eax
je 0x495a69
mov eax, dword [ebp - 0x10]
push eax
call fcn.00532fd0
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00532fd0
add esp, 8
mov dword [ebp - 0x18], 6
jmp 0x495ac7
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.0053abf0
mov eax, dword [ebp - 0x20]
add esp, 0x10
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
cmp eax, 2
jne 0x495ac2
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.0053aaf0
add esp, 0xc
test eax, eax
jne 0x495b90
mov eax, dword [ebp - 0x10]
push eax
mov dword [ebp - 0x24], 0x18
mov dword [ebp - 0x1c], ebx
call fcn.0053a0c0
mov eax, dword [ebp - 0x18]
add esp, 4
cmp eax, 6
jne 0x495add
mov edx, dword [ebp - 0x10]
push edx
mov dword [ebp - 0x24], 0x20
mov dword [ebp - 0x1c], ebx
call fcn.0053a0c0
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.0048a8a0
mov ebx, eax
add esp, 0xc
mov dword [ebp - 0x28], ebx
test ebx, ebx
jne 0x495ba8
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
push eax
push ecx
call fcn.00532880
push ebx
lea edx, [ebp - 0x14]
push edx
lea eax, [ebp - 0x10]
push eax
call fcn.00532cb0
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.0050f0b5
mov esp, ebp
pop ebp
ret
cmp eax, ebx
jne 0x495b6f
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push 0x10
push ecx
push edx
call fcn.0053aaf0
add esp, 0xc
test eax, eax
je 0x495b5a
mov eax, dword [ebp - 0x10]
push eax
call fcn.00533000
jmp 0x495a54
mov ecx, dword [ebp - 0x20]
mov edx, 1
shl edx, cl
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x1c], edx
jmp 0x495a87
cmp eax, 4
jne 0x495a8a
mov eax, dword [ebp - 0x10]
push eax
call fcn.00533000
add esp, 4
mov dword [ebp - 0x18], 6
jmp 0x495ac7
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00532fd0
add esp, 4
mov dword [ebp - 0x18], 6
jmp 0x495ac7
mov eax, dword [ebp - 0x18]
cmp eax, 3
jne 0x495bf1
mov eax, dword [ebx]
xor esi, esi
add eax, 0x28
cmp dword [ebp - 0x1c], esi
jle 0x495c31
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 0x495bc0
jmp 0x495c31
test eax, eax
jne 0x495c31
mov ecx, dword [ebx]
mov eax, dword [ebp - 0x1c]
add ecx, 0x28
xor edi, edi
test eax, eax
jle 0x495c31
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 0x495c08
mov ebx, dword [ebp - 0x28]
push 0
push 0
push ebx
call fcn.00442a90
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.00513380
xor eax, eax
mov edx, esp
test edi, edi
jbe 0x495c6b
mov ecx, dword [ebp - 0x38]
mov dword [edx + eax*4], ecx
inc eax
add ecx, esi
cmp eax, dword [ebp - 0x2c]
jb 0x495c60
mov eax, dword [ebp - 0x10]
push edx
push eax
call fcn.00532790
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
push ecx
push edx
call fcn.00532880
push 0
lea eax, [ebp - 0x14]
push eax
lea ecx, [ebp - 0x10]
push ecx
call fcn.00532cb0
mov edx, dword [ebp - 0x34]
push edx
call fcn.00508670
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.0050f0b5
mov esp, ebp
pop ebp
ret