Function at 0x40a370
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
mov cl, byte [ebp + 0x55]
mov bl, byte [ebp + 0x56]
mov dl, cl
and dl, 0xc
mov byte [esp + 0xb], bl
neg dl
mov al, cl
sbb dl, dl
sar al, 7
and al, 0x44
and dl, 4
or dl, al
mov eax, dword [ebp + 0x260]
neg eax
sbb al, al
and cl, 3
and al, 0x25
or dl, al
mov al, byte [ebp + 0x220]
and al, 1
shl al, 4
or dl, al
or dl, cl
cmp bl, dl
je 0x40a617
mov al, dl
mov byte [ebp + 0x56], dl
and al, 0x30
lea ebx, [ebp + 0xba0]
push esi
push edi
cmp al, 0x10
jne 0x40a41a
movzx ebp, word [0x4d71d2]
movzx ecx, word [0x4d71be]
movzx esi, word [0x4d71c4]
add ecx, section..text
movzx edi, word [0x4d71ac]
add esi, section..text
movzx eax, word [0x4d71ca]
add edi, section..text
mov dword [esp + 0x18], ebp
add eax, section..text
movzx ebp, word [0x4d71d8]
jmp 0x40a443
movzx ebp, word [0x4d71d4]
mov edi, 0x4021d2
mov ecx, dword [ebx + 0x3a8]
mov esi, dword [ebx + 0x3b4]
mov eax, dword [ebx + 0x3c0]
mov dword [esp + 0x18], ebp
movzx ebp, word [0x4d71da]
mov dword [esp + 0x14], eax
mov dh, dl
xor dh, byte [esp + 0x13]
lea eax, [ebp + section..text]
mov ebp, dword [esp + 0x18]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
mov dword [ebx + 0x3bc], eax
mov al, dl
and al, 4
mov dword [ebx + 0x3a4], ecx
mov dword [ebx + 0x3b0], esi
lea ebp, [ebp + section..text]
mov dword [ebx + 0x380], edi
test dh, 0x64
je 0x40a502
test al, al
jne 0x40a4cf
lea esi, [ebx + 0x268]
mov ecx, 0x59
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
test dl, 2
je 0x40a581
mov dword [ebx + 0x124], 0x40415d
mov dword [ebx + 0x128], 0x40415d
mov dword [ebx + 0x12c], 0x40415d
mov dword [ebx + 0x130], 0x40415d
jmp 0x40a581
test dl, 0x40
je 0x40a4e7
mov eax, 0x4042c4
mov ecx, 0x59
mov edi, ebx
rep stosd dword es:[edi], eax
jmp 0x40a581
test dl, 0x20
mov ecx, 0x404142
mov eax, 0x40416a
mov edi, ebx
cmovne eax, ecx
mov ecx, 0x59
rep stosd dword es:[edi], eax
jmp 0x40a581
test al, al
jne 0x40a581
mov eax, dword [esp + 0x14]
mov dword [ebx + 0x13c], ecx
mov dword [ebx + 0x148], esi
mov dword [ebx + 0x118], edi
mov dword [ebx + 0x154], eax
test dl, 2
je 0x40a551
mov dword [ebx + 0x124], 0x40415d
mov dword [ebx + 0x128], 0x40415d
mov dword [ebx + 0x12c], 0x40415d
mov dword [ebx + 0x130], 0x40415d
jmp 0x40a581
mov eax, dword [ebx + 0x38c]
mov dword [ebx + 0x124], eax
mov eax, dword [ebx + 0x390]
mov dword [ebx + 0x128], eax
mov eax, dword [ebx + 0x394]
mov dword [ebx + 0x12c], eax
mov eax, dword [ebx + 0x398]
mov dword [ebx + 0x130], eax
test dh, 1
je 0x40a5cd
lea edi, [ebx + 0x164]
test dl, 1
jne 0x40a5bf
mov ecx, 0xb2
nop word [eax + eax]
movzx eax, word [ecx + 0x4d7120]
lea edi, [edi + 4]
add eax, section..text
add ecx, 2
mov dword [edi - 4], eax
cmp ecx, 0x134
jb 0x40a5a0
jmp 0x40a5d2
mov ecx, 0x41
mov eax, 0x4041e7
rep stosd dword es:[edi], eax
jmp 0x40a5e2
test dl, 1
jne 0x40a5e2
mov eax, dword [esp + 0x1c]
mov dword [ebx + 0x164], ebp
mov dword [ebx + 0x170], eax
mov ebp, dword [esp + 0x24]
test dl, 0x10
je 0x40a615
test byte [esp + 0x13], 0x10
jne 0x40a615
mov ax, word [ebp + 0x7dc]
lea edi, [ebp + 0xb20]
add ax, ax
mov ecx, 0x20
dec ax
movzx eax, ax
mov edx, eax
shl edx, 0x10
or eax, edx
rep stosd dword es:[edi], eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret