Function at 0x1040d3e
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
cmp dword [esp + 0x30], 0
mov dword [esp + 0x10], edx
js 0x10412c6
mov eax, dword [esp + 0x10]
mov dword [esp], ecx
mov esi, 0x8a
mov ecx, 7
mov edx, 4
movzx ebp, word [eax + 2]
xor eax, eax
test bp, bp
sete al
cmove ecx, esi
sub edx, eax
mov eax, dword [esp]
xor edi, edi
xor esi, esi
mov dword [esp + 0xc], edx
dec edi
xor edx, edx
mov ebx, ebp
mov ebp, dword [esp + 0x10]
mov dword [esp + 4], esi
inc esi
mov dword [esp + 0x18], edx
cmp esi, ecx
movzx ebp, word [ebp + edx*4 + 6]
jge 0x1040da9
cmp ebx, ebp
je 0x10412b5
cmp esi, dword [esp + 0xc]
mov dword [esp + 0x14], ebp
mov dword [esp + 8], ebx
jge 0x1040e65
mov ecx, dword [eax + 0x16bc]
movzx edi, word [eax + ebx*4 + 0xa7c]
movzx edx, word [eax + ebx*4 + 0xa7e]
mov ebp, 0x10
mov ebx, edi
sub ebp, edx
shl ebx, cl
or bx, word [eax + 0x16b8]
cmp ecx, ebp
mov word [eax + 0x16b8], bx
jle 0x1040e4d
mov ecx, dword [eax + 8]
mov ebp, dword [eax + 0x14]
mov dword [esp + 4], ecx
mov ecx, dword [esp]
lea eax, [ebp + 1]
mov dword [ecx + 0x14], eax
mov eax, dword [esp + 4]
mov ecx, dword [esp]
mov byte [eax + ebp], bl
mov eax, dword [esp]
mov ebx, dword [esp]
mov ecx, dword [ecx + 8]
mov al, byte [eax + 0x16b9]
mov ebx, dword [ebx + 0x14]
mov byte [esp + 4], al
mov eax, dword [esp]
lea ebp, [ebx + 1]
mov dword [eax + 0x14], ebp
mov al, byte [esp + 4]
mov byte [ecx + ebx], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
shr edi, cl
lea ecx, [edx + ebx - 0x10]
mov word [eax + 0x16b8], di
jmp 0x1040e4f
add ecx, edx
mov ebx, dword [esp + 8]
dec esi
mov dword [eax + 0x16bc], ecx
jne 0x1040dc1
jmp 0x1041284
test ebx, ebx
je 0x1041037
cmp ebx, edi
jne 0x1040e80
mov edx, dword [eax + 0x16bc]
mov dword [esp + 4], esi
jmp 0x1040f1b
mov ecx, dword [esp]
mov edx, dword [eax + 0x16bc]
movzx esi, word [eax + ebx*4 + 0xa7e]
mov ebp, dword [esp]
mov eax, 0x10
movzx edi, word [ecx + ebx*4 + 0xa7c]
mov ecx, edx
sub eax, esi
mov ebx, edi
shl ebx, cl
or bx, word [ebp + 0x16b8]
cmp edx, eax
mov eax, dword [esp]
mov word [eax + 0x16b8], bx
jle 0x1040f13
mov ecx, dword [esp]
mov eax, dword [esp]
mov edx, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea ebp, [ecx + 1]
mov dword [edx + 0x14], ebp
mov edx, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [edx + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
mov edx, dword [esp]
lea ebp, [ebx + 1]
mov dword [edx + 0x14], ebp
mov byte [ecx + ebx], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
lea edx, [esi + ebx - 0x10]
shr edi, cl
mov word [eax + 0x16b8], di
jmp 0x1040f15
add edx, esi
mov dword [eax + 0x16bc], edx
mov ecx, dword [esp]
movzx esi, word [eax + 0xabe]
mov ebp, dword [esp]
mov eax, 0x10
movzx edi, word [ecx + 0xabc]
mov ecx, edx
sub eax, esi
mov ebx, edi
shl ebx, cl
or bx, word [ebp + 0x16b8]
cmp edx, eax
mov eax, dword [esp]
mov word [eax + 0x16b8], bx
jle 0x1040fa8
mov ecx, dword [esp]
mov eax, dword [esp]
mov edx, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea ebp, [ecx + 1]
mov dword [edx + 0x14], ebp
mov edx, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [edx + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
mov edx, dword [esp]
lea ebp, [ebx + 1]
mov dword [edx + 0x14], ebp
mov byte [ecx + ebx], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
lea edx, [esi + ebx - 0x10]
shr edi, cl
mov word [eax + 0x16b8], di
mov ebx, edi
jmp 0x1040faa
add edx, esi
mov ecx, dword [esp + 4]
mov dword [eax + 0x16bc], edx
add ecx, 0xfffd
movzx ebp, cx
mov ecx, edx
mov eax, ebp
shl eax, cl
or ebx, eax
mov eax, dword [esp]
cmp edx, 0xf
mov word [eax + 0x16b8], bx
jl 0x104102d
mov ecx, dword [esp]
mov eax, dword [esp]
mov edi, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea esi, [ecx + 1]
mov dword [edi + 0x14], esi
mov esi, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [esp]
mov esi, dword [esi + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov byte [ecx + esi], al
mov eax, dword [esp]
mov cl, 0x10
mov edx, dword [eax + 0x16bc]
sub cl, dl
shr ebp, cl
mov ecx, edx
mov word [eax + 0x16b8], bp
add ecx, 0xfffffff2
jmp 0x104127a
mov ecx, edx
add ecx, 2
jmp 0x104127a
cmp esi, 0xa
jg 0x1041161
mov ecx, dword [esp]
mov edx, dword [eax + 0x16bc]
movzx esi, word [eax + 0xac2]
mov ebp, dword [esp]
mov eax, 0x10
movzx edi, word [ecx + 0xac0]
mov ecx, edx
sub eax, esi
mov ebx, edi
shl ebx, cl
or bx, word [ebp + 0x16b8]
cmp edx, eax
mov eax, dword [esp]
mov word [eax + 0x16b8], bx
jle 0x10410d3
mov ecx, dword [esp]
mov eax, dword [esp]
mov edx, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea ebp, [ecx + 1]
mov dword [edx + 0x14], ebp
mov edx, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [edx + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
mov edx, dword [esp]
lea ebp, [ebx + 1]
mov dword [edx + 0x14], ebp
mov byte [ecx + ebx], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
lea edx, [esi + ebx - 0x10]
shr edi, cl
mov word [eax + 0x16b8], di
mov ebx, edi
jmp 0x10410d5
add edx, esi
mov dword [eax + 0x16bc], edx
mov eax, dword [esp + 4]
mov ecx, edx
add eax, 0xfffe
movzx edx, ax
mov eax, edx
shl eax, cl
or ebx, eax
mov eax, dword [esp]
cmp ecx, 0xe
mov word [eax + 0x16b8], bx
jl 0x1041157
mov ecx, dword [esp]
mov eax, dword [esp]
mov edi, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea esi, [ecx + 1]
mov dword [edi + 0x14], esi
mov esi, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [esp]
mov esi, dword [esi + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov byte [ecx + esi], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
shr edx, cl
mov ecx, ebx
mov word [eax + 0x16b8], dx
add ecx, 0xfffffff3
jmp 0x104127a
mov esi, ecx
add ecx, 3
jmp 0x104127a
mov ecx, dword [esp]
mov edx, dword [eax + 0x16bc]
movzx esi, word [eax + 0xac6]
mov ebp, dword [esp]
mov eax, 0x10
movzx edi, word [ecx + 0xac4]
mov ecx, edx
sub eax, esi
mov ebx, edi
shl ebx, cl
or bx, word [ebp + 0x16b8]
cmp edx, eax
mov eax, dword [esp]
mov word [eax + 0x16b8], bx
jle 0x10411f4
mov ecx, dword [esp]
mov eax, dword [esp]
mov edx, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea ebp, [ecx + 1]
mov dword [edx + 0x14], ebp
mov edx, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [edx + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
mov edx, dword [esp]
lea ebp, [ebx + 1]
mov dword [edx + 0x14], ebp
mov byte [ecx + ebx], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
lea edx, [esi + ebx - 0x10]
shr edi, cl
mov word [eax + 0x16b8], di
mov ebx, edi
jmp 0x10411f6
add edx, esi
mov dword [eax + 0x16bc], edx
mov eax, dword [esp + 4]
mov ecx, edx
add eax, 0xfff6
movzx edx, ax
mov eax, edx
shl eax, cl
or ebx, eax
mov eax, dword [esp]
cmp ecx, 0xa
mov word [eax + 0x16b8], bx
jl 0x1041275
mov ecx, dword [esp]
mov eax, dword [esp]
mov edi, dword [esp]
mov ecx, dword [ecx + 0x14]
mov eax, dword [eax + 8]
lea esi, [ecx + 1]
mov dword [edi + 0x14], esi
mov esi, dword [esp]
mov byte [eax + ecx], bl
mov eax, dword [esp]
mov ecx, dword [esp]
mov ebx, dword [esp]
mov esi, dword [esi + 0x14]
mov al, byte [eax + 0x16b9]
mov ecx, dword [ecx + 8]
lea edi, [esi + 1]
mov dword [ebx + 0x14], edi
mov byte [ecx + esi], al
mov eax, dword [esp]
mov cl, 0x10
mov ebx, dword [eax + 0x16bc]
sub cl, bl
shr edx, cl
mov ecx, ebx
mov word [eax + 0x16b8], dx
add ecx, 0xfffffff7
jmp 0x104127a
mov esi, ecx
add ecx, 7
mov ebx, dword [esp + 8]
mov dword [eax + 0x16bc], ecx
mov ebp, dword [esp + 0x14]
xor esi, esi
test bp, bp
jne 0x104129e
mov ecx, 0x8a
mov dword [esp + 0xc], 3
jmp 0x10412b3
xor ecx, ecx
cmp ebx, ebp
mov edx, 4
sete cl
sub edx, ecx
xor ecx, 7
mov dword [esp + 0xc], edx
mov edi, ebx
mov edx, dword [esp + 0x18]
cmp edx, dword [esp + 0x30]
lea edx, [edx + 1]
jne 0x1040d89
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret