Function at 0x595e00
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
mov eax, dword [0x6480b4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 1
cmp dword [esi + 0x2c], ebx
je 0x595e95
mov edi, dword [esi + 0x40]
test edi, edi
je 0x595e95
lea edx, [edi + 0x90]
test edx, edx
je 0x595e4a
mov eax, dword [edx]
test eax, eax
je 0x595e4a
mov eax, dword [eax + 4]
jmp 0x595e4c
xor eax, eax
mov ecx, dword [esi + 0x7c]
mov dword [ebp - 0x48], ecx
cmp ecx, dword [edi + 8]
jb 0x596215
cmp eax, 7
jne 0x595eab
mov eax, dword [esi + 0x70]
lea edx, [ebp - 0x50]
push edx
push eax
push ecx
push eax
mov dword [ebp - 0x50], ebx
lea eax, [edi + 0x28]
push dword [edi + 0xc]
lea edx, [edi + 0x90]
xor ebx, ebx
push eax
push edx
call fcn.005a8c10
add esp, 0x1c
test eax, eax
jne 0x595e9a
mov eax, dword [esi + 0x7c]
cmp eax, dword [ebp - 0x50]
je 0x596244
mov eax, 0xffff9400
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0058bb64
mov esp, ebp
pop ebp
ret
cmp eax, 6
je 0x596145
cmp eax, 8
je 0x596145
cmp eax, 2
jne 0x595e95
xor edx, edx
mov dword [ebp - 0x68], edx
cmp dword [esi + 0x14], eax
jl 0x595ed3
mov edx, dword [edi + 0xc]
mov eax, edx
jmp 0x595ed6
mov eax, dword [edi + 0xc]
add eax, edx
cmp ecx, eax
jb 0x596215
mov eax, dword [edi + 0x14]
inc eax
add eax, edx
cmp ecx, eax
jb 0x596215
mov eax, dword [esi + 0x70]
mov ebx, ecx
mov dword [ebp - 0x4c], eax
mov eax, dword [esi + 0x2c]
cmp dword [eax + 0x80], 1
jne 0x595fa5
sub ecx, dword [edi + 0x14]
mov dword [esi + 0x7c], ecx
mov dword [ebp - 0x48], ecx
mov ecx, dword [esi + 0x60]
push 0xd
mov eax, dword [ecx]
mov dword [ebp - 0x14], eax
mov eax, dword [ecx + 4]
mov ecx, dword [esi + 0x64]
mov dword [ebp - 0x10], eax
mov ax, word [ecx]
mov word [ebp - 0xc], ax
mov al, byte [ecx + 2]
mov ecx, dword [ebp - 0x48]
mov byte [ebp - 0xa], al
mov eax, ecx
shr eax, 8
mov byte [ebp - 9], al
lea eax, [ebp - 0x14]
push eax
lea eax, [edi + 0x44]
mov byte [ebp - 8], cl
push eax
call fcn.0059b4c0
push dword [esi + 0x7c]
mov eax, dword [esi + 0x40]
push dword [esi + 0x6c]
add eax, 0x44
push eax
call fcn.0059b4c0
lea eax, [ebp - 0x44]
push eax
mov eax, dword [esi + 0x40]
add eax, 0x44
push eax
call fcn.0059b500
mov eax, dword [esi + 0x40]
add eax, 0x44
push eax
call fcn.0059b5a0
mov edi, dword [esi + 0x40]
lea eax, [ebp - 0x44]
mov ebx, dword [esi + 0x7c]
push dword [edi + 0x14]
push eax
mov eax, dword [esi + 0x6c]
add eax, ebx
push eax
call fcn.00595b70
add esp, 0x30
test eax, eax
jne 0x596215
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x50], 1
xor edx, edx
mov eax, ebx
div dword [edi + 0xc]
test edx, edx
jne 0x596215
cmp dword [esi + 0x14], 2
jl 0x595fe6
sub ecx, dword [edi + 0xc]
sub ebx, dword [edi + 0xc]
mov dword [esi + 0x7c], ebx
mov dword [ebp - 0x48], ecx
cmp dword [edi + 0xc], edx
jbe 0x595fe6
nop dword [eax + eax]
mov eax, dword [esi + 0x6c]
mov ecx, dword [esi + 0x40]
mov al, byte [edx + eax]
mov byte [edx + ecx + 0x28], al
inc edx
mov eax, dword [esi + 0x40]
cmp edx, dword [eax + 0xc]
jb 0x595fd0
mov ecx, dword [esi + 0x40]
lea eax, [ebp - 0x68]
mov edi, dword [ebp - 0x48]
push eax
mov eax, dword [ebp - 0x4c]
push eax
push edi
push eax
push dword [ecx + 0xc]
lea eax, [ecx + 0x28]
push eax
lea eax, [ecx + 0x90]
push eax
call fcn.005a8c10
add esp, 0x1c
test eax, eax
jne 0x595e9a
cmp edi, dword [ebp - 0x68]
jne 0x595e95
mov ecx, dword [esi + 0x14]
cmp ecx, 2
jge 0x596041
mov ecx, dword [esi + 0x40]
push dword [ecx + 0xc]
lea eax, [ecx + 0xb8]
push eax
lea eax, [ecx + 0x28]
push eax
call fcn.005c9900
mov ecx, dword [esi + 0x14]
add esp, 0xc
mov ebx, dword [esi + 0x7c]
mov eax, dword [esi + 0x70]
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x4c], ebx
movzx edx, byte [eax + ebx - 1]
mov eax, dword [esi + 0x40]
inc edx
mov dword [ebp - 0x5c], edx
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x58], eax
add eax, edx
cmp ebx, eax
jae 0x596074
cmp dword [ebp - 0x50], 0
jne 0x596074
xor edx, edx
xor edi, edi
mov dword [ebp - 0x5c], edx
jmp 0x596079
mov edi, 1
test ecx, ecx
jle 0x595e95
mov ecx, dword [ebp - 0x4c]
xor eax, eax
mov dword [ebp - 0x48], eax
sub ecx, edx
dec ecx
mov dword [ebp - 0x60], 0
mov esi, dword [ebp - 0x60]
lea ebx, [eax + 1]
lea eax, [edx + 1]
cmp dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x58]
cmovae esi, edi
mov dword [ebp - 0x58], 0
add eax, 0x4000
mov edi, ebx
cmp ecx, eax
sbb eax, eax
neg eax
and esi, eax
mov eax, esi
mov dword [ebp - 0x60], esi
mov esi, dword [ebp - 0x5c]
imul eax, ecx
mov ecx, dword [ebp - 0x64]
inc ecx
add eax, ecx
mov dword [ebp - 0x4c], eax
nop
movzx eax, byte [eax + edi - 1]
xor edx, edx
cmp edi, esi
cmovbe edx, ebx
xor ecx, ecx
lea ebx, [esi - 1]
cmp eax, ebx
lea eax, [edi + 1]
sete cl
and ecx, edx
add dword [ebp - 0x48], ecx
cmp esi, eax
mov eax, dword [ebp - 0x4c]
sbb ebx, ebx
xor ecx, ecx
inc ebx
and ebx, edx
lea edx, [esi - 1]
movzx eax, byte [eax + edi]
cmp eax, edx
mov edx, dword [ebp - 0x58]
mov eax, dword [ebp - 0x4c]
cmove ecx, ebx
add edi, 2
add edx, ecx
mov dword [ebp - 0x58], edx
cmp edi, 0x100
jbe 0x5960d0
mov eax, dword [ebp - 0x48]
mov ebx, dword [ebp - 0x5c]
add eax, edx
mov esi, dword [ebp - 0x54]
xor edx, edx
cmp eax, ebx
cmove edx, dword [ebp - 0x60]
imul eax, edx, 0x1ff
mov dword [ebp - 0x4c], edx
and ebx, eax
mov eax, dword [ebp - 0x50]
sub dword [esi + 0x7c], ebx
jmp 0x59623c
mov eax, dword [edi + 0xc]
mov edx, ebx
sub eax, dword [edi + 0x10]
mov dword [ebp - 0x54], eax
mov eax, dword [edi]
mov edi, dword [ebp - 0x54]
test byte [eax + 0x24], 2
sete dl
lea edx, [edx*8 + 8]
lea eax, [edx + edi]
mov dword [ebp - 0x64], edx
cmp ecx, eax
jb 0x596215
sub ecx, edx
sub ecx, edi
mov edi, dword [esi + 0x70]
mov dword [esi + 0x7c], ecx
mov dword [ebp - 0x48], ecx
mov ecx, dword [esi + 0x60]
mov eax, dword [ecx]
mov dword [ebp - 0x14], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0x10], eax
mov al, byte [esi + 0x78]
mov byte [ebp - 0xc], al
lea eax, [ebp - 0xb]
push eax
mov eax, dword [esi]
mov eax, dword [eax + 0xcc]
shr eax, 1
and eax, 1
push eax
push dword [esi + 0x14]
push dword [esi + 0x10]
call fcn.00594d70
mov edx, dword [esi + 0x40]
mov ecx, dword [ebp - 0x48]
mov eax, ecx
shr eax, 8
mov byte [ebp - 9], al
mov byte [ebp - 8], cl
mov eax, dword [edx + 0xc]
sub eax, dword [edx + 0x10]
push eax
push dword [esi + 0x6c]
lea eax, [edx + 0x28]
add eax, dword [edx + 0x10]
push eax
call fcn.005c9900
push dword [ebp - 0x64]
mov edx, dword [ebp - 0x48]
mov ecx, dword [esi + 0x40]
lea eax, [edi + edx]
push eax
lea eax, [ebp - 0x54]
push eax
push edi
push edx
push edi
push 0xd
lea eax, [ebp - 0x14]
push eax
push dword [ecx + 0xc]
lea eax, [ecx + 0x28]
push eax
lea eax, [ecx + 0x90]
push eax
call fcn.005a8e50
add esp, 0x48
test eax, eax
je 0x59622b
cmp eax, 0xffff9d00
jne 0x595e9a
pop edi
pop esi
mov eax, 0xffff8e80
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0058bb64
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp - 0x48]
mov eax, 1
cmp dword [ebp - 0x54], edi
jne 0x595e95
test eax, eax
jne 0x59634d
mov eax, dword [esi + 0x40]
mov eax, dword [eax + 0x14]
sub dword [esi + 0x7c], eax
mov eax, dword [esi + 0x68]
mov ecx, dword [esi + 0x7c]
shr ecx, 8
mov byte [eax], cl
mov ecx, dword [esi + 0x68]
mov al, byte [esi + 0x7c]
mov byte [ecx + 1], al
mov eax, dword [esi + 0x40]
mov edi, dword [esi + 0x7c]
push dword [eax + 0x14]
mov eax, dword [esi + 0x70]
add eax, edi
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.005c9900
add esp, 0xc
cmp dword [esi + 0x14], 0
jle 0x595e95
mov eax, dword [esi + 0x40]
push 8
push dword [esi + 0x60]
add eax, 0x44
push eax
call fcn.0059b4c0
mov eax, dword [esi + 0x40]
push 3
push dword [esi + 0x64]
add eax, 0x44
push eax
call fcn.0059b4c0
mov eax, dword [esi + 0x40]
push 2
push dword [esi + 0x68]
add eax, 0x44
push eax
call fcn.0059b4c0
push dword [esi + 0x7c]
mov eax, dword [esi + 0x40]
push dword [esi + 0x70]
add eax, 0x44
push eax
call fcn.0059b4c0
mov eax, dword [esi + 0x70]
add eax, dword [esi + 0x7c]
push eax
mov eax, dword [esi + 0x40]
add eax, 0x44
push eax
call fcn.0059b500
lea ecx, [ebx + 0x15]
add esp, 0x38
mov ebx, dword [ebp - 0x4c]
lea eax, [edi + 0x15]
add ecx, edi
shr eax, 6
imul edi, ebx, 0xff
shr ecx, 6
sub ecx, eax
and edi, ecx
add edi, 1
je 0x596318
mov eax, dword [esi + 0x40]
push dword [esi + 0x70]
add eax, 0x44
push eax
call fcn.0059b710
add esp, 8
sub edi, 1
jne 0x596301
mov eax, dword [esi + 0x40]
add eax, 0x44
push eax
call fcn.0059b5a0
mov eax, dword [esi + 0x40]
push dword [eax + 0x14]
mov eax, dword [esi + 0x70]
add eax, dword [esi + 0x7c]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00595b70
xor ecx, ecx
add esp, 0x10
test eax, eax
cmove ecx, ebx
test ecx, ecx
jne 0x596356
jmp 0x596215
cmp eax, 1
jne 0x595e95
cmp dword [esi + 0x7c], 0
jne 0x596373
mov eax, dword [esi + 0xa4]
inc eax
mov dword [esi + 0xa4], eax
cmp eax, 3
jle 0x59637d
jmp 0x596215
mov dword [esi + 0xa4], 0
mov eax, dword [esi]
test byte [eax + 0xcc], 2
jne 0x5963d1
mov ecx, 8
nop dword [eax]
mov edx, dword [esi]
mov eax, dword [edx + 0xcc]
and eax, 2
cmp ecx, eax
jbe 0x5963ae
mov eax, dword [esi + 0x60]
add byte [eax + ecx - 1], 1
jne 0x5963ac
dec ecx
jmp 0x596390
mov edx, dword [esi]
mov eax, dword [edx + 0xcc]
and eax, 2
cmp ecx, eax
jne 0x5963d1
pop edi
pop esi
mov eax, 0xffff9480
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0058bb64
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0058bb64
mov esp, ebp
pop ebp
ret