Function at 0x59f580
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 0x10]
cmp esi, dword [ebp + 0xc]
jne 0x59f59c
mov eax, dword [ebp + 8]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
test esi, esi
js 0x59f8d5
test ebx, ebx
js 0x59f8d5
je 0x59f5c0
xor edx, edx
mov eax, Ordinal_1
div ebx
cmp esi, eax
jg 0x59f8d5
mov ecx, esi
imul ecx, ebx
mov dword [ebp + 0x10], ecx
test ecx, ecx
js 0x59f8d5
mov edi, dword [ebp + 0x18]
test edi, edi
js 0x59f8d5
je 0x59f5ee
xor edx, edx
mov eax, Ordinal_1
div edi
cmp ecx, eax
jg 0x59f8d5
mov eax, ecx
imul eax, edi
push eax
call fcn.005b7d4f
mov ecx, eax
add esp, 4
mov dword [ebp - 0x10], ecx
test ecx, ecx
je 0x59f8d5
test edi, edi
mov edi, dword [ebp + 8]
jle 0x59f8c2
mov eax, dword [ebp + 0xc]
lea edx, [esi - 0xa]
mov esi, edi
mov dword [ebp - 8], edi
lea edx, [edx + eax*8]
imul eax, ebx
mov dword [ebp - 4], edx
mov dword [ebp + 0xc], eax
mov eax, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0xc], eax
cmp edx, 0x19
ja case.default.0x59f643
movzx ecx, byte [edx + 0x59f938]
jmp dword [ecx*4 + 0x59f904]
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 1]
mov byte [eax + 1], 0xff
lea eax, [eax + 2]
jns 0x59f655
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x59f678
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
nop
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 1]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
mov byte [eax - 1], 0xff
jns 0x59f6a0
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
nop word [eax + eax]
sub edx, 1
mov cl, byte [esi]
mov byte [eax], cl
lea esi, [esi + 2]
lea eax, [eax + 1]
jns 0x59f6d0
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
nop
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 3]
mov byte [eax - 3], cl
jns 0x59f6f0
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
sub edx, 1
mov cl, byte [esi]
mov byte [eax + 2], cl
lea esi, [esi + 2]
mov byte [eax + 1], cl
lea eax, [eax + 4]
mov byte [eax - 4], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x59f716
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 3]
movzx ecx, byte [esi - 2]
lea eax, [eax + 4]
mov byte [eax - 3], cl
movzx ecx, byte [esi - 1]
mov byte [eax - 2], cl
mov byte [eax - 1], 0xff
jns 0x59f743
jmp 0x59f89e
lea edi, [ebx - 1]
test edi, edi
js case.0x59f643.3
nop word [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x59f780
jmp 0x59f89e
lea edi, [ebx - 1]
test edi, edi
js case.0x59f643.3
nop dword [eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 3]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 1]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 3]
imul ecx, ecx, 0x4d
mov byte [eax - 1], 0xff
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
jns 0x59f7c0
jmp 0x59f89e
lea edi, [ebx - 1]
test edi, edi
js case.0x59f643.3
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 1]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 1], dl
jns 0x59f801
jmp 0x59f89e
lea edi, [ebx - 1]
test edi, edi
js case.0x59f643.3
nop word [eax + eax]
movzx ecx, byte [esi + 1]
lea esi, [esi + 4]
imul edx, ecx, 0x96
lea eax, [eax + 2]
movzx ecx, byte [esi - 2]
imul ecx, ecx, 0x1d
add edx, ecx
movzx ecx, byte [esi - 4]
imul ecx, ecx, 0x4d
add edx, ecx
shr edx, 8
sub edi, 1
mov byte [eax - 2], dl
mov cl, byte [esi - 1]
mov byte [eax - 1], cl
jns 0x59f840
jmp 0x59f89e
lea edx, [ebx - 1]
test edx, edx
js 0x59f89e
nop dword [eax]
sub edx, 1
movzx ecx, byte [esi]
mov byte [eax], cl
lea esi, [esi + 4]
movzx ecx, byte [esi - 3]
lea eax, [eax + 3]
mov byte [eax - 2], cl
movzx ecx, byte [esi - 2]
mov byte [eax - 1], cl
jns 0x59f880
mov edx, dword [ebp - 4]
mov ecx, dword [ebp + 0x10]
mov esi, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
add esi, dword [ebp + 0xc]
add eax, ecx
sub dword [ebp + 0x18], 1
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], eax
jne 0x59f633
mov edi, dword [ebp + 8]
push edi
call fcn.005b7d34
mov eax, dword [ebp - 0x10]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [ebp + 8]
call fcn.005b7d34
mov ecx, dword [0x655918]
add esp, 4
mov eax, dword fs:[0x2c]
pop edi
mov eax, dword [eax + ecx*4]
pop esi
pop ebx
mov dword [eax + 0xc], str.outofmem
xor eax, eax
mov esp, ebp
pop ebp
ret