Function at 0x1003d0f0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x20]
push esi
push edi
mov edi, dword [esp + 0x1c]
push ebx
push edi
mov dword [esp + 0x18], 0
call fcn.10034520
mov esi, eax
mov dword [esp + 0xc], esi
test esi, esi
jns 0x1003d13a
cmp esi, 0xffffffee
jne 0x1003d17a
mov eax, ebx
or eax, 0x40
push eax
push edi
call fcn.10034520
mov esi, eax
mov dword [esp + 0xc], eax
test esi, esi
js 0x1003d17a
mov dword [esp + 0x10], 1
mov edi, dword [esp + 0x18]
mov eax, 4
push ebp
mov ebp, dword [esp + 0x30]
cmp ebp, eax
cmovl ebp, eax
lea eax, [esp + 0x20]
push eax
push ebp
push esi
push dword [edi + 0x7d]
call fcn.1002b350
mov ebx, eax
test ebx, ebx
jns 0x1003d1cb
push esi
call sub.KERNEL32.dll__lclose
mov ecx, dword [edi + 0x7d]
xor eax, eax
pop ebp
pop edi
pop esi
mov dword [ecx + 4], ebx
pop ebx
add esp, 8
ret 0x18
mov ebx, dword [esp + 0x18]
mov edx, 0x104
mov ecx, dword [ebx + 0x7d]
add ecx, 0x1750
sub edi, ecx
mov edi, edi
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x1003d1a9
mov al, byte [edi + ecx]
test al, al
je 0x1003d1a9
mov byte [ecx], al
inc ecx
dec edx
jne 0x1003d190
jmp 0x1003d1ad
test edx, edx
jne 0x1003d1ae
dec ecx
mov byte [ecx], 0
mov eax, dword [ebx + 0x7d]
pop edi
mov dword [eax], 0x4395
mov eax, dword [ebx + 0x7d]
mov dword [eax + 4], esi
xor eax, eax
pop esi
pop ebx
add esp, 8
ret 0x18
push dword [esp + 0x20]
call fcn.100342e0
mov ebx, eax
test ebx, ebx
jne 0x1003d1ff
push esi
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x4396
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffff3
xor eax, eax
add esp, 8
ret 0x18
sub dword [esp + 0x20], 0x1c4
mov esi, ebx
mov eax, dword [esp + 0x10]
add ebx, 0x1c4
push 0
push 0
mov dword [esi + 0x99], edi
push eax
mov dword [esi], eax
mov dword [esi + 4], 0
call dword [sym.imp.KERNEL32.dll__llseek]
mov eax, dword [edi + 0x7d]
push 0x50
add eax, 0x17c
push eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll__lread]
cmp eax, 0x50
je 0x1003d275
push esi
call fcn.10034320
push dword [esp + 0x10]
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x4397
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffff0
xor eax, eax
add esp, 8
ret 0x18
mov eax, dword [edi + 0x7d]
movsx ecx, byte [eax + 0x17f]
movsx eax, byte [eax + 0x17e]
and ecx, 0xff
shl ecx, 8
and eax, 0xff
or ecx, eax
mov byte [esi + 0xe], 1
test byte [esp + 0x2c], 1
mov dword [esi + 0x27], ecx
je 0x1003d2a8
mov byte [esi + 0xe], 0x21
cmp dword [esp + 0x14], 0
je 0x1003d2b3
or dword [edi + 8], 1
mov eax, dword [edi + 0x7d]
add eax, 0x182
push eax
call fcn.10034610
mov dword [esi + 0xf], eax
test eax, eax
jns 0x1003d2cf
mov dword [esi + 0xf], 0
mov eax, dword [edi + 0x7d]
add eax, 0x182
push eax
call fcn.10034610
mov dword [esi + 0xf], eax
mov dword [esi + 0x13], eax
mov eax, dword [edi + 0x7d]
movzx ecx, byte [eax + 0x17d]
movzx eax, byte [eax + 0x17c]
shl ecx, 8
or ecx, eax
cmp dword [esp + 0x24], 1
mov dword [esi + 0x17], ecx
mov ecx, dword [edi + 0x7d]
mov al, byte [ecx + 0x180]
jne 0x1003d33e
cmp al, 1
je 0x1003d364
push esi
call fcn.10034320
push dword [esp + 0x10]
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x4398
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffffd
xor eax, eax
add esp, 8
ret 0x18
cmp al, 4
je 0x1003d362
cmp al, 7
je 0x1003d362
mov dword [ecx], 0x4399
mov eax, dword [edi + 0x7d]
pop ebp
pop edi
pop esi
mov dword [eax + 4], 0xfffffffd
xor eax, eax
pop ebx
add esp, 8
ret 0x18
mov al, 4
mov byte [esi + 0xd], al
mov eax, dword [edi + 0x7d]
movsx eax, byte [eax + 0x181]
shl eax, 0xa
mov dword [esi + 0x1b], eax
add eax, 0xfffffffa
cdq
idiv dword [esi + 0x17]
mov dword [esi + 0x1f], eax
mov eax, dword [edi + 0x7d]
add eax, 0x186
push eax
call fcn.100345f0
mov word [esi + 0x2b], ax
mov ecx, 1
test ax, ax
jne 0x1003d3a1
mov word [esi + 0x2b], cx
mov eax, dword [edi + 0x7d]
add eax, 0x188
push eax
call fcn.100345f0
mov word [esi + 0x2d], ax
test ax, ax
jne 0x1003d3c1
mov eax, 1
mov word [esi + 0x2d], ax
mov eax, dword [edi + 0x7d]
add eax, 0x18a
push eax
call fcn.100345f0
mov word [esi + 0x2f], ax
test ax, ax
jne 0x1003d3e1
mov eax, 1
mov word [esi + 0x2f], ax
mov eax, dword [edi + 0x7d]
add eax, 0x18c
push eax
call fcn.100345f0
mov word [esi + 0x31], ax
test ax, ax
jne 0x1003d401
mov eax, 1
mov word [esi + 0x31], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1c9
push eax
call fcn.100345f0
mov word [esi + 0x33], ax
mov dword [esi + 0x49], 0
mov eax, dword [edi + 0x7d]
movzx eax, byte [eax + 0x19d]
mov dword [esi + 0x35], eax
test eax, eax
jne 0x1003d431
mov eax, dword [edi + 0x39]
mov dword [esi + 0x35], eax
mov eax, dword [edi + 0x7d]
movzx eax, byte [eax + 0x19f]
mov dword [esi + 0x39], eax
mov eax, dword [edi + 0x7d]
add eax, 0x1c5
push eax
call fcn.10034610
mov dword [esi + 0x69], eax
mov dword [esi + 0x6d], eax
mov eax, dword [edi + 0x7d]
movzx eax, byte [eax + 0x1a5]
mov dword [esi + 0x23], eax
cmp eax, dword [edi + 0x23]
je 0x1003d492
push esi
call fcn.10034320
push dword [esp + 0x10]
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x439a
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffff6
xor eax, eax
add esp, 8
ret 0x18
cmp dword [esi + 0x27], 0xab
mov eax, dword [esi + 0x17]
jg 0x1003d4a3
sub eax, 4
jmp 0x1003d4a6
sub eax, 6
mov dword [esi + 0x95], eax
mov eax, 0x8fff
mov word [esi + 0x9d], ax
mov eax, dword [edi + 0x7d]
add eax, 0x19a
push eax
call fcn.100345f0
mov word [esi + 0x9f], ax
mov eax, dword [edi + 0x7d]
mov al, byte [eax + 0x19c]
mov byte [esi + 0xa1], al
test al, al
jne 0x1003d4e7
mov byte [esi + 0xa1], 1
mov eax, dword [edi + 0x7d]
mov al, byte [eax + 0x1b5]
mov byte [esi + 0xc], al
mov eax, dword [edi + 0x7d]
add eax, 0x1a1
push eax
call fcn.100345f0
mov word [esi + 0x41], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1a3
push eax
call fcn.100345f0
mov word [esi + 0x43], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1a1
push eax
call fcn.10034610
test eax, eax
je 0x1003d588
mov eax, dword [edi + 0x45]
cmp eax, dword [esi + 0x1b]
jge 0x1003d57a
push dword [edi + 0x79]
call fcn.10034320
mov eax, dword [esi + 0x1b]
push eax
mov dword [edi + 0x45], eax
call fcn.100342e0
mov dword [edi + 0x79], eax
test eax, eax
jne 0x1003d57a
push esi
call fcn.10034320
push dword [esp + 0x10]
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x439b
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffff3
xor eax, eax
add esp, 8
ret 0x18
mov eax, dword [edi + 0x45]
mov dword [esi + 0x45], eax
mov eax, dword [edi + 0x79]
mov dword [esi + 0x79], eax
jmp 0x1003d596
mov dword [esi + 0x45], 0
mov dword [esi + 0x79], 0
xor eax, eax
mov ecx, 0x20
mov dword [esi + 0x4d], eax
lea eax, [esi + 0xa8]
jmp 0x1003d5b0
xor edx, edx
mov dword [eax], 0xff
mov word [eax - 2], dx
lea eax, [eax + 8]
mov word [eax - 4], dx
dec ecx
jne 0x1003d5b0
mov dword [esi + 0x1b8], ebx
mov eax, dword [esi + 0x17]
add ebx, eax
sub dword [esp + 0x20], eax
mov dword [esi + 0x1bc], ebx
mov eax, dword [esi + 0x17]
add ebx, eax
sub dword [esp + 0x20], eax
xor eax, eax
cmp dword [esp + 0x24], 1
mov word [esi + 0x1b2], ax
je 0x1003d627
mov ecx, dword [esp + 0x28]
cmp ecx, 0xff
jg 0x1003d627
mov eax, dword [edi + 0x3d]
dec ecx
je 0x1003d627
lea edi, [eax + 1]
lea esp, [esp]
movzx eax, byte [edi]
lea edi, [edi + 2]
add dx, ax
mov word [esi + 0x1b2], dx
dec ecx
jne 0x1003d610
mov edi, dword [esp + 0x1c]
mov dword [esi + 0x5d], ebp
mov dword [esi + 0x61], 0
mov dword [esi + 0xa2], ebx
test ebp, ebp
jle 0x1003d65e
lea eax, [ebx + ebp]
lea ecx, [ebx + 3]
lea ebx, [eax + ebp*8]
xor eax, eax
lea ecx, [ecx + 9]
mov word [ecx - 0xc], ax
dec ebp
mov byte [ecx - 0xa], al
mov word [ecx - 9], ax
sub dword [esp + 0x20], 9
test ebp, ebp
jg 0x1003d644
mov edx, dword [esi + 0x5d]
mov dword [esi + 0x51], ebx
mov dword [esi + 0x55], ebx
mov ebp, dword [esi + 0xa2]
test edx, edx
jle 0x1003d68e
lea ecx, [ebx + 0xc]
mov dword [ebx + 8], ebp
lea eax, [ebx - 0xc]
mov dword [ebx], ecx
mov dword [ebx + 4], eax
dec edx
sub dword [esp + 0x20], 0xc
add ebp, 9
mov ebx, ecx
test edx, edx
jg 0x1003d671
mov eax, dword [esi + 0x51]
lea ecx, [esi + 0xa6]
sub ebx, 0xc
mov dword [esi + 0x59], ebx
mov dword [eax + 4], 0
mov dword [ebx], 0
mov ebx, 1
mov ax, word [esi + 0x9f]
mov word [ecx], ax
mov ebp, dword [esi + 0xa2]
mov dword [esi + 0x1a6], ecx
mov dword [esi + 0x1aa], ecx
mov dword [esi + 0x1ae], 0x8ffd0000
mov eax, dword [esi + 0x5d]
mov dword [esp + 0x1c], eax
cmp eax, ebx
jl 0x1003d6f9
push dword [esi + 0x1b]
call fcn.100342e0
mov dword [ebp + 5], eax
test eax, eax
je 0x1003d726
inc ebx
add ebp, 9
cmp ebx, dword [esp + 0x1c]
jle 0x1003d6e0
mov dword [esi + 4], 0x263a
pop ebp
mov dword [esi + 0x1b4], 0
mov dword [esi + 0x1c0], 0
mov eax, dword [edi + 0x7d]
mov dword [esi + 0x7d], eax
mov eax, esi
pop edi
pop esi
pop ebx
add esp, 8
ret 0x18
lea eax, [ebx - 1]
push eax
lea eax, [ebp - 9]
push eax
call fcn.10036bf0
push esi
call fcn.10034320
push dword [esp + 0x10]
call sub.KERNEL32.dll__lclose
mov eax, dword [edi + 0x7d]
pop ebp
mov dword [eax], 0x439c
mov eax, dword [edi + 0x7d]
pop edi
pop esi
pop ebx
mov dword [eax + 4], 0xfffffff3
xor eax, eax
add esp, 8
ret 0x18