Function at 0x1003a150
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push esi
push edi
mov edi, ecx
xor ebx, ebx
mov eax, 1
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x1c], ebx
mov edx, dword [edi + 0x1064d8]
lea esi, [edi + 0x1064c8]
inc edx
mov dword [edi + 0x1064d8], edx
mov ecx, dword [edi + 0x1064dc]
cmp ecx, eax
cmovb ecx, eax
mov eax, dword [edi + 0x1064f0]
add eax, dword [edi + 0x1064e0]
imul ecx, eax
cmp edx, ecx
jb 0x1003a984
nop dword [eax]
mov eax, dword [edi + 0x753d0]
mov ecx, edi
shr eax, 0x13
and al, 1
movzx eax, al
push eax
push esi
lea eax, [ebp - 0x14]
push eax
call fcn.1003aa50
test byte [edi + 0x753d0], 0x20
jne 0x1003a4ad
movzx eax, byte [edi + 0x76418]
mov edx, dword [edi + 0x76408]
imul ecx, eax, 0x2c
movzx eax, word [edi + 0x106510]
add ecx, edx
mov dword [ebp - 8], edx
mov edx, eax
mov dword [ebp - 0x18], edx
mov eax, dword [ecx + 4]
mov esi, dword [ecx]
sub eax, esi
mov ecx, edx
sar eax, 1
mov edx, dword [ebp - 8]
cmp ecx, eax
jae 0x1003a201
movzx ecx, word [esi + ecx*2]
jmp 0x1003a206
mov ecx, 0xffff
mov word [edi + 0x10650e], cx
mov eax, dword [edi + 0x763f8]
mov dword [ebp - 0xc], eax
mov eax, dword [edi + 0x763fc]
sub eax, dword [ebp - 0xc]
movzx esi, cx
sar eax, 6
mov dword [ebp - 0x1c], esi
movzx esi, si
cmp cx, ax
jae 0x1003a254
mov eax, dword [ebp - 0x1c]
movzx ecx, cx
shl ecx, 6
add ecx, dword [ebp - 0xc]
movzx esi, ax
mov eax, dword [ecx]
cmp eax, dword [ecx + 4]
jne 0x1003a254
mov eax, 0xfffe
mov word [edi + 0x10650e], ax
mov esi, eax
mov eax, dword [ebp - 0x18]
movzx ecx, si
movzx esi, ax
mov eax, dword [edi + 0x763fc]
sub eax, dword [ebp - 0xc]
sar eax, 6
cmp cx, ax
jb 0x1003a4a6
mov eax, dword [ebp - 0x18]
movzx eax, ax
mov dword [ebp - 0xc], eax
nop dword [eax + eax]
movzx esi, ax
mov eax, 0xffff
cmp cx, ax
je 0x1003a2c0
movzx eax, byte [edi + 0x76418]
imul eax, eax, 0x2c
mov ecx, dword [eax + edx + 4]
sub ecx, dword [eax + edx]
mov edx, dword [ebp - 0xc]
movzx eax, dx
mov edx, dword [ebp - 8]
sar ecx, 1
cmp eax, ecx
jae 0x1003a2c0
mov ecx, dword [ebp - 0xc]
movzx eax, cx
inc eax
mov word [edi + 0x106510], ax
jmp 0x1003a3f1
movzx eax, byte [edi + 0x76418]
imul ecx, eax, 0x2c
movzx eax, word [ecx + edx + 0x28]
movzx edx, ax
mov dword [ebp - 0x1c], edx
mov edx, dword [ebp - 8]
mov dword [ebp - 0xc], eax
test ax, ax
jne 0x1003a32d
mov eax, dword [ebp - 8]
mov edx, dword [ecx + edx]
mov ecx, dword [ecx + eax + 4]
sub ecx, edx
sar ecx, 1
cmp esi, ecx
ja 0x1003a32a
test si, si
je 0x1003a32a
lea eax, [esi - 1]
movzx ecx, ax
test cx, cx
je 0x1003a32a
mov esi, 0xffff
movzx eax, cx
cmp word [edx + eax*2], si
je 0x1003a322
add ecx, esi
test cx, cx
jne 0x1003a307
mov eax, dword [ebp - 0x1c]
movzx esi, ax
mov eax, dword [ebp - 0xc]
jmp 0x1003a330
lea eax, [ecx + 1]
movzx eax, ax
jmp 0x1003a32d
mov eax, dword [ebp - 0xc]
movzx esi, ax
or dword [edi + 0x753d0], 0x80000
mov word [edi + 0x106510], ax
and dword [edi + 0x753d0], 0xfff7ffff
mov dl, byte [edi + 0x76418]
mov ecx, dword [edi + 0x76408]
movzx eax, dl
imul eax, eax, 0x2c
mov dword [ebp - 0xc], ecx
add eax, ecx
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
sar ecx, 1
movzx eax, si
cmp eax, ecx
jae 0x1003a3c0
mov bl, dl
movzx esi, si
movzx eax, bl
mov dl, bl
mov ebx, dword [ebp - 0xc]
imul eax, eax, 0x2c
movzx ecx, si
mov eax, dword [eax + ebx]
mov ebx, 0xfffe
cmp word [eax + ecx*2], bx
jne 0x1003a3bd
lea edx, [esi + 1]
mov word [edi + 0x106510], dx
mov bl, byte [edi + 0x76418]
movzx eax, bl
imul eax, eax, 0x2c
movzx esi, dx
add eax, dword [ebp - 0xc]
mov ecx, dword [eax + 4]
sub ecx, dword [eax]
sar ecx, 1
movzx eax, dx
cmp eax, ecx
jb 0x1003a375
mov dl, bl
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
movzx esi, word [edi + 0x106510]
movzx eax, dl
imul eax, eax, 0x2c
add ecx, eax
mov eax, esi
mov edx, dword [ecx + 4]
sub edx, dword [ecx]
sar edx, 1
cmp eax, edx
jae 0x1003a94f
push esi
call fcn.100470a0
test al, al
je 0x1003a94f
movzx eax, byte [edi + 0x76418]
mov edx, dword [edi + 0x76408]
imul ecx, eax, 0x2c
movzx eax, word [edi + 0x106510]
mov esi, eax
mov dword [ebp - 8], edx
mov eax, dword [ecx + edx + 4]
mov dword [ebp - 0x1c], esi
add ecx, edx
mov edx, dword [ecx]
sub eax, edx
sar eax, 1
cmp esi, eax
jae 0x1003a426
movzx eax, word [edx + esi*2]
jmp 0x1003a42b
mov eax, 0xffff
mov word [edi + 0x10650e], ax
mov eax, dword [edi + 0x763f8]
movzx esi, word [edi + 0x10650e]
mov dword [ebp - 0xc], eax
mov edx, esi
mov eax, dword [edi + 0x763fc]
mov ecx, dword [ebp - 0xc]
sub eax, ecx
sar eax, 6
cmp si, ax
jae 0x1003a477
mov ecx, esi
shl ecx, 6
add ecx, dword [ebp - 0xc]
mov eax, dword [ecx]
cmp eax, dword [ecx + 4]
mov ecx, dword [ebp - 0xc]
jne 0x1003a477
mov eax, 0xfffe
mov word [edi + 0x10650e], ax
mov edx, eax
mov esi, dword [ebp - 0x1c]
movzx eax, dx
mov dword [ebp - 0x18], eax
movzx eax, si
mov dword [ebp - 0xc], eax
mov eax, dword [edi + 0x763fc]
sub eax, ecx
movzx esi, si
mov ecx, dword [ebp - 0x18]
sar eax, 6
cmp dx, ax
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
jae 0x1003a280
mov word [edi + 0x106512], si
movzx esi, word [edi + 0x10650e]
lea eax, [edi + 0x763f8]
push esi
mov ecx, eax
call fcn.10007510
test al, al
je 0x1003a95c
mov eax, dword [edi + 0x763f8]
mov ecx, esi
mov edx, dword [edi + 0x1064f8]
shl ecx, 6
cmp edx, dword [ecx + eax + 0xc]
jb 0x1003a4ed
mov dword [edi + 0x1064f8], 0
xor edx, edx
cmp dword [edi + 0x75410], 0xffffffff
je 0x1003a503
test byte [edi + 0x753d0], 0x20
jne 0x1003a6eb
push dword [ebp - 0x14]
lea ecx, [ebp - 0x24]
mov dword [ebp - 0x20], 0x100
push ecx
lea eax, [edi + 0x106730]
mov dword [ebp - 0x24], eax
lea esi, [edi + 0x13cf50]
movzx eax, word [edi + 0x106510]
mov ecx, esi
push edx
push eax
call fcn.1004e3c0
test al, al
je 0x1003a6eb
mov eax, dword [edi + 0x75410]
test eax, eax
je 0x1003a586
jle 0x1003a54b
dec eax
mov dword [edi + 0x75410], eax
push 1
mov ecx, esi
call fcn.1004dbe0
lea eax, [edi + 0x106730]
mov dword [ebp - 0x28], 0x100
mov dword [ebp - 0x2c], eax
mov ecx, esi
mov eax, dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x2c]
push eax
push dword [edi + 0x1064f8]
movzx eax, word [edi + 0x106510]
push eax
call fcn.1004e3c0
jmp 0x1003a6eb
test dword [edi + 0x753d0], 0x400000
je 0x1003a972
push ecx
lea eax, [edi + 0x1064f8]
mov ecx, esi
push eax
lea eax, [edi + 0x106510]
push eax
call fcn.1004e720
test al, al
jne 0x1003a60a
mov dl, byte [edi + 0x76418]
xor ecx, ecx
mov dword [edi + 0x106510], ecx
mov dword [edi + 0x1064f8], ecx
mov dword [edi + 0x1064fc], ecx
mov eax, dword [edi + 0x7640c]
sub eax, dword [edi + 0x76408]
sar eax, 2
imul eax, eax, 0xba2e8ba3
movzx ecx, al
mov dword [ebp - 0x18], eax
dec ecx
movzx eax, dl
cmp eax, ecx
jge 0x1003a965
inc dl
movzx eax, dl
cmp eax, dword [ebp - 0x18]
jae 0x1003a601
mov byte [edi + 0x76418], dl
push 1
mov ecx, esi
call fcn.1004dbe0
xor esi, esi
lea ebx, [edi + 0x106730]
push 0x8000000
push esi
push edi
push ecx
mov ecx, ebx
call fcn.10033c70
inc esi
mov eax, 0x100
add ebx, 0x368
cmp si, ax
jb 0x1003a612
mov ebx, dword [ebp - 0x10]
mov ecx, edi
call fcn.10030a90
mov eax, dword [edi + 0x753c4]
movzx esi, word [edi + 0x106510]
mov dword [edi + 0x1064f0], eax
mov edx, esi
mov eax, dword [edi + 0x753cc]
mov dword [edi + 0x1064f4], eax
mov eax, dword [edi + 0x753c8]
mov dword [edi + 0x106518], eax
mov eax, dword [edi + 0x1064f8]
mov dword [edi + 0x1064fc], eax
mov dword [ebp - 0x1c], eax
mov word [edi + 0x106512], si
movzx eax, byte [edi + 0x76418]
imul eax, eax, 0x2c
add eax, dword [edi + 0x76408]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub eax, ecx
sar eax, 1
cmp eax, edx
jbe 0x1003a6a7
mov ax, word [ecx + edx*2]
mov word [edi + 0x10650e], ax
lea eax, [edi + 0x106730]
mov dword [ebp - 0x30], 0x100
mov dword [ebp - 0x34], eax
lea ecx, [edi + 0x13cf50]
mov eax, dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x1c]
push esi
call fcn.1004e3c0
movzx eax, word [edi + 0x10650e]
push eax
lea eax, [edi + 0x763f8]
mov ecx, eax
call fcn.10007510
test al, al
je 0x1003a95c
mov eax, dword [edi + 0x753d0]
mov ecx, edi
shr eax, 5
and al, 1
movzx eax, al
push eax
lea eax, [edi + 0x1064c8]
push eax
call fcn.1003aaf0
movzx edx, word [edi + 0x10650e]
lea esi, [edi + 0x106730]
shl edx, 6
add edx, dword [edi + 0x763f8]
mov eax, dword [edx + 0x3c]
mov eax, dword [eax + 0xc]
movzx eax, word [eax + 0x753bc]
imul eax, dword [edi + 0x1064f8]
lea ecx, [eax + eax*2]
mov eax, dword [edx]
lea eax, [eax + ecx*2]
mov dword [ebp - 8], eax
movzx eax, word [edi + 0x753bc]
imul eax, eax, 0x368
add eax, esi
mov dword [ebp - 0x1c], eax
cmp esi, eax
je 0x1003a908
lea eax, [edi + 0x106488]
mov dword [ebp - 0x38], 0x52
mov dword [ebp - 0x3c], eax
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x40], 0x5b
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], 0x5c
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], 0x15
lea ecx, [ebp - 0x3c]
or ebx, 1
call fcn.1002c6d0
test al, al
je 0x1003a7ce
cmp byte [esi + 0x325], 1
jne 0x1003a7ce
mov eax, dword [ebp - 8]
mov al, byte [eax + 3]
cmp al, 2
je 0x1003a7ab
cmp al, 3
jne 0x1003a7ce
push dword [esi + 0x2c0]
movsx eax, word [esi + 0x304]
mov ecx, edi
push eax
movzx eax, byte [esi + 0x320]
push eax
call fcn.1002c070
mov dword [esi + 0x2bc], eax
lea ecx, [ebp - 0x44]
and ebx, 0xfffffffe
call fcn.1002c6d0
test al, al
je 0x1003a836
mov eax, dword [ebp - 8]
mov al, byte [eax]
dec al
cmp al, 0x77
jbe 0x1003a836
mov dl, byte [esi + 0x314]
mov al, dl
dec al
cmp al, 0x77
ja 0x1003a836
cmp byte [esi + 0x317], 0x13
jne 0x1003a836
mov cl, byte [esi + 0x319]
mov al, cl
and al, 0xf0
cmp al, 0xd0
jne 0x1003a836
movzx eax, cl
and eax, 0xf
cmp eax, dword [edi + 0x1064f0]
jb 0x1003a836
movsx eax, word [esi + 0x304]
mov ecx, edi
push 0
push eax
movzx eax, dl
push eax
call fcn.1002c070
mov dword [esi + 0x2bc], eax
and ebx, 0xfffffffd
lea ecx, [ebp - 0x4c]
or ebx, 4
call fcn.1002c6d0
test al, al
je 0x1003a891
lea eax, [edi + 0x106488]
mov dword [ebp - 0x50], 5
lea ecx, [ebp - 0x54]
mov dword [ebp - 0x54], eax
or ebx, 8
call fcn.1002c6d0
test al, al
jne 0x1003a891
cmp dword [edi + 0x1064f0], 1
jne 0x1003a891
cmp byte [esi + 0x317], 0x11
jne 0x1003a891
movzx eax, byte [esi + 0x319]
imul eax, eax, 0x2710
and ebx, 0xfffffff3
mov dword [edi + 0x1064f4], eax
jmp 0x1003a8a0
mov ecx, ebx
and ebx, 0xfffffff7
mov eax, ecx
and al, 8
cmove ebx, ecx
and ebx, 0xfffffffb
mov ecx, dword [ebp - 8]
mov eax, dword [ecx]
mov dword [esi + 0x314], eax
mov ax, word [ecx + 4]
lea ecx, [ebp - 0x5c]
mov word [esi + 0x318], ax
mov eax, dword [esi + 0x2a4]
and dword [esi + 0x58], 0xfff9ffff
mov dword [esi + 0x18], eax
mov eax, dword [esi + 0x2a0]
mov dword [esi + 0x14], eax
call fcn.1002c6d0
test al, al
jne 0x1003a8e1
mov byte [esi + 0x33f], al
add dword [ebp - 8], 6
mov byte [esi + 0x325], 0
mov dword [esi + 0x35c], 0
add esi, 0x368
cmp esi, dword [ebp - 0x1c]
jne 0x1003a785
mov dword [ebp - 0x10], ebx
mov ecx, edi
call fcn.1002c580
cmp byte [ebp - 0x14], 0
je 0x1003a984
mov edx, dword [edi + 0x1064f0]
mov eax, 1
lea esi, [edx + 1]
mov dword [edi + 0x1064d8], esi
mov ecx, dword [edi + 0x1064dc]
cmp ecx, 1
cmovb ecx, eax
mov eax, dword [edi + 0x1064e0]
add eax, edx
imul ecx, eax
cmp esi, ecx
jb 0x1003a984
lea esi, [edi + 0x1064c8]
jmp 0x1003a1a0
push 1
lea ecx, [edi + 0x13cf50]
call fcn.1004dbe0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0x18], 0
jbe 0x1003a972
mov byte [edi + 0x76418], 0
push 1
mov ecx, esi
call fcn.1004dbe0
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ebx, dword [edi + 0x1064f0]
test ebx, ebx
jne 0x1003a99d
mov dword [edi + 0x1064f0], 1
mov ebx, 1
cmp dword [edi + 0x1064d8], 0
je 0x1003aa29
mov ecx, dword [edi + 0x753d0]
and ecx, 0xffffefff
mov dword [edi + 0x753d0], ecx
mov eax, dword [edi + 0x753b4]
test eax, 0x100004
jne 0x1003aa3f
mov esi, ecx
cmp eax, 1
jne 0x1003a9d8
test ecx, 0x200000
je 0x1003aa3f
mov eax, dword [edi + 0x1064e0]
mov ecx, 1
mov edx, dword [edi + 0x1064dc]
cmp edx, 1
cmovb edx, ecx
lea ecx, [eax + ebx]
mov eax, dword [edi + 0x1064d8]
imul edx, ecx
cmp eax, edx
jae 0x1003aa3f
mov ecx, dword [edi + 0x1064e0]
xor edx, edx
add ecx, ebx
div ecx
test edx, edx
jne 0x1003aa3f
or esi, 0x1000
mov ecx, edi
mov dword [edi + 0x753d0], esi
call fcn.10024b30
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x753d0]
and eax, 0xfff7ffff
or eax, 0x1000
mov dword [edi + 0x753d0], eax
mov ecx, edi
call fcn.10024b30
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret