mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-27 19:44:18 +01:00
bugfix: IDAPython: get_blob() was returning a buffer with at most MAXSPECSIZE bytes
This commit is contained in:
parent
a52b90c771
commit
c94f5c10bb
@ -82,7 +82,7 @@
|
||||
%ignore netnode::setbase;
|
||||
|
||||
%ignore netnode::altadjust;
|
||||
|
||||
%ignore netnode::getblob(void *buf, size_t *bufsize, nodeidx_t start, char tag);
|
||||
%ignore netnode::operator nodeidx_t;
|
||||
|
||||
// Renaming one version of hashset() otherwise SWIG will not be able to activate the other one
|
||||
@ -96,4 +96,19 @@
|
||||
{
|
||||
return self->operator nodeidx_t();
|
||||
}
|
||||
|
||||
PyObject *getblob(nodeidx_t start, const char *tag)
|
||||
{
|
||||
// Get the blob and let IDA allocate the memory
|
||||
size_t bufsize;
|
||||
void *buf = self->getblob(NULL, &bufsize, start, *tag);
|
||||
if ( buf == NULL )
|
||||
Py_RETURN_NONE;
|
||||
// Create a Python string
|
||||
PyObject *py_str = PyString_FromStringAndSize((const char *)buf, bufsize);
|
||||
// Free memory
|
||||
qfree(buf);
|
||||
|
||||
return py_str;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user