On Fri, Apr 19, 2002 at 07:38:22AM -0400, ChAndrA ChAn wrote:
> Hi !
>
> While i'm browsing and trying to understand smb_* NASL script code, i couldn't
>understand part of the code.
>
> function smb_recv(socket, length)
> {
> ____msg_header = recv(socket:socket, length:4);
> if (strlen(____msg_header) < 4)return(0);
> ____msg_trailer_length = 256 * ord(____msg_header[2]);
> ^^^^^^^^^^^^^^^^^^
> ____msg_trailer_length = ____msg_trailer_length + ord(____msg_header[3]);
> ^^^^^^^^^^^^^^^^^^^
> .........
> }
>
> I don't understand, how come the ____msg_header variable can be ____msg_header[2]
>and ____msg_header[3] ?
msg_header is a string of characters. So msg_header[2] and [3] are
its third and fourth chars.
-- Renaud