Function at 0x595d10
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov ecx, dword fs:[0x14]
mov ecx, dword [ecx]
cmp esp, dword [ecx + 8]
jbe 0x596073
sub esp, 0x48
movzx eax, byte [esp + 0x4c]
lea edx, [eax - 1]
cmp dl, 7
ja 0x59605a
mov edx, dword [esp + 0x54]
test edx, edx
je 0x59601e
mov ebx, dword [esp + 0x50]
movzx ebp, byte [ebx]
cmp al, 8
jae 0x595d68
movzx ecx, al
cmp ecx, 0x20
sbb esi, esi
mov edi, 1
shl edi, cl
and edi, esi
add edi, 0xffffffff
and ebp, edi
mov dword [esp + 0x38], ebp
movzx ecx, al
cmp ecx, 0x20
sbb eax, eax
mov esi, 1
shl esi, cl
and esi, eax
mov eax, esi
add esi, 0xffffffff
add ecx, 0xffffffe0
mov edi, ecx
neg ecx
mov dword [esp + 0x34], ecx
cmp ecx, 0x20
sbb edx, edx
cmp edi, 0x20
sbb ebx, ebx
mov ecx, edi
mov ebp, 1
shl ebp, cl
mov ecx, dword [esp + 0x34]
mov edi, 1
shr edi, cl
and edi, edx
and ebx, ebp
or ebx, edi
add eax, 0xffffffff
adc ebx, 0xffffffff
test ebx, ebx
seta al
sete dl
mov ebx, dword [esp + 0x38]
cmp ebx, esi
xchg ebp, ebx
setb bl
xchg ebp, ebx
and ebp, edx
or ebp, eax
xchg ebp, eax
test al, al
xchg ebp, eax
jne 0x595fd8
mov eax, dword [esp + 0x58]
lea edx, [eax - 1]
mov ebp, edx
neg edx
sar edx, 0x1f
and edx, 1
mov esi, dword [esp + 0x50]
add edx, esi
mov edi, dword [esp + 0x54]
mov ecx, eax
lea eax, [edi - 1]
mov dword [esp + 0x3c], eax
xor eax, eax
mov dword [esp + 0x38], eax
xor eax, eax
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x3c]
jmp 0x595e48
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x30]
mov eax, ebp
mov edx, ecx
mov ebp, ebx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x38], ecx
mov ebx, dword [esp + 0x28]
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], edi
mov ecx, dword [esp + 0x58]
mov esi, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
test eax, eax
jle 0x595fa4
mov dword [esp + 0x44], edx
mov dword [esp + 0x30], eax
mov dword [esp + 0x2c], ebp
mov edi, dword [esp + 0x18]
cmp edi, 1
sbb esi, esi
xor esi, 0xffffffff
mov edi, dword [esp + 0x14]
or esi, edi
cmp esi, 0x20
sbb edi, edi
movzx eax, byte [edx]
mov byte [esp + 0x13], al
and eax, 0x7f
mov dword [esp + 0x34], eax
mov ecx, esi
shl eax, cl
and eax, edi
mov edi, eax
add eax, ebx
mov dword [esp + 0x28], eax
add ecx, 0xffffffe0
mov dword [esp + 0x24], ecx
cmp ecx, 0x20
sbb esi, esi
neg ecx
mov dword [esp + 0x20], ecx
cmp ecx, 0x20
sbb eax, eax
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x34]
shl edx, cl
mov ecx, dword [esp + 0x20]
mov ebp, dword [esp + 0x34]
shr ebp, cl
and ebp, eax
and edx, esi
or edx, ebp
add edi, ebx
mov eax, dword [esp + 0x38]
adc edx, eax
mov eax, dword [esp + 0x2c]
dec eax
mov ebx, eax
neg eax
sar eax, 0x1f
and eax, 1
mov ebp, dword [esp + 0x44]
add eax, ebp
mov ebp, dword [esp + 0x30]
dec ebp
movzx esi, byte [esp + 0x13]
xchg esi, eax
test al, 0x80
xchg esi, eax
je 0x595f78
mov dword [esp + 0x30], ebx
mov dword [esp + 0x1c], edx
mov esi, dword [esp + 0x14]
add esi, 7
mov edi, dword [esp + 0x18]
adc edi, 0
test edi, edi
mov ecx, eax
seta al
sete dl
cmp esi, 0x3f
setae bl
and ebx, edx
or ebx, eax
test bl, bl
je 0x595e16
lea eax, [0x6cb9b0]
mov dword [esp], eax
lea eax, [0x7cd1c0]
mov dword [esp + 4], eax
call fcn.0040a0f0
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
mov edx, dword [esp + 0x50]
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x54]
mov dword [esp + 0x68], edx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x6c], edx
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
add esp, 0x48
ret
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x5c], ecx
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], ebp
mov dword [esp + 0x6c], ebx
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
add esp, 0x48
ret
mov eax, dword [0x7cd1b8]
mov edx, dword [0x7cd1bc]
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], esi
mov dword [esp + 0x68], edi
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], edx
add esp, 0x48
ret
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], 0
mov eax, dword [esp + 0x58]
dec eax
mov ecx, eax
neg eax
sar eax, 0x1f
and eax, 1
mov edx, dword [esp + 0x50]
add eax, edx
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x54]
dec eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
add esp, 0x48
ret
mov eax, dword [0x7cd1b8]
mov ecx, dword [0x7cd1bc]
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], 0
mov ebx, dword [esp + 0x50]
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], edx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x6c], edx
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], ecx
add esp, 0x48
ret
lea eax, [0x643700]
mov dword [esp], eax
lea eax, [0x6c8588]
mov dword [esp + 4], eax
call fcn.00431bb0
nop
call fcn.0045b380
jmp fcn.00595d10