Function at 0x10039290
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, 0x1410
call fcn.10047770
push ebx
push 0x60000
call fcn.1001e450
mov ebx, eax
add esp, 4
mov dword [esp + 8], ebx
test ebx, ebx
jne 0x100392ba
pop ebx
add esp, 0x1410
ret
xor ecx, ecx
lea edx, [ebx + 2]
nop
mov eax, ecx
lea edx, [edx + 0xc]
sar eax, 0xa
mov byte [edx - 0xe], al
mov eax, ecx
sar eax, 5
and al, 0x1f
mov byte [edx - 0xd], al
mov al, cl
and al, 0x1f
inc ecx
mov byte [edx - 0xc], al
mov dword [edx - 0xa], 0
cmp ecx, 0x8000
jl 0x100392c0
push ebp
mov ebp, dword [esp + 0x141c]
imul ebp, dword [esp + 0x1420]
push esi
push edi
mov dword [esp + 0x1424], ebp
test ebp, ebp
jle 0x10039368
mov ecx, dword [esp + 0x1434]
mov esi, ebp
mov edi, dword [esp + 0x1430]
mov edx, ecx
mov ebx, dword [esp + 0x1438]
sub edi, ecx
mov ebp, dword [esp + 0x14]
sub ebx, ecx
nop word [eax + eax]
movzx ecx, byte [edi + edx]
lea edx, [edx + 1]
movzx eax, byte [edx - 1]
and ecx, 0xfffffff8
and eax, 0xfffffff8
shl ecx, 5
add ecx, eax
movzx eax, byte [ebx + edx - 1]
shr eax, 3
lea eax, [eax + ecx*4]
lea eax, [eax + eax*2]
inc dword [ebp + eax*4 + 4]
sub esi, 1
jne 0x10039330
mov ebp, dword [esp + 0x1424]
mov ebx, dword [esp + 0x14]
lea ecx, [esp + 0x28]
mov edx, 0x100
mov dword [ecx + 8], 0
xor eax, eax
mov dword [ecx], 0
mov dword [ecx + 4], 0
nop word [eax + eax]
mov byte [ecx + eax - 8], 0
mov byte [ecx + eax - 5], 0xff
inc eax
cmp eax, 3
jl 0x10039390
add ecx, 0x14
sub edx, 1
jne 0x10039371
xor ecx, ecx
lea eax, [ebx + 4]
nop dword [eax]
cmp dword [eax], 0
jg 0x100393c1
inc ecx
add eax, 0xc
cmp ecx, 0x8000
jl 0x100393b0
lea eax, [ecx + ecx*2]
mov edi, 1
inc ecx
lea esi, [ebx + eax*4]
mov dword [esp + 0x30], esi
cmp ecx, 0x8000
jge 0x100393fa
lea eax, [ecx + ecx*2]
mov edx, 0x8000
lea eax, [ebx + eax*4]
sub edx, ecx
cmp dword [eax + 4], 0
jle 0x100393f2
mov dword [esi + 8], eax
inc edi
mov esi, eax
add eax, 0xc
sub edx, 1
jne 0x100393e6
mov dword [esi + 8], 0
lea eax, [esp + 0x18]
mov esi, dword [esp + 0x142c]
push eax
lea eax, [esp + 0x24]
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], ebp
push dword [esi]
mov dword [esp + 0x20], 1
push eax
call fcn.100396d0
add esp, 0xc
cmp eax, 1
je 0x10039447
push ebx
call fcn.1001e430
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1410
ret
mov eax, dword [esi]
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x1440]
cmp edx, eax
jae 0x10039481
mov ecx, edx
jge 0x10039481
lea eax, [edx*2 + 1]
add eax, edi
add eax, edx
nop word [eax + eax]
mov word [eax], 0
lea eax, [eax + 3]
mov byte [eax - 4], 0
inc ecx
cmp ecx, dword [esi]
jl 0x10039470
xor ebx, ebx
test edx, edx
je 0x10039500
lea ecx, [edi + 2]
lea ebp, [esp + 0x30]
mov dword [esp + 0x10], ecx
cmp dword [ebp - 8], 0
jle 0x100394f1
mov ecx, dword [ebp]
xor esi, esi
xor edi, edi
xor edx, edx
test ecx, ecx
je 0x100394c0
mov byte [ecx + 3], bl
movzx eax, byte [ecx]
add edx, eax
movzx eax, byte [ecx + 1]
add edi, eax
movzx eax, byte [ecx + 2]
mov ecx, dword [ecx + 8]
add esi, eax
test ecx, ecx
jne 0x100394a5
lea eax, [edx*8]
mov ecx, dword [esp + 0x10]
cdq
idiv dword [ebp - 8]
mov byte [ecx - 2], al
lea eax, [edi*8]
cdq
idiv dword [ebp - 8]
mov byte [ecx - 1], al
lea eax, [esi*8]
cdq
idiv dword [ebp - 8]
mov edx, dword [esp + 0x18]
mov byte [ecx], al
inc ebx
add ecx, 3
add ebp, 0x14
mov dword [esp + 0x10], ecx
cmp ebx, edx
jb 0x10039492
xor ebx, ebx
xor edi, edi
xor ebp, ebp
cmp dword [esp + 0x1424], ebx
jle 0x10039643
mov esi, dword [esp + 0x1430]
mov eax, dword [esp + 0x1434]
mov ecx, dword [esp + 0x1438]
sub eax, esi
sub dword [esp + 0x143c], esi
sub ecx, esi
mov dword [esp + 0x1434], eax
mov dword [esp + 0x1438], ecx
movzx eax, byte [eax + esi]
lea edx, [ecx + esi]
movzx ecx, byte [esi]
and eax, 0xfffffff8
and ecx, 0xfffffff8
mov dword [esp + 0x1c], edx
shl ecx, 5
add ecx, eax
movzx eax, byte [edx]
shr eax, 3
lea eax, [eax + ecx*4]
mov ecx, dword [esp + 0x14]
lea eax, [eax + eax*2]
movzx ecx, byte [ecx + eax*4 + 3]
mov eax, dword [esp + 0x143c]
mov byte [eax + esi], cl
mov eax, dword [esp + 0x1440]
movzx esi, byte [esi]
lea eax, [eax + ecx*2]
add eax, ecx
mov dword [esp + 0x10], eax
movzx edx, byte [eax]
mov ecx, edx
sub ecx, esi
test ecx, ecx
jle 0x1003959b
mov eax, ecx
jmp 0x1003959f
mov eax, esi
sub eax, edx
cmp ebp, eax
jge 0x100395af
test ecx, ecx
jle 0x100395ab
mov ebp, ecx
jmp 0x100395af
mov ebp, esi
sub ebp, edx
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1434]
movzx edx, byte [eax + 1]
mov eax, dword [esp + 0x1430]
movzx esi, byte [ecx + eax]
mov eax, edx
sub eax, esi
test eax, eax
jle 0x100395d5
mov ecx, eax
jmp 0x100395d9
mov ecx, esi
sub ecx, edx
cmp ebx, ecx
jge 0x100395e9
test eax, eax
jle 0x100395e5
mov ebx, eax
jmp 0x100395e9
mov ebx, esi
sub ebx, edx
mov eax, dword [esp + 0x10]
movzx edx, byte [eax + 2]
mov eax, dword [esp + 0x1c]
movzx esi, byte [eax]
mov eax, edx
sub eax, esi
test eax, eax
jle 0x10039604
mov ecx, eax
jmp 0x10039608
mov ecx, esi
sub ecx, edx
cmp edi, ecx
jge 0x10039618
test eax, eax
jle 0x10039614
mov edi, eax
jmp 0x10039618
mov edi, esi
sub edi, edx
mov esi, dword [esp + 0x1430]
mov eax, dword [esp + 0x1434]
inc esi
sub dword [esp + 0x1424], 1
mov ecx, dword [esp + 0x1438]
mov dword [esp + 0x1430], esi
jne 0x10039541
push dword [esp + 0x14]
call fcn.1001e430
mov ecx, dword [esp + 0x1430]
add esp, 4
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
mov dword [ecx], eax
mov eax, 1
pop ebx
add esp, 0x1410
ret