Mailing List Archive

array limits
Hi,

just a small question, but how big could you make an array. Will the
performance drop significantly if you have a big array?
maybe something like "data[0] - data[3000]". I want to know because I
grab some large content from a file with a lot of lines and split the
lines up in an array.
My file is not that big, but others could be. I did this because I want
to use it in a report, but only for about the first 20 lines, or are
there other ways to do this.

Thanks,

Ferdy
_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers
Re: array limits [ In reply to ]
Hi Ferdy,

I don't have an exact value at hand, but NASL scripts are memory-
contrained and can not allocate more than 80 megs of ram (total) or
40 megs in a row.

It might be big enough for your needs, but then again you probably
want to do something else than an array.


-- Renaud

On May 19, 2007, at 7:56 PM, Ferdy Riphagen wrote:

> Hi,
>
> just a small question, but how big could you make an array. Will
> the performance drop significantly if you have a big array?
> maybe something like "data[0] - data[3000]". I want to know because
> I grab some large content from a file with a lot of lines and split
> the lines up in an array.
> My file is not that big, but others could be. I did this because I
> want to use it in a report, but only for about the first 20 lines,
> or are there other ways to do this.
>
> Thanks,
>
> Ferdy
> _______________________________________________
> Plugins-writers mailing list
> Plugins-writers@list.nessus.org
> http://mail.nessus.org/mailman/listinfo/plugins-writers
>

_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers
Re: array limits [ In reply to ]
Renaud Deraison wrote:
>
>
> Hi Ferdy,
>
> I don't have an exact value at hand, but NASL scripts are
> memory-contrained and can not allocate more than 80 megs of ram
> (total) or 40 megs in a row.
>
> It might be big enough for your needs, but then again you probably
> want to do something else than an array.
>
Hi Renaud, thanks but I don't now how to do it other than with the split
function.
The script is grabbing a file from a FTP server, and than I split to
report the first 20 lines (as a prove)
Here is a part of the config, it's grabbing the config-file from an
Cisco IOS router via it's vulnerable FTP server, although
ftp_anonymous.nasl could detect it too.
Maybe an array of 3000 was a bit overwhelmed, it could be less lines.

if (strlen(recv_config)) {
# Only report a few lines, configs could be very big.
# Change n <= 20 in a larger number if you would like to see more.
lines = (split(recv_config));
config = "";
for(n = 0; n <= 20; n++) config += lines[n];

report = string(
desc, "\r\n\r\n",
"Plugin output :\r\n\r\n",
"Partial startup-config file:\r\n",
config);




_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers
Re: array limits [ In reply to ]
Ferdy Riphagen wrote:
> Renaud Deraison wrote:
>>
>>
>> Hi Ferdy,
>>
>> I don't have an exact value at hand, but NASL scripts are
>> memory-contrained and can not allocate more than 80 megs of ram
>> (total) or 40 megs in a row.
>>
>> It might be big enough for your needs, but then again you probably
>> want to do something else than an array.
>>
> Hi Renaud, thanks but I don't now how to do it other than with the
> split function.
> The script is grabbing a file from a FTP server, and than I split to
> report the first 20 lines (as a prove)
> Here is a part of the config, it's grabbing the config-file from an
> Cisco IOS router via it's vulnerable FTP server, although
> ftp_anonymous.nasl could detect it too.
found it ftp_recv_data(socket:soc2, line:500); not totally correct, but
retrieving the config in total is not needed anymore, and it speed up
things.

--Ferdy--

_______________________________________________
Plugins-writers mailing list
Plugins-writers@list.nessus.org
http://mail.nessus.org/mailman/listinfo/plugins-writers