mirror of
https://github.com/cemu-project/idapython.git
synced 2025-02-17 18:36:23 +01:00
python.cpp: Added error handling to return_python_result()
python.cpp: Added plugin arguments to enable/disable exlang_python python.cpp: Patch by Igor Skochinsky
This commit is contained in:
parent
b97846eeae
commit
48301d9703
12
python.cpp
12
python.cpp
@ -290,6 +290,9 @@ static bool return_python_result(idc_value_t *rv,
|
|||||||
char *errbuf,
|
char *errbuf,
|
||||||
size_t errbufsize)
|
size_t errbufsize)
|
||||||
{
|
{
|
||||||
|
if (errbufsize > 0)
|
||||||
|
errbuf[0] = '\0';
|
||||||
|
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
handle_python_error(errbuf, errbufsize);
|
handle_python_error(errbuf, errbufsize);
|
||||||
@ -326,6 +329,7 @@ static bool return_python_result(idc_value_t *rv,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qsnprintf(errbuf, errbufsize, "ERROR: bad return value");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -706,6 +710,14 @@ void idaapi run(int arg)
|
|||||||
IDAPython_ScriptBox();
|
IDAPython_ScriptBox();
|
||||||
break;
|
break;
|
||||||
;;
|
;;
|
||||||
|
case 3:
|
||||||
|
enable_extlang_python(true);
|
||||||
|
break;
|
||||||
|
;;
|
||||||
|
case 4:
|
||||||
|
enable_extlang_python(false);
|
||||||
|
break;
|
||||||
|
;;
|
||||||
default:
|
default:
|
||||||
warning("IDAPython: unknown plugin argument %d", arg);
|
warning("IDAPython: unknown plugin argument %d", arg);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user