Function at 0x40b45e
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
pushal
mov ecx, 0xe
lea edi, [ebp - 0x40]
xor eax, eax
rep stosd dword es:[edi], eax
mov esi, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
and edx, 0x7fffffff
cmp edx, 0x2d
jb 0x40b818
add edx, esi
mov dword [ebp - 0x44], edx
xor ecx, ecx
add ecx, 4
mov edi, 0x40b820
repe cmpsd dword [esi], dword es:[edi]
jne 0x40b818
lea eax, [esi - 4]
push 0x11
push eax
call fcn.004091d9
bswap eax
cmp eax, dword [esi + 0xd]
jne 0x40b818
cmp byte [esi + 0xb], 0
jne 0x40b818
cmp byte [esi + 0xa], 0
jne 0x40b818
cmp byte [esi + 0xc], 0
jne 0x40b818
movzx ecx, byte [esi + 8]
movzx eax, byte [esi + 9]
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], eax
xor edx, edx
dec edx
shr edx, cl
not edx
mov dword [ebp - 0x14], edx
mov edx, ecx
test dword [ebp - 0x34], 1
jne 0x40b50b
test dword [ebp - 0x34], 2
je 0x40b500
lea edx, [edx + edx*2]
test dword [ebp - 0x34], 4
je 0x40b50b
add edx, ecx
mov dword [ebp - 0x18], edx
mov eax, edx
shr eax, 3
jne 0x40b516
inc eax
mov dword [ebp - 0x10], eax
mov eax, dword [esi]
mov ecx, dword [esi + 4]
bswap eax
bswap ecx
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], ecx
imul eax, edx
add eax, 7
shr eax, 3
mov dword [ebp - 0xc], eax
add esi, 0x11
cmp esi, dword [ebp - 0x44]
jae 0x40b818
lodsd eax, dword [esi]
bswap eax
mov ecx, eax
lea edx, [eax + 4]
lea eax, [esi + edx]
cmp eax, dword [ebp - 0x44]
jae 0x40b818
push edx
push esi
call fcn.004091d9
bswap eax
cmp eax, dword [esi + edx]
jne 0x40b818
lodsd eax, dword [esi]
cmp eax, 0x45544c50
je 0x40b5ad
cmp eax, 0x54414449
je 0x40b5f3
cmp eax, 0x444e4549
je 0x40b63f
cmp eax, 0x534e5274
je 0x40b58e
add esi, ecx
add esi, 4
jmp 0x40b537
mov edi, dword [ebp - 0x2c]
test edi, edi
je 0x40b818
cmp ecx, dword [ebp - 0x28]
ja 0x40b818
lodsb al, byte [esi]
mov byte [edi + 3], al
add edi, 4
loop 0x40b5a2
jmp 0x40b589
cmp dword [ebp - 0x2c], 0
jne 0x40b818
mov eax, ecx
cdq
mov ebx, 3
div ebx
test edx, edx
jne 0x40b818
mov dword [ebp - 0x28], eax
mov ecx, eax
shl eax, 2
push eax
call fcn.00401291
jb 0x40b818
mov dword [ebp - 0x2c], eax
mov edi, eax
or ah, 0xff
lodsb al, byte [esi]
shl eax, 8
lodsb al, byte [esi]
shl eax, 8
lodsb al, byte [esi]
stosd dword es:[edi], eax
loop 0x40b5e2
jmp 0x40b589
mov edi, dword [ebp - 0x24]
test edi, edi
jne 0x40b611
lea eax, [ecx + ecx]
mov dword [ebp - 0x1c], eax
push eax
call fcn.00401291
jb 0x40b818
mov edi, eax
mov dword [ebp - 0x24], eax
mov eax, ecx
add eax, dword [ebp - 0x20]
cmp eax, dword [ebp - 0x1c]
jbe 0x40b632
shl eax, 1
mov dword [ebp - 0x1c], eax
push eax
push edi
call fcn.00401350
jb 0x40b818
mov dword [ebp - 0x24], eax
mov edi, eax
add edi, dword [ebp - 0x20]
add dword [ebp - 0x20], ecx
rep movsb byte es:[edi], byte [esi]
jmp 0x40b589
cmp dword [ebp - 0x24], 0
je 0x40b818
mov edx, dword [ebp - 0x40]
imul edx, dword [ebp - 0x18]
add edx, 7
shr edx, 3
inc edx
imul edx, dword [ebp - 0x3c]
push edx
call fcn.00401291
mov edi, eax
mov esi, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x20]
add esi, 2
sub ecx, 6
push ecx
push esi
push edx
push edi
call fcn.004091f3
jb 0x40b818
push dword [ebp - 0x24]
call fcn.00401319
mov dword [ebp - 0x24], edi
mov dword [ebp - 0x20], edx
xor esi, esi
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 8], eax
movzx eax, byte [edi]
inc edi
xor ecx, ecx
cmp eax, 5
jae 0x40b818
mov edx, dword [eax*4 + 0x40b830]
call edx
inc ecx
cmp ecx, dword [ebp - 0xc]
jne 0x40b6aa
mov esi, edi
add edi, dword [ebp - 0xc]
dec dword [ebp - 8]
jne 0x40b694
push 0
push dword [ebp - 0x3c]
push dword [ebp - 0x40]
call fcn.0040abe8
jb 0x40b818
mov dword [esp + 0x1c], eax
mov edi, dword [eax + 8]
mov esi, dword [ebp - 0x24]
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x40]
mov dword [ebp - 4], eax
inc esi
lodsd eax, dword [esi]
bswap eax
mov ch, 0x20
xor edx, edx
mov ebx, eax
and ebx, dword [ebp - 0x14]
shl eax, cl
sub ch, cl
jne 0x40b700
mov ch, 0x20
lodsd eax, dword [esi]
bswap eax
test dword [ebp - 0x34], 1
jne 0x40b7cf
push ecx
mov ch, 8
xor edx, edx
or edx, ebx
shr ebx, cl
sub ch, cl
jge 0x40b712
and edx, 0xff000000
mov ebx, edx
pop ecx
test dword [ebp - 0x34], 2
jne 0x40b738
rol edx, 8
or edx, ebx
rol edx, 8
or edx, ebx
jmp 0x40b78e
mov ebx, eax
and ebx, dword [ebp - 0x14]
shl eax, cl
sub ch, cl
jne 0x40b748
mov ch, 0x20
lodsd eax, dword [esi]
bswap eax
push ecx
push edx
mov ch, 8
mov edx, ebx
or ebx, edx
shr edx, cl
sub ch, cl
jge 0x40b74e
and ebx, 0xff000000
pop edx
pop ecx
rol edx, 8
or edx, ebx
mov ebx, eax
and ebx, dword [ebp - 0x14]
shl eax, cl
sub ch, cl
jne 0x40b773
mov ch, 0x20
lodsd eax, dword [esi]
bswap eax
push ecx
push edx
mov ch, 8
mov edx, ebx
or ebx, edx
shr edx, cl
sub ch, cl
jge 0x40b779
and ebx, 0xff000000
pop edx
pop ecx
rol edx, 8
or edx, ebx
test dword [ebp - 0x34], 4
jne 0x40b7a2
rol edx, 8
or edx, 0xff000000
jmp 0x40b7d9
mov ebx, eax
and ebx, dword [ebp - 0x14]
shl eax, cl
sub ch, cl
jne 0x40b7b2
mov ch, 0x20
lodsd eax, dword [esi]
bswap eax
push ecx
push edx
mov ch, 8
mov edx, ebx
or ebx, edx
shr edx, cl
sub ch, cl
jge 0x40b7b8
and ebx, 0xff000000
pop edx
pop ecx
rol edx, 8
or edx, ebx
jmp 0x40b7d9
rol ebx, cl
shl ebx, 2
add ebx, dword [ebp - 0x2c]
mov edx, dword [ebx]
push 5
push edx
call fcn.0040b175
mov dword [edi], edx
add edi, 4
dec dword [ebp - 4]
jne 0x40b6ee
movzx eax, ch
shr eax, 3
sub esi, eax
dec dword [ebp - 8]
jne 0x40b6e2
push dword [ebp - 0x2c]
call fcn.00401319
push dword [ebp - 0x24]
call fcn.00401319
clc
popal
mov esp, ebp
pop ebp
ret 8
stc
popal
mov esp, ebp
pop ebp
ret 8