Nmap Development mailing list archives
Re: XML structured script output (storing results per script instance)
From: Patrick Donnelly <batrick () batbytes com>
Date: Tue, 31 Jul 2012 22:14:48 -0400
On Jul 31, 2012 9:08 PM, "David Fifield" <david () bamsoftware com> wrote:
Daniel's structured output branch stores the output of a script as a Lua object in the Lua registry, in a table keyed by "NSE_SCRIPT_RESULT"] and subkeyed by the pointer to the script instance.
Why would you store it in the lua registry?
Here's an excerpt from ScriptResult::set_output: key = lua_topointer(L, pos+1); lua_getfield(lstate, LUA_REGISTRYINDEX, NSE_SCRIPT_RESULT); /* -3 */ lua_pushfstring(lstate, "%p", key); /* -2 */ lua_pushvalue(lstate, pos); /* -1 */ lua_settable(lstate, -3); /* _R[NSE_SCRIPT_RESULT][key] = return_value
*/
Lua experts: is this the usual way to accomplish this? Is it safe to rely on addresses in this way?
No and maybe. _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) David Fifield (Jul 19)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) David Fifield (Jul 19)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) Patrick Donnelly (Jul 20)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) David Fifield (Jul 20)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) Patrick Donnelly (Jul 20)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) David Fifield (Jul 20)
- Re: [RFC][patch] XML structured script output (Nmap-script-XML as of 15 July) David Fifield (Jul 20)
- Re: XML structured script output (storing results per script instance) David Fifield (Jul 31)
- Re: XML structured script output (storing results per script instance) Patrick Donnelly (Jul 31)
- Re: XML structured script output (storing results per script instance) David Fifield (Jul 31)
- Re: XML structured script output (storing results per script instance) Patrick Donnelly (Aug 01)
- Re: XML structured script output (storing results per script instance) Daniel Miller (Aug 01)
- Re: XML structured script output (storing results per script instance) Patrick Donnelly (Aug 01)
- Re: XML structured script output (storing results per script instance) Daniel Miller (Aug 02)
- Re: XML structured script output (storing results per script instance) Patrick Donnelly (Aug 03)
- Re: XML structured script output (storing results per script instance) Patrick Donnelly (Jul 31)