Function at 0x40e040
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x28
or al, byte [esp + 0x34]
push ebx
mov ebx, dword [esp + 0x30]
push ebp
push esi
mov esi, ecx
lea ecx, [ebx - 1]
push edi
mov byte [esp + 0x18], al
cmp cl, 5
ja 0x40ddd2
cmp bl, 3
jne 0x40ddda
lea edx, [ebx + 0x66]
cmp dl, 5
ja 0x40dde1
mov byte [esp + 0x17], 1
jmp 0x40dde6
mov byte [esp + 0x17], 0
mov edi, dword [0x48d4e4]
cmp bl, 0x4c
jne 0x40de8e
cmp dword [0x4a2500], 1
jne 0x40de8e
cmp byte [0x49f956], 0
jne 0x40de8e
cmp dword [esp + 0x50], 0
jne 0x40de8e
cmp byte [0x4a32ee], 0
je 0x40de8e
test al, 0xc0
jne 0x40de8e
test byte [0x4a30c9], 0xc0
je 0x40de8e
call dword [0x48d2e4]
sub eax, dword [0x4a30c0]
cmp eax, 0x32
jae 0x40de8e
xor ebp, ebp
cmp esi, ebp
jle 0x40de8e
call dword [0x48d2b8]
cmp eax, dword [0x4a2bbc]
jne 0x40de8e
push 0x5b
call edi
mov ecx, 0x8000
test cx, ax
jne 0x40de6d
push 0x5c
call edi
mov edx, 0x8000
test dx, ax
je 0x40de8e
push 1
push 0x8000012f
mov dword [0x49d328], ebp
call fcn.00401740
add esp, 8
mov dword [0x49d328], 1
jmp 0x40de51
test esi, esi
jle 0x40e08b
mov ebp, esi
mov esi, dword [esp + 0x18]
cmp dword [0x4a2500], 0
jne 0x40df01
call dword [0x48d2e4]
sub eax, dword [0x4a3104]
mov ecx, dword [0x49d3c8]
cmp eax, dword [ecx + 0xb0]
jbe 0x40df01
push 0
push 0
push 0
push 0
lea edx, [esp + 0x2c]
push edx
call dword [0x48d5f4]
test eax, eax
je 0x40def6
push 1
push 0xffffffffffffffff
mov dword [0x49d328], 0
call fcn.00401740
add esp, 8
mov dword [0x49d328], 1
call dword [0x48d2e4]
mov dword [0x4a3104], eax
cmp byte [esp + 0x4c], 0
jne 0x40e029
cmp dword [0x4a2500], 0
je 0x40df1f
mov al, byte [0x49f95e]
jmp 0x40e011
cmp dword [0x4a0b68], 0
je 0x40df32
mov al, byte [0x4a0a35]
jmp 0x40e011
push 0xa0
xor bl, bl
call edi
mov ecx, 0x8000
test cx, ax
je 0x40df47
mov bl, 0x10
push 0xa1
call edi
mov edx, 0x8000
test dx, ax
je 0x40df5b
or bl, 0x20
push 0xa2
call edi
mov ecx, 0x8000
test cx, ax
je 0x40df6f
or bl, 1
push 0xa3
call edi
mov edx, 0x8000
test dx, ax
je 0x40df83
or bl, 2
push 0xa4
call edi
mov ecx, 0x8000
test cx, ax
je 0x40df97
or bl, 4
push 0xa5
call edi
mov edx, 0x8000
test dx, ax
je 0x40dfab
or bl, 8
push 0x5b
call edi
mov ecx, 0x8000
test cx, ax
je 0x40dfbc
or bl, 0x40
push 0x5c
call edi
mov edx, 0x8000
test dx, ax
je 0x40dfcd
or bl, 0x80
cmp dword [0x4a0b68], 0
je 0x40e00a
mov al, bl
not al
and al, byte [0x4a0a35]
je 0x40e00a
mov cl, byte [0x4a0a37]
not al
and byte [0x4a0a35], al
and byte [0x4a0a36], al
and cl, al
mov al, cl
mov byte [0x4a0a37], cl
mov ecx, 0x4a0a58
call fcn.00410d50
movzx eax, byte [ebx - 0x75]
pop esp
and al, 0x3c
mov ecx, dword [esp + 0x50]
push 1
push 0
push ecx
push eax
push esi
mov eax, 0xffc3d44f
call fcn.004105a0
add esp, 0x14
cmp byte [esp], 0x17
add byte [ebp + esi - 0x7d], dh
jl 0x40e057
push eax
add byte [ebp + 0x2e], dh
mov eax, dword [0x49d3cc]
movzx ecx, byte [eax + 0xc7]
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x54]
push edx
mov edx, dword [esp + 0x5c]
push ecx
push 1
push edx
push eax
mov al, byte [esp + 0x70]
and al, 0x70
mov cs, ebx
call fcn.0040f700
add esp, 0x14
jmp 0x40e084
dec ebp
jne 0x40de9c
cmp byte [esp + 0x4c], 0
jne 0x140e1cb
cmp dword [0x4a2500], 0
je 0x40e0aa
mov bl, byte [0x49f95e]
jmp 0x40e196
cmp dword [0x4a0b78], 0
je 0x40e0be
mov bl, byte [0x4a0a35]
jmp 0xc0e196
push 0x4a0
xor bl, bl
call edi
mov ecx, 0x8000
test cx, ax
je 0x40e0d3
mov bl, 0x10
push 0xa1
call edi
mov edx, 0x8000
test dx, ax
je 0x40e0e7
or bl, 0x30
push 0xa2
call edi
mov ecx, 0x8000
test cx, ax
je 0x40e0fb
or bl, 1
push 0xa3
call edi
mov edx, 0x8000
test dx, ax
je 0x40e10f
or bl, 2
push 0xa4
call edi
mov ecx, 0x8000
test cx, ax
je 0x40e123
or bl, 4
push 0xa5
call dword [edi + 0x8000ba]
add byte [esi - 0x7b], ah
ret 0x374
mov cl, bl
mov al, cl
xor al, byte [esp + 0x44]
mov byte [esp + 0x4c], cl
and al, cl
and al, 0xcc
je 0x40e1cb
mov edx, dword [esp + 0x50]
push 0
not al
push 1
push edx
mov eax, dword [esp + 0x59]
and al, cl
movzx eax, al
push edx
push eax
mov eax, 0xffc3d44d
call fcn.004105a0
add esp, 0x14
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret