Function at 0x1004f160
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd0
mov eax, dword [0x101911c0]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0xcc], eax
mov dword [ebp - 0xc8], edx
mov dword [ebp - 0xc4], edi
mov eax, dword [edi]
mov dword [eax + 8], 0
call fcn.1004e5c0
mov edx, dword [edi]
mov ecx, dword [edx + 8]
mov dword [ebp - 0xbc], ecx
test eax, eax
jne 0x1004f1b9
mov edx, ecx
mov ecx, edi
push eax
call fcn.1004dd70
jmp 0x1004f7bc
cmp ecx, 3
jne 0x1004f1e4
cmp dword [edi + 0x47ec], ecx
je 0x1004f1d8
cmp dword [edi + 0x47e8], 0
jne 0x1004f1e4
cmp dword [edi + 0x47e4], 0
jne 0x1004f1e4
mov dword [ebp - 0xc0], 1
jmp 0x1004f1ee
mov dword [ebp - 0xc0], 0
mov dword [ebp - 0x9c], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0xb8], xmm0
test ecx, ecx
jle 0x1004f2fd
lea esi, [edi + 0x46a0]
lea ebx, [ebp - 0x7c]
mov dword [ebp - 0x94], esi
nop dword [eax]
mov eax, dword [edi]
mov eax, dword [eax]
add eax, 3
push eax
call fcn.100e7eda
add esp, 4
mov dword [esi + 0x34], eax
test eax, eax
je 0x1004f317
mov eax, dword [edi + 0x4684]
cdq
idiv dword [esi]
mov dword [ebx + 0xc], 0
mov dword [ebp - 0x90], eax
mov dword [ebx - 4], eax
mov eax, dword [edi + 0x4688]
cdq
idiv dword [esi + 4]
xor edx, edx
mov esi, eax
mov eax, dword [ebp - 0x90]
mov ecx, esi
mov dword [ebx], esi
sar ecx, 1
dec eax
mov dword [ebx + 8], ecx
mov ecx, dword [edi]
add eax, dword [ecx]
mov ecx, dword [ebp - 0x90]
div ecx
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x94]
mov eax, dword [eax + 0x28]
mov dword [ebx - 8], eax
mov dword [ebx - 0xc], eax
cmp ecx, 1
jne 0x1004f2ac
cmp esi, ecx
jne 0x1004f2a0
mov eax, fcn.10019cb0
jmp 0x1004f2cf
cmp esi, 2
jne 0x1004f2ca
mov eax, 0x1004e850
jmp 0x1004f2cf
cmp ecx, 2
jne 0x1004f2ca
cmp esi, 1
jne 0x1004f2bd
mov eax, 0x1004ea30
jmp 0x1004f2cf
cmp esi, 2
jne 0x1004f2ca
mov eax, dword [edi + 0x4814]
jmp 0x1004f2cf
mov eax, 0x1004ed50
mov esi, dword [ebp - 0x94]
mov dword [ebx - 0x10], eax
add esi, 0x48
mov eax, dword [ebp - 0x9c]
add ebx, 0x20
inc eax
mov dword [ebp - 0x94], esi
mov dword [ebp - 0x9c], eax
cmp eax, dword [ebp - 0xbc]
jl 0x1004f220
mov eax, dword [edi]
mov ecx, dword [eax]
mov esi, dword [eax + 4]
test ecx, ecx
js 0x1004f795
jne 0x1004f343
lea ebx, [ecx*4]
jmp 0x1004f363
mov edx, dword [edi]
mov ecx, edi
push 0
mov edx, dword [edx + 8]
call fcn.1004dd70
mov ecx, dword [0x10194d48]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0x10], 0x1014f780
jmp 0x1004f7bc
mov eax, 0x7fffffff
cdq
idiv ecx
cmp eax, 4
jl 0x1004f795
lea ebx, [ecx*4]
test ebx, ebx
js 0x1004f795
test esi, esi
js 0x1004f795
je 0x1004f37d
mov eax, 0x7fffffff
cdq
idiv esi
cmp ebx, eax
jg 0x1004f795
imul esi, ecx
lea eax, [esi*4 + 1]
push eax
call fcn.100e7eda
mov edx, dword [edi]
mov ecx, eax
add esp, 4
mov dword [ebp - 0x90], ecx
test ecx, ecx
je 0x1004f797
xor ebx, ebx
mov dword [ebp - 0x94], ebx
cmp dword [edx + 4], ebx
jbe 0x1004f756
mov dword [ebp - 0x90], ecx
nop dword [eax]
mov eax, dword [edx]
imul eax, ebx
cmp dword [ebp - 0xbc], 0
mov dword [ebp - 0xa0], 0
lea esi, [ecx + eax*4]
mov dword [ebp - 0x98], esi
jle 0x1004f4b8
lea ebx, [edi + 0x46bc]
mov edi, dword [ebp - 0x90]
lea esi, [ebp - 0x74]
mov eax, dword [esi - 8]
lea ecx, [esi - 0x10]
sar eax, 1
lea edx, [esi - 0x14]
mov dword [ebp - 0xa8], ecx
mov dword [ebp - 0x90], edx
cmp dword [esi], eax
jl 0x1004f41b
mov eax, dword [edx]
mov edx, ecx
mov dword [ebp - 0x9c], ecx
jmp 0x1004f431
mov eax, ecx
mov dword [ebp - 0x90], edx
mov dword [ebp - 0x9c], eax
mov dword [ebp - 0xa8], eax
mov eax, dword [ecx]
push dword [esi - 0xc]
push dword [esi - 4]
push eax
push dword [edx]
push dword [ebx + 0x18]
call dword [esi - 0x18]
mov ecx, dword [ebp - 0xa0]
add esp, 0x14
mov dword [ebp + ecx*4 - 0xb8], eax
mov eax, dword [esi]
inc eax
mov dword [esi], eax
cmp eax, dword [esi - 8]
jl 0x1004f487
mov edx, dword [ebp - 0x9c]
mov eax, dword [ebp - 0x90]
inc dword [esi + 4]
mov dword [esi], 0
mov edx, dword [edx]
mov dword [eax], edx
mov eax, dword [esi + 4]
cmp eax, dword [ebx]
jge 0x1004f487
mov eax, dword [ebx + 4]
add eax, edx
mov edx, dword [ebp - 0xa8]
mov dword [edx], eax
inc ecx
add esi, 0x20
add ebx, 0x48
mov dword [ebp - 0xa0], ecx
cmp ecx, dword [ebp - 0xbc]
jl 0x1004f3f4
mov esi, dword [ebp - 0x98]
mov ebx, dword [ebp - 0x94]
mov dword [ebp - 0x90], edi
mov edi, dword [ebp - 0xc4]
mov eax, dword [edi]
mov edx, eax
mov ecx, dword [eax + 8]
cmp ecx, 3
jne 0x1004f56f
cmp dword [ebp - 0xc0], 0
je 0x1004f540
xor ebx, ebx
cmp dword [eax], ebx
jbe 0x1004f707
mov eax, dword [ebp - 0xb8]
lea ecx, [esi + 2]
mov esi, dword [ebp - 0xb4]
sub eax, esi
mov edx, dword [ebp - 0xb0]
sub edx, esi
mov dword [ebp - 0x98], eax
mov dword [ebp - 0xa4], edx
jmp 0x1004f508
mov edx, dword [ebp - 0xa4]
movzx eax, byte [eax + esi]
lea ecx, [ecx + 4]
mov byte [ecx - 6], al
lea esi, [esi + 1]
movzx eax, byte [esi - 1]
inc ebx
mov byte [ecx - 5], al
movzx eax, byte [edx + esi - 1]
mov byte [ecx - 4], al
mov eax, dword [ebp - 0x98]
mov byte [ecx - 3], 0xff
mov edx, dword [edi]
cmp ebx, dword [edx]
jb 0x1004f502
mov ebx, dword [ebp - 0x94]
jmp 0x1004f740
push 4
push dword [eax]
mov eax, dword [edi + 0x4810]
push dword [ebp - 0xb0]
push dword [ebp - 0xb4]
push dword [ebp - 0xb8]
push esi
call eax
mov edx, dword [edi]
add esp, 0x18
mov ebx, dword [ebp - 0x94]
jmp 0x1004f740
cmp ecx, 4
jne 0x1004f70f
mov ecx, dword [edi + 0x47e8]
test ecx, ecx
jne 0x1004f654
mov dword [ebp - 0xa0], ecx
cmp dword [eax], ecx
jbe 0x1004f707
mov ecx, dword [ebp - 0xb4]
lea ebx, [esi + 2]
mov esi, dword [ebp - 0xac]
sub ecx, esi
mov eax, dword [ebp - 0xb8]
mov dword [ebp - 0xa4], ecx
sub eax, esi
mov ecx, dword [ebp - 0xb0]
sub ecx, esi
mov dword [ebp - 0xa8], eax
mov dword [ebp - 0x98], ecx
nop word [eax + eax]
movzx ecx, byte [eax + esi]
lea ebx, [ebx + 4]
movzx edx, byte [esi]
lea esi, [esi + 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 6], al
mov eax, dword [ebp - 0xa4]
movzx ecx, byte [eax + esi - 1]
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 5], al
mov eax, dword [ebp - 0x98]
movzx ecx, byte [eax + esi - 1]
imul ecx, edx
mov byte [ebx - 3], 0xff
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [ebx - 4], al
mov eax, dword [ebp - 0xa0]
mov edx, dword [edi]
inc eax
mov dword [ebp - 0xa0], eax
cmp eax, dword [edx]
mov eax, dword [ebp - 0xa8]
jb 0x1004f5d0
mov ebx, dword [ebp - 0x94]
jmp 0x1004f740
mov eax, dword [edx]
mov edx, dword [edi + 0x4810]
push 4
push eax
push dword [ebp - 0xb0]
push dword [ebp - 0xb4]
push dword [ebp - 0xb8]
push esi
cmp ecx, 2
jne 0x1004f700
call edx
mov edx, dword [edi]
xor ebx, ebx
add esp, 0x18
cmp dword [edx], ebx
jbe 0x1004f707
add esi, 2
nop
mov eax, dword [ebp - 0xac]
lea esi, [esi + 4]
movzx edx, byte [ebx + eax]
inc ebx
movzx eax, byte [esi - 6]
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 [esi - 6], al
movzx eax, byte [esi - 5]
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 [esi - 5], al
movzx eax, byte [esi - 4]
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 [esi - 4], al
mov edx, dword [edi]
cmp ebx, dword [edx]
jb 0x1004f690
mov ebx, dword [ebp - 0x94]
jmp 0x1004f740
call edx
mov edx, dword [edi]
add esp, 0x18
mov ebx, dword [ebp - 0x94]
jmp 0x1004f740
xor esi, esi
cmp dword [eax], esi
jbe 0x1004f740
mov ecx, dword [ebp - 0x98]
inc ecx
nop dword [eax]
mov eax, dword [ebp - 0xb8]
lea ecx, [ecx + 4]
mov al, byte [esi + eax]
inc esi
mov byte [ecx - 3], al
mov byte [ecx - 4], al
mov byte [ecx - 5], al
mov byte [ecx - 2], 0xff
mov edx, dword [edi]
cmp esi, dword [edx]
jb 0x1004f720
mov ecx, dword [ebp - 0x90]
inc ebx
mov dword [ebp - 0x94], ebx
cmp ebx, dword [edx + 4]
jb 0x1004f3c0
mov edx, dword [edx + 8]
mov ecx, edi
push 0
call fcn.1004dd70
mov ecx, dword [edi]
add esp, 4
mov eax, dword [ebp - 0xc8]
mov ecx, dword [ecx]
mov dword [eax], ecx
mov ecx, dword [edi]
mov eax, dword [ebp - 0xcc]
mov ecx, dword [ecx + 4]
mov dword [eax], ecx
mov eax, dword [ebp - 0x90]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.100dd01c
mov esp, ebp
pop ebp
ret
mov edx, dword [edi]
mov edx, dword [edx + 8]
mov ecx, edi
push 0
call fcn.1004dd70
mov ecx, dword [0x10194d48]
mov eax, dword fs:[0x2c]
mov eax, dword [eax + ecx*4]
mov dword [eax + 0x10], 0x1014f78c
mov ecx, dword [ebp - 8]
add esp, 4
xor ecx, ebp
xor eax, eax
pop edi
pop esi
pop ebx
call fcn.100dd01c
mov esp, ebp
pop ebp
ret