Displaying 12 results from an estimated 12 matches for "put_val_typ".
Did you mean:
put_val_type
2011 Dec 08
0
[hivex] [PATCH 2/8] generator: Add new return type to ABI: RLenValue
...type (size_t len, hive_type t)
}
static PyObject *
+put_len_val (size_t len, hive_value_h value)
+{
+ PyObject *r = PyTuple_New (2);
+ PyTuple_SetItem (r, 0, PyLong_FromLongLong ((long) len));
+ PyTuple_SetItem (r, 1, PyLong_FromLongLong ((long) value));
+ return r;
+}
+
+static PyObject *
put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
@@ -2929,6 +2987,11 @@ put_val_type (char *val, size_t len, hive_type t)
pr " size_t len;\n";
pr " hive_type t;\n";
"-1"
+ | RLenValue ->
+...
2011 Oct 19
1
[hivex][PATCH 2/8] generator: Add new return type to ABI: RLenValue
...type (size_t len, hive_type t)
}
static PyObject *
+put_len_val (size_t len, hive_value_h value)
+{
+ PyObject *r = PyTuple_New (2);
+ PyTuple_SetItem (r, 0, PyLong_FromLongLong ((long) len));
+ PyTuple_SetItem (r, 1, PyLong_FromLongLong ((long) value));
+ return r;
+}
+
+static PyObject *
put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
@@ -2916,6 +2974,11 @@ put_val_type (char *val, size_t len, hive_type t)
pr " size_t len;\n";
pr " hive_type t;\n";
"-1"
+ | RLenValue ->
+...
2014 Aug 08
2
[PATCH 1/2] Add type checking, support integers as value
...++i) {
- if (get_value (PyList_GetItem (v, i), &(ret->values[i])) == -1) {
+ if (get_value (PyList_GetItem (v, i), &(ret->values[i]), &(ret->words[i])) == -1) {
free (ret->values);
+ free (ret->words);
return -1;
}
}
@@ -3070,9 +3124,10 @@ put_val_type (char *val, size_t len, hive_type t)
| ASetValues ->
pr " py_set_values values;\n";
pr " PyObject *py_values;\n"
- | ASetValue ->
- pr " hive_set_value val;\n";
- pr " PyObject *py_val;\n"
+ | ASetValue ->
+...
2014 Aug 04
6
[hivex] Segfault for an integer value to node_set_value
Hi,
When an integer argument is passed as value, node_set_value
segfaults. Reproducer is at the end of this message
The backtrace points at hivex-py.c, function get_value. While obj
is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL.
Kind regards,
Peter
https://lekensteyn.nl
#!/usr/bin/env python3
import hivex, sys
h = hivex.Hivex(sys.argv[1])
print(h)
val = {
2011 Apr 27
2
[PATCH] hivex/python fix for i386 integer size issue
...at
string. After regenerating hivex-py.c, I have successfully tested the
1.2.5 code base on both architectures.
Cheers,
-Hilko
diff --git a/generator/generator.ml b/generator/generator.ml
index 7e706d1..9722312 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -2875,7 +2875,7 @@ put_val_type (char *val, size_t len, hive_type t)
pr "O"
| ANode n
| AValue n ->
- pr "L"
+ pr "l"
| AString n ->
pr "s"
| AStringNullable n ->
2014 Jan 15
0
[PATCH 3/4] hivex: python: Produce Unicode strings in get_* methods
...def HAVE_PYSTRING_ASSTRING
- PyList_SetItem (list, i, PyString_FromString (argv[i]));
-#else
- PyList_SetItem (list, i, PyUnicode_FromString (argv[i]));
-#endif
+ PyList_SetItem (list, i, PyUnicode_DecodeUTF8 (argv[i], strlen (argv[i]), NULL));
}
return list;
@@ -2985,11 +2981,7 @@ put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
PyTuple_SetItem (r, 0, PyLong_FromLong ((long) t));
-#ifdef HAVE_PYSTRING_ASSTRING
- PyTuple_SetItem (r, 1, PyString_FromStringAndSize (val, len));
-#else
- PyTuple_SetItem (r, 1, PyBytes_FromStringAndSize (val, len));...
2011 Aug 31
1
[PATCH] hivex: Add byte runs for nodes and values
...EINIT:\n";
pr " char *r;\n";
@@ -2841,6 +2964,14 @@ put_len_type (size_t len, hive_type t)
}
static PyObject *
+put_len (size_t len)
+{
+ PyObject *r = PyTuple_New (1);
+ PyTuple_SetItem (r, 0, PyLong_FromLongLong ((long) len));
+ return r;
+}
+
+static PyObject *
put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
@@ -2864,6 +2995,7 @@ put_val_type (char *val, size_t len, hive_type t)
| RErr -> pr " int r;\n"; "-1"
| RErrDispose -> pr " int r;\n"; "-1"
| RHive -> pr "...
2014 Feb 03
1
[PATCH] hivex: python: value_value no longer generates Unicode strings
...ator.ml | 2 +-
python/t/210-setvalue.py | 26 +++++++++++++++++---------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/generator/generator.ml b/generator/generator.ml
index 908c5f3..02aaf12 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -2981,7 +2981,7 @@ put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
PyTuple_SetItem (r, 0, PyLong_FromLong ((long) t));
- PyTuple_SetItem (r, 1, PyUnicode_DecodeUTF8 (val, len, NULL));
+ PyTuple_SetItem (r, 1, PyBytes_FromStringAndSize (val, len));
return r;
}
diff --git a/python/...
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi,
This patch series is based on a prior patch[1], splitting off changes as
requested and incorporating feedback from Richard Jones. It introduces type
validation to avoid segmentation faults (instead, it reports an exception) and
fixes handling of the bytes type in Python 3.
Major changes since that series:
- Drop newly introduced support for integer types for DWORD/QWORDS
- Reject Unicode
2014 Jan 15
4
[PATCH 1/4] hivex: Python 2.6 does not have sysconfig.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6785037..203f34f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -329,8 +329,8 @@ AS_IF([test "x$enable_python" != "xno"],
AC_MSG_CHECKING([for Python extension suffix (PEP-3149)])
if test -z "$PYTHON_EXT_SUFFIX"; then
2011 Aug 11
2
[Hivex] [PATCH] Correct 32-bit to 64-bit call
---
generator/generator.ml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/generator/generator.ml b/generator/generator.ml
index 31478cd..de911f1 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -1771,7 +1771,7 @@ static void raise_closed (const char *) Noreturn;
pr " rv = copy_type_value (r, len, t);\n";
pr "
2014 Jan 08
5
hivex: Make node names and value names with embedded null characters accessible
On Windows, there exist at least two APIs for dealing with the
Registry: The Win32 API (RegCreateKeyA, RegCreateKeyW, etc.) works
with null-terminated ASCII or UTF-16 strings. The native API
(ZwCreateKey, etc.), on the other hand works with UTF-16 strings that
are stored as buffers+length and may contain null characters. Malware
authors have been relying on the Win32 API's inability to