Function at 0x1003d070
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.100344c0
mov esi, eax
mov dword [esp + 0xc], esi
test esi, esi
jns 0x1003d0ba
cmp esi, 0xffffffee
jne 0x1003d0fa
mov eax, ebx
or eax, 0x40
push eax
push edi
call fcn.100344c0
mov esi, eax
mov dword [esp + 0xc], eax
test esi, esi
js 0x1003d0fa
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.1002b2f0
mov ebx, eax
test ebx, ebx
jns 0x1003d14b
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 0x1003d129
mov al, byte [edi + ecx]
test al, al
je 0x1003d129
mov byte [ecx], al
inc ecx
dec edx
jne 0x1003d110
jmp 0x1003d12d
test edx, edx
jne 0x1003d12e
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.10034280
mov ebx, eax
test ebx, ebx
jne 0x1003d17f
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 0x1003d1f5
push esi
call fcn.100342c0
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 0x1003d228
mov byte [esi + 0xe], 0x21
cmp dword [esp + 0x14], 0
je 0x1003d233
or dword [edi + 8], 1
mov eax, dword [edi + 0x7d]
add eax, 0x182
push eax
call fcn.100345b0
mov dword [esi + 0xf], eax
test eax, eax
jns 0x1003d24f
mov dword [esi + 0xf], 0
mov eax, dword [edi + 0x7d]
add eax, 0x182
push eax
call fcn.100345b0
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 0x1003d2be
cmp al, 1
je 0x1003d2e4
push esi
call fcn.100342c0
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 0x1003d2e2
cmp al, 7
je 0x1003d2e2
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.10034590
mov word [esi + 0x2b], ax
mov ecx, 1
test ax, ax
jne 0x1003d321
mov word [esi + 0x2b], cx
mov eax, dword [edi + 0x7d]
add eax, 0x188
push eax
call fcn.10034590
mov word [esi + 0x2d], ax
test ax, ax
jne 0x1003d341
mov eax, 1
mov word [esi + 0x2d], ax
mov eax, dword [edi + 0x7d]
add eax, 0x18a
push eax
call fcn.10034590
mov word [esi + 0x2f], ax
test ax, ax
jne 0x1003d361
mov eax, 1
mov word [esi + 0x2f], ax
mov eax, dword [edi + 0x7d]
add eax, 0x18c
push eax
call fcn.10034590
mov word [esi + 0x31], ax
test ax, ax
jne 0x1003d381
mov eax, 1
mov word [esi + 0x31], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1c9
push eax
call fcn.10034590
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 0x1003d3b1
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.100345b0
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 0x1003d412
push esi
call fcn.100342c0
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 0x1003d423
sub eax, 4
jmp 0x1003d426
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.10034590
mov word [esi + 0x9f], ax
mov eax, dword [edi + 0x7d]
mov al, byte [eax + 0x19c]
mov byte [esi + 0xa1], al
test al, al
jne 0x1003d467
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.10034590
mov word [esi + 0x41], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1a3
push eax
call fcn.10034590
mov word [esi + 0x43], ax
mov eax, dword [edi + 0x7d]
add eax, 0x1a1
push eax
call fcn.100345b0
test eax, eax
je 0x1003d508
mov eax, dword [edi + 0x45]
cmp eax, dword [esi + 0x1b]
jge 0x1003d4fa
push dword [edi + 0x79]
call fcn.100342c0
mov eax, dword [esi + 0x1b]
push eax
mov dword [edi + 0x45], eax
call fcn.10034280
mov dword [edi + 0x79], eax
test eax, eax
jne 0x1003d4fa
push esi
call fcn.100342c0
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 0x1003d516
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 0x1003d530
xor edx, edx
mov dword [eax], 0xff
mov word [eax - 2], dx
lea eax, [eax + 8]
mov word [eax - 4], dx
dec ecx
jne 0x1003d530
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 0x1003d5a7
mov ecx, dword [esp + 0x28]
cmp ecx, 0xff
jg 0x1003d5a7
mov eax, dword [edi + 0x3d]
dec ecx
je 0x1003d5a7
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 0x1003d590
mov edi, dword [esp + 0x1c]
mov dword [esi + 0x5d], ebp
mov dword [esi + 0x61], 0
mov dword [esi + 0xa2], ebx
test ebp, ebp
jle 0x1003d5de
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 0x1003d5c4
mov edx, dword [esi + 0x5d]
mov dword [esi + 0x51], ebx
mov dword [esi + 0x55], ebx
mov ebp, dword [esi + 0xa2]
test edx, edx
jle 0x1003d60e
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 0x1003d5f1
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 0x1003d679
push dword [esi + 0x1b]
call fcn.10034280
mov dword [ebp + 5], eax
test eax, eax
je 0x1003d6a6
inc ebx
add ebp, 9
cmp ebx, dword [esp + 0x1c]
jle 0x1003d660
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.10036b70
push esi
call fcn.100342c0
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