diff --git a/docs/scripting.xml b/docs/scripting.xml index e56cff859..540c0adf1 100644 --- a/docs/scripting.xml +++ b/docs/scripting.xml @@ -1573,12 +1573,13 @@ if(s) code_to_be_done_on_match end - + print_debug Wrapper function around print_debug_unformatted() - in the nmap namespace. The first argument, if numeric, is + in the nmap namespace. The first optional numeric + argument, verbosity, is used as the necessary debug level to print the message (it defaults to 1 if omitted). All remaining arguments are processed with Lua's string.format() function, which provides a @@ -1587,19 +1588,19 @@ if(s) code_to_be_done_on_match end - + strsplit This function will certainly be appreciated by Perl programmers. It takes two strings as arguments and splits the second one around - all occurrences of the first one, returning a table, which contains - the substrings without the delimiting string. + all occurrences of the first one, returning a list (table), which + contains the substrings without the delimiting string. - + strjoin @@ -1609,6 +1610,54 @@ if(s) code_to_be_done_on_match end + + + tobinary + + + Converts the given number, n, to a string + in a binary number format (e.g. 5 becomes "101"). + + + + + + tooctal + + + Converts the given number, n, to a string + in an octal number format (e.g. 9 becomes "11"). + + + + + + tohex + + + Converts the given number, n, to a string + in a hexidecimal number format (e.g. 10 becomes "a"). + + + + + + make_buffer + + + This function operates on a socket attempting to read data. + It separates the data by sep and, for each + invocation, returns a piece of the separated data. Typically + this is used to iterate over the lines of data received from a + socket (sep = "\r?\n"). The returned string + does not include the separator. It will return the final data + even if it is not followed by the separator. Once an error or + EOF is reached, it returns nil, msg. + msg is what is returned by + nmap.receive_lines(). + + + @@ -2319,7 +2368,9 @@ nmap.get_port_state({ip="127.0.0.1"}, {number="80", protocol="tcp"}) n lines before the operation times out a TIMEOUT error occurs. On the other hand, if more than n lines were received, all are - returned, not just n. On success + returned, not just n. Use + stdnse.make_buffer to guarantee one line + is returned per call. On success the returned value of status is true and the received data is stored in value. If the connection