Function at 0x40b300
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov eax, dword [esp + 8]
push ebx
mov ebx, dword [esp + 8]
push esi
mov si, word [esp + 0x14]
test bl, bl
jne 0x40b354
test ax, ax
jne 0x40b354
test si, si
jne 0x40b354
pop esi
mov dword [0x4bf1fc], 0x6d7fe8
mov dword [0x4bf1f8], 0x6cfbe4
mov dword [0x4bf1f4], 0x7e0200
mov dword [0x4bf1f0], 0x7e0412
mov dword [0x4bf1ec], 0x7e0628
xor al, al
pop ebx
ret
cmp si, 2
jne 0x40b37a
mov cl, byte [esp + 0x18]
cmp cl, 1
je 0x40b37a
test cl, cl
je 0x40b373
mov cl, byte [0x7e083c]
mov byte [0x7e1860], cl
mov byte [0x7e083c], 1
push eax
push ebx
call fcn.00409ee0
mov ecx, dword [0x7e083c]
add esp, 8
and ecx, 0xff
cmp ecx, 0xa
ja case.0x40b399.8
jmp dword [ecx*4 + 0x40b798]
test bl, bl
jne case.0x40b399.8
cmp si, 1
jne case.0x40b399.8
mov dword [0x5c7220], eax
pop esi
mov byte [0x7e083c], 1
xor al, al
pop ebx
ret
cmp si, 2
jne case.0x40b399.8
mov edx, dword [0x5c7228]
and edx, 0xff
mov dword [edx*4 + 0x5c722c], eax
mov cl, byte [0x5c7228]
mov al, byte [esp + 0x18]
inc cl
test al, al
mov byte [0x5c7228], cl
jne 0x40b3fb
pop esi
mov al, 1
pop ebx
ret
cmp byte [0x5c7228], 1
jne 0x40b410
pop esi
mov byte [0x7e083c], 2
xor al, al
pop ebx
ret
mov al, byte [0x7e1860]
pop esi
mov byte [0x7e083c], al
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
mov ecx, dword [0x5c726c]
and ecx, 0xff
mov dword [ecx*4 + 0x5c7270], eax
mov al, byte [0x5c726c]
mov cl, byte [0x7e1533]
inc al
cmp al, cl
mov byte [0x5c726c], al
jne case.0x40b399.8
pop esi
mov byte [0x7e083c], 3
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
mov dword [0x5c7370], eax
pop esi
mov byte [0x7e083c], 4
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
mov dword [0x5c7374], eax
pop esi
mov byte [0x7e083c], 5
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
push 0
push 2
push eax
push 0x4bf1f8
call fcn.004119b0
mov dl, al
mov eax, dword [0x6cfbe0]
and edx, 0xff
xor ecx, ecx
mov cx, word [0x803b7c]
add eax, edx
xor edx, edx
mov dword [0x6cfbe0], eax
div ecx
add esp, 0x10
inc word [0x5c7380]
add ecx, 0xfffffff0
and edx, 0xffff
cmp edx, ecx
jne 0x40b51a
mov esi, 8
push 0
push 2
push 0xffff
push 0x4bf1f8
call fcn.004119b0
mov ecx, dword [0x6cfbe0]
and eax, 0xff
add esp, 0x10
add ecx, eax
dec esi
mov dword [0x6cfbe0], ecx
jne 0x40b4ee
mov ax, word [0x5c7380]
cmp ax, word [0x7e1638]
jne case.0x40b399.8
pop esi
mov byte [0x7e083c], 7
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
xor ecx, ecx
push edi
mov cl, byte [0x44e3fe]
push 0
push 1
push ecx
push 0x4bf1f4
mov dword [0x5c7378], eax
call fcn.004119b0
mov edi, dword [0x7e01fc]
xor edx, edx
mov dl, byte [0x44e3ff]
and eax, 0xff
push 0
push 1
add edi, eax
push edx
push 0x4bf1f4
mov dword [0x7e01fc], edi
call fcn.004119b0
mov esi, dword [0x7e01fc]
and eax, 0xff
add esi, eax
mov edi, str.1111
or ecx, 0xffffffff
xor eax, eax
add esp, 0x20
mov dword [0x7e01fc], esi
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov eax, str.1111
je 0x40b5d3
mov esi, ecx
mov edi, dword [0x4bf1f4]
mov dl, byte [eax]
mov byte [edi], dl
mov ebx, dword [0x4bf1f4]
inc ebx
inc eax
dec esi
mov dword [0x4bf1f4], ebx
jne 0x40b5b8
cmp ecx, 0x10
jae 0x40b5f8
mov eax, 0x10
sub eax, ecx
mov ecx, dword [0x4bf1f4]
mov byte [ecx], 0
mov edx, dword [0x4bf1f4]
inc edx
dec eax
mov dword [0x4bf1f4], edx
jne 0x40b5df
mov esi, dword [0x7e01fc]
mov edi, str.1111
or ecx, 0xffffffff
xor eax, eax
add esi, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [0x7e01fc], esi
mov eax, str.1111
je 0x40b63a
mov esi, ecx
mov edi, dword [0x4bf1f4]
mov dl, byte [eax]
mov byte [edi], dl
mov ebx, dword [0x4bf1f4]
inc ebx
inc eax
dec esi
mov dword [0x4bf1f4], ebx
jne 0x40b61f
cmp ecx, 0x10
pop edi
jae 0x40b660
mov eax, 0x10
sub eax, ecx
mov ecx, dword [0x4bf1f4]
mov byte [ecx], 0
mov edx, dword [0x4bf1f4]
inc edx
dec eax
mov dword [0x4bf1f4], edx
jne 0x40b647
mov eax, dword [0x7e01fc]
pop esi
add eax, 0x10
mov byte [0x7e083c], 9
mov dword [0x7e01fc], eax
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
mov dword [0x5c737c], eax
pop esi
mov byte [0x7e083c], 0xa
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
mov cx, word [0x7e1738]
mov dx, cx
neg dx
sbb dl, dl
and dl, 0xc4
dec dl
test cx, cx
mov byte [0x7e164c], dl
jne 0x40b6c9
pop esi
mov byte [0x7e083c], 6
mov al, 2
pop ebx
ret
push 0
push 2
push eax
push 0x4bf1ec
call fcn.004119b0
mov esi, dword [0x7e0624]
and eax, 0xff
add esi, eax
mov ax, word [0x7e0622]
add esp, 0x10
inc ax
cmp ax, word [0x7e1738]
mov dword [0x7e0624], esi
mov word [0x7e0622], ax
jne case.0x40b399.8
pop esi
mov byte [0x7e083c], 6
xor al, al
pop ebx
ret
cmp si, 2
je case.0x40b399.8
push 0
push 2
push eax
push 0x4bf1fc
call fcn.004119b0
mov cl, al
mov eax, dword [0x6d7fe4]
and ecx, 0xff
xor esi, esi
add eax, ecx
mov cx, word [0x803b7c]
mov si, cx
xor edx, edx
mov dword [0x6d7fe4], eax
add esp, 0x10
div esi
inc word [0x5c7382]
sub cx, 8
cmp dx, cx
jne case.0x40b399.8
mov esi, 4
push 0
push 2
push 0xffff
push 0x4bf1fc
call fcn.004119b0
mov ecx, dword [0x6d7fe4]
and eax, 0xff
add esp, 0x10
add ecx, eax
dec esi
mov dword [0x6d7fe4], ecx
jne 0x40b766
pop esi
xor al, al
pop ebx
ret