1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

moving debugger to nmap-exp/diman until further notice

This commit is contained in:
diman
2008-02-03 21:38:38 +00:00
parent 2d9bc1b43d
commit cf4c7081e8
7 changed files with 2 additions and 1376 deletions

View File

@@ -274,7 +274,6 @@ void NmapOps::Initialize() {
script = 0;
scriptversion = 0;
scripttrace = 0;
scriptdebug = 0;
scriptupdatedb = 0;
#endif
}

View File

@@ -328,7 +328,6 @@ class NmapOps {
char *scriptargs;
int scriptversion;
int scripttrace;
int scriptdebug;
int scriptupdatedb;
void chooseScripts(char* argument);
std::vector<std::string> chosenScripts;

View File

@@ -627,8 +627,6 @@ int nmap_main(int argc, char *argv[]) {
{"script", required_argument, 0, 0},
{"script-trace", no_argument, 0, 0},
{"script_trace", no_argument, 0, 0},
{"script-debug", no_argument, 0, 0},
{"script_debug", no_argument, 0, 0},
{"script-updatedb", no_argument, 0, 0},
{"script_updatedb", no_argument, 0, 0},
{"script-args",required_argument,0,0},
@@ -668,11 +666,8 @@ int nmap_main(int argc, char *argv[]) {
o.scriptargs=strdup(optarg);
if(script_check_args()!=0)
fatal("Error parsing --script-args\n");
} else if (optcmp(long_options[option_index].name, "script-trace") == 0) {
}else if (optcmp(long_options[option_index].name, "script-trace") == 0) {
o.scripttrace = 1;
} else if (optcmp(long_options[option_index].name, "script-debug") == 0) {
o.scriptdebug = 1;
o.noninteractive = true;
} else if (optcmp(long_options[option_index].name, "script-updatedb") == 0){
o.scriptupdatedb = 1;
} else

View File

@@ -207,9 +207,6 @@ void tty_init()
{
struct termios ti;
if(o.noninteractive)
return;
if (tty_fd)
return;

View File

@@ -30,7 +30,6 @@ int init_fetchfile(char *result, size_t result_max_len, char* file);
int init_fetchfile_absolute(char *path, size_t path_len, char *file);
int init_updatedb(lua_State* l);
int init_pick_default_categories(std::vector<std::string>& chosenScripts);
int init_debugger(lua_State* l);
int check_extension(const char* ext, const char* path);
@@ -59,34 +58,15 @@ int init_lua(lua_State* l) {
SCRIPT_ENGINE_LUA_TRY(lua_pcall(l, 1, 0, 0));
}
/* publish the nmap bindings to the script */
lua_newtable(l);
SCRIPT_ENGINE_TRY(set_nmaplib(l));
lua_setglobal(l, "nmap");
SCRIPT_ENGINE_TRY(init_setlualibpath(l));
SCRIPT_ENGINE_TRY(init_debugger(l));
return SCRIPT_ENGINE_SUCCESS;
}
int init_debugger(lua_State* l) {
if(o.scriptdebug > 0) {
luaL_loadstring(l, "require 'debugger'");
SCRIPT_ENGINE_TRY(lua_pcall(l, 0, 0, 0));
} else {
char* debugger_dummy = "\
package.loaded['debugger'] = true\n\
pause = function() end\n";
luaL_loadstring(l, debugger_dummy);
SCRIPT_ENGINE_TRY(lua_pcall(l, 0, 0, 0));
}
return SCRIPT_ENGINE_SUCCESS;
}
/*sets two variables, which control where lua looks for modules (implemented in C or lua */
int init_setlualibpath(lua_State* l){
char path[MAX_FILENAME_LEN];

File diff suppressed because it is too large Load Diff

View File

@@ -28,8 +28,6 @@ end
action = function(host, port)
local data, result, title, protocol
pause("test")
data = http.get( host, port, '/' )
result = data.body