Function at 0x518d70
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x6468c8
mov eax, dword fs:[0]
push eax
sub esp, 0x184
mov eax, dword [0x6ae654]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x184], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
mov ebx, edx
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x180], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x188], eax
mov eax, 0x100
cmp ecx, eax
mov dword [ebp - 0x15c], ecx
mov dword [ebp - 0x160], edx
cmovl eax, ecx
mov ecx, dword [ebp + 0x18]
sar ecx, 3
imul ebx, ecx
mov dword [ebp - 0x174], ecx
lea ecx, [ebp - 0x3c]
mov esi, ebx
mov dword [ebp - 0x150], ebx
imul esi, eax
call fcn.00524180
push esi
lea ecx, [ebp - 0x3c]
mov dword [ebp - 4], 0
call fcn.00524c30
lea ecx, [ebp - 0x3c]
call fcn.00524490
push edi
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x16c], eax
call fcn.0057e300
mov edi, dword [ebp - 0x160]
lea eax, [ebp - 0x20]
mov esi, dword [ebp - 0x15c]
lea ecx, [ebp - 0x134]
push eax
push 0
mov byte [ebp - 4], 1
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], esi
call fcn.0057e5f0
mov eax, esi
mov dword [ebp - 0x170], 0
cdq
mov esi, 0x100
idiv esi
test edx, edx
lea ecx, [eax + 1]
cmove ecx, eax
mov eax, edi
cdq
idiv esi
mov dword [ebp - 0x18c], ecx
test edx, edx
lea edx, [eax + 1]
cmove edx, eax
mov eax, ecx
shl eax, 8
sub eax, esi
mov dword [ebp - 0x190], edx
mov dword [ebp - 0x158], eax
test ecx, ecx
jle 0x5190ee
mov esi, dword [ebp + 0x18]
nop word [eax + eax]
lea ecx, [eax + 0x100]
cmp ecx, dword [ebp - 0x15c]
cmovg ecx, dword [ebp - 0x15c]
sub ecx, eax
xor eax, eax
mov dword [ebp - 0x138], ecx
test edx, edx
jle 0x519096
mov ecx, dword [ebp - 0x174]
mov esi, dword [ebp - 0x16c]
shl ecx, 8
mov dword [ebp - 0x17c], ecx
mov dword [ebp - 0x154], esi
mov dword [ebp - 0x168], edx
nop word [eax + eax]
push dword [ebp - 0x158]
lea ecx, [eax + 0x100]
cmp ecx, dword [ebp - 0x160]
mov edi, ecx
mov dword [ebp - 0x178], ecx
lea ecx, [ebp - 0x134]
cmovg edi, dword [ebp - 0x160]
push eax
sub edi, eax
call fcn.0057e5d0
mov eax, dword [ebp + 0x18]
cmp eax, 8
je 0x519266
cmp eax, 0x18
je 0x51915b
cmp eax, 0x20
jne 0x519062
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x144], esi
call fcn.00446840
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x14c], eax
call fcn.0041d290
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x140], eax
call fcn.0057e5b0
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x164], eax
call fcn.004ad4e0
mov ecx, dword [ebp - 0x14c]
mov dword [ebp - 0x148], eax
test ecx, ecx
je 0x51911f
mov edx, dword [ebp - 0x138]
test edx, edx
jle 0x519062
mov eax, dword [ebp - 0x140]
mov dword [ebp - 0x13c], edx
nop
xor edx, edx
test edi, edi
jle 0x519035
mov ebx, dword [ebp - 0x140]
mov esi, eax
mov eax, dword [ebp - 0x144]
add eax, 2
sub ebx, dword [ebp - 0x144]
nop dword [eax]
cmp byte [edx + ecx], 0
je 0x519004
movzx ecx, byte [esi]
mov byte [eax - 2], cl
movzx ecx, byte [esi + 1]
mov byte [eax - 1], cl
movzx ecx, byte [ebx + eax]
mov byte [eax], cl
mov ecx, dword [ebp - 0x14c]
mov cl, byte [edx + ecx]
jmp 0x51900f
mov word [eax - 2], 0xffff
xor cl, cl
mov byte [eax], 0xff
mov byte [eax + 1], cl
inc edx
mov ecx, dword [ebp - 0x14c]
add eax, 4
add esi, 4
cmp edx, edi
jl 0x518fe0
mov ebx, dword [ebp - 0x150]
mov esi, dword [ebp - 0x144]
mov eax, dword [ebp - 0x140]
add ecx, dword [ebp - 0x164]
add esi, ebx
add eax, dword [ebp - 0x148]
sub dword [ebp - 0x13c], 1
mov dword [ebp - 0x14c], ecx
mov dword [ebp - 0x140], eax
mov dword [ebp - 0x144], esi
jne 0x518fc0
mov ecx, dword [ebp - 0x138]
mov edx, dword [ebp - 0x17c]
add dword [ebp - 0x154], edx
sub dword [ebp - 0x168], 1
mov eax, dword [ebp - 0x178]
mov esi, dword [ebp - 0x154]
jne 0x518f00
mov esi, dword [ebp + 0x18]
mov edi, dword [ebp - 0x160]
push esi
push ecx
mov ecx, dword [ebp - 0x184]
push edi
push dword [ebp - 0x16c]
push dword [ebp - 0x180]
call fcn.00517ed0
mov ecx, dword [ebp - 0x188]
sub dword [ebp - 0x158], 0x100
call fcn.0050fc30
test eax, eax
je 0x5190ee
mov edx, dword [ebp - 0x170]
mov eax, dword [ebp - 0x158]
inc edx
cmp edx, dword [ebp - 0x18c]
mov dword [ebp - 0x170], edx
mov edx, dword [ebp - 0x190]
jl 0x518eb0
lea ecx, [ebp - 0x134]
call fcn.0057e360
lea ecx, [ebp - 0x3c]
call fcn.005241b0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005a4e1e
mov esp, ebp
pop ebp
ret 0x18
mov ecx, dword [ebp - 0x138]
test ecx, ecx
jle 0x519068
mov edx, dword [ebp - 0x154]
mov esi, ecx
add edx, 2
test edi, edi
jle 0x51914f
mov eax, edx
mov ecx, edi
mov dword [eax - 2], 0xffffff
lea eax, [eax + 4]
sub ecx, 1
jne 0x519140
add edx, ebx
sub esi, 1
jne 0x519138
jmp 0x519062
lea ecx, [ebp - 0x134]
call fcn.0041d290
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x148], eax
call fcn.004ad4e0
mov ecx, dword [ebp - 0x138]
lea edx, [edi*4]
mov dword [ebp - 0x144], eax
mov eax, dword [ebp - 0x148]
mov dword [ebp - 0x13c], edx
test eax, eax
je 0x519232
test ecx, ecx
jle 0x519068
mov edi, dword [ebp - 0x154]
mov esi, dword [ebp - 0x144]
add edi, 2
add eax, 2
mov dword [ebp - 0x14c], ecx
mov dword [ebp - 0x140], eax
test edx, edx
jle 0x519218
mov esi, dword [ebp - 0x13c]
mov ecx, edi
dec esi
mov edx, eax
shr esi, 2
inc esi
nop word [eax + eax]
movzx eax, byte [edx - 2]
lea ecx, [ecx + 3]
mov byte [ecx - 5], al
lea edx, [edx + 4]
movzx eax, byte [edx - 5]
mov byte [ecx - 4], al
movzx eax, byte [edx - 4]
mov byte [ecx - 3], al
sub esi, 1
jne 0x5191e0
mov eax, dword [ebp - 0x140]
mov ecx, dword [ebp - 0x14c]
mov edx, dword [ebp - 0x13c]
mov esi, dword [ebp - 0x144]
add eax, esi
add edi, ebx
sub ecx, 1
mov dword [ebp - 0x140], eax
mov dword [ebp - 0x14c], ecx
jne 0x5191c4
jmp 0x519062
lea eax, [edi + edi*2]
mov dword [ebp - 0x148], eax
test ecx, ecx
jle 0x519068
mov edi, ecx
push eax
push 0xff
push esi
call fcn.005051f0
mov eax, dword [ebp - 0x148]
add esp, 0xc
add esi, ebx
sub edi, 1
jne 0x519245
jmp 0x519062
lea ecx, [ebp - 0x134]
call fcn.004ac140
lea ecx, [ebp - 0x134]
cmp eax, 1
jne 0x51930f
call fcn.0041d290
lea ecx, [ebp - 0x134]
mov ebx, eax
call fcn.004ad4e0
mov ecx, dword [ebp - 0x138]
mov dword [ebp - 0x148], eax
test ebx, ebx
je 0x5192db
test ecx, ecx
jle 0x5193ff
mov dword [ebp - 0x13c], ecx
push edi
push ebx
push esi
call fcn.0052c9f0
add ebx, dword [ebp - 0x148]
add esp, 0xc
add esi, dword [ebp - 0x150]
sub dword [ebp - 0x13c], 1
jne 0x5192b0
mov ebx, dword [ebp - 0x150]
jmp 0x519062
mov ebx, dword [ebp - 0x150]
test ecx, ecx
jle 0x519068
mov dword [ebp - 0x13c], ecx
nop
push edi
push 0xff
push esi
call fcn.005051f0
add esp, 0xc
add esi, ebx
sub dword [ebp - 0x13c], 1
jne 0x5192f0
jmp 0x519062
call fcn.004ac140
test al, 0x10
je 0x519062
lea ecx, [ebp - 0x134]
call fcn.0041d290
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x140], eax
call fcn.004ad4e0
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x164], eax
call fcn.00446840
lea ecx, [ebp - 0x134]
mov dword [ebp - 0x144], eax
call fcn.0057e5b0
mov ecx, dword [ebp - 0x144]
mov dword [ebp - 0x148], eax
test ecx, ecx
je 0x5193c8
mov eax, dword [ebp - 0x140]
test eax, eax
je 0x5193c8
mov edx, dword [ebp - 0x138]
test edx, edx
jle 0x519062
mov dword [ebp - 0x13c], edx
push edi
push ecx
push eax
push esi
call fcn.00505aa0
mov ecx, dword [ebp - 0x144]
add esp, 0x10
mov eax, dword [ebp - 0x140]
add esi, ebx
add ecx, dword [ebp - 0x148]
add eax, dword [ebp - 0x164]
sub dword [ebp - 0x13c], 1
mov dword [ebp - 0x144], ecx
mov dword [ebp - 0x140], eax
jne 0x519388
jmp 0x519062
mov ecx, dword [ebp - 0x138]
test ecx, ecx
jle 0x519068
mov dword [ebp - 0x13c], ecx
nop dword [eax]
push edi
push 0xff
push esi
call fcn.005051f0
add esp, 0xc
add esi, ebx
sub dword [ebp - 0x13c], 1
jne 0x5193e0
jmp 0x519062
mov ebx, dword [ebp - 0x150]
jmp 0x519068