Backported fixes

This commit is contained in:
Arnaud Diederen
2022-02-14 09:17:16 +01:00
parent 95b5c4066c
commit 01d069ae68
8 changed files with 33 additions and 22 deletions
+3
View File
@@ -1491,6 +1491,9 @@ bool idapython_plugin_t::_extlang_eval_snippet(
qstring *errbuf)
{
PYW_GIL_GET;
#ifdef TESTABLE_BUILD
QASSERT(0, PyErr_Occurred() == nullptr);
#endif
PyObject *globals = _get_module_globals();
bool ok;
if ( globals == nullptr )
Binary file not shown.
+1 -1
View File
@@ -55904,7 +55904,7 @@ execute_ui_requests(*args)
@param callable_list: A list of python callable objects.
@note: A callable should return True if it wants to be called more than once.
@return: Boolean. False if the list contains a non callabale item
@return: Boolean. False if the list contains a non callable item
Help on function find_widget in module ida_kernwin:
+1 -1
View File
@@ -56553,7 +56553,7 @@ execute_ui_requests(*args) -> 'bool'
@param callable_list: A list of python callable objects.
@note: A callable should return True if it wants to be called more than once.
@return: Boolean. False if the list contains a non callabale item
@return: Boolean. False if the list contains a non callable item
Help on function find_widget in module ida_kernwin:
+10 -15
View File
@@ -582,9 +582,14 @@ def GetInstructionList():
return [i[0] for i in ida_idp.ph_get_instruc() if i[0]]
# -----------------------------------------------------------------------
def _Assemble(ea, line):
def Assemble(ea, line):
"""
Please refer to Assemble() - INTERNAL USE ONLY
Assembles one or more lines (does not display an message dialogs)
If line is a list then this function will attempt to assemble all the lines
This function will turn on batch mode temporarily so that no messages are displayed on the screen
@param ea: start address
@return: (False, "Error message") or (True, asm_buf) or (True, [asm_buf1, asm_buf2, asm_buf3])
"""
if type(line) in ([bytes] + list(ida_idaapi.string_types)):
lines = [line]
@@ -606,21 +611,11 @@ def _Assemble(ea, line):
ret = ret[0]
return (True, ret)
# -----------------------------------------------------------------------
_Assemble = Assemble
def Assemble(ea, line):
"""
Assembles one or more lines (does not display an message dialogs)
If line is a list then this function will attempt to assemble all the lines
This function will turn on batch mode temporarily so that no messages are displayed on the screen
@param ea: start address
@return: (False, "Error message") or (True, asm_buf) or (True, [asm_buf1, asm_buf2, asm_buf3])
"""
old_batch = idc.batch(1)
ret = _Assemble(ea, line)
idc.batch(old_batch)
return ret
# -----------------------------------------------------------------------
def _copy_obj(src, dest, skip_list = None):
"""
Copy non private/non callable attributes from a class instance to another
+12 -1
View File
@@ -667,7 +667,7 @@ def execute_ui_requests(callable_list):
@param callable_list: A list of python callable objects.
@note: A callable should return True if it wants to be called more than once.
@return: Boolean. False if the list contains a non callabale item
@return: Boolean. False if the list contains a non callable item
"""
pass
#</pydoc>
@@ -708,6 +708,17 @@ static bool py_execute_ui_requests(PyObject *py_list)
ref_t py_callable = py_callables.at(py_callable_idx);
bool reschedule;
newref_t py_result(PyObject_CallFunctionObjArgs(py_callable.o, nullptr));
// execute_ui_requests() will cause this run() code to be executed
// asynchronously. This means that, should an exception have been raised
// in the Python code we just executed, it won't have the possibility of
// trickling all the way up to the Python runtime.
// Since it would interfere with subsequent Python code execution, we
// want to report it right away.
if ( PyErr_Occurred() )
{
PyErr_Print();
return false;
}
reschedule = py_result != nullptr && PyObject_IsTrue(py_result.o);
// No rescheduling? Then advance to the next callable
+3 -2
View File
@@ -6532,8 +6532,9 @@ Help on function set_reg_val in module ida_dbg:
set_reg_val(*args)
set_reg_val(regname, o) -> PyObject
Write a register value to the current thread.
@param regname: char const *
@param regname: (C++: const char *) char const *
@param o: PyObject *
set_reg_val(tid, regidx, o) -> bool, int
@@ -55839,7 +55840,7 @@ execute_ui_requests(*args)
@param callable_list: A list of python callable objects.
@note: A callable should return True if it wants to be called more than once.
@return: Boolean. False if the list contains a non callabale item
@return: Boolean. False if the list contains a non callable item
Help on function find_widget in module ida_kernwin:
+3 -2
View File
@@ -6514,8 +6514,9 @@ Help on function set_reg_val in module ida_dbg:
set_reg_val(*args) -> 'PyObject *'
set_reg_val(regname, o) -> PyObject
Write a register value to the current thread.
@param regname: char const *
@param regname: (C++: const char *) char const *
@param o: PyObject *
set_reg_val(tid, regidx, o) -> bool, int
@@ -56488,7 +56489,7 @@ execute_ui_requests(*args) -> 'bool'
@param callable_list: A list of python callable objects.
@note: A callable should return True if it wants to be called more than once.
@return: Boolean. False if the list contains a non callabale item
@return: Boolean. False if the list contains a non callable item
Help on function find_widget in module ida_kernwin: