aboutsummaryrefslogtreecommitdiffstats
path: root/text.py
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-08-11 20:34:45 +0000
committerbloodstalker <thabogre@gmail.com>2018-08-11 20:34:45 +0000
commit74a133b5c267c17d2e1f9548881fdcab8847e206 (patch)
tree5f2460a3b385ebdba5055f77f6f501198635ed18 /text.py
parentreadme update (diff)
downloadfaultreiber-74a133b5c267c17d2e1f9548881fdcab8847e206.tar.gz
faultreiber-74a133b5c267c17d2e1f9548881fdcab8847e206.zip
fixes #1
Diffstat (limited to 'text.py')
-rw-r--r--text.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/text.py b/text.py
index d70cb09..ae18de1 100644
--- a/text.py
+++ b/text.py
@@ -82,10 +82,30 @@ int32_t read_until_delimiter(int _fd, uint8_t delimiter) {
return pos;
}}
}"""
+
+ c_void_manager = """
+void void_manager(void* ptr) {
+ if (current_void_size == 0) {
+ void_train = malloc(100*sizeof(void*));
+ current_void_size = 100;
+ }
+ if (current_void_count == current_void_size) {
+ current_void_size*=2;
+ void_train = realloc(void_train, current_void_size*sizeof(void*));
+ if (void_train == NULL) {
+ printf("void train couldnt allocate more memory.\\n");
+ }
+ }
+ void_train[current_void_count] = ptr;
+ current_void_count++;
+}"""
+
c_read_leb_128_s_sig = "int64_t read_leb_128_s(int _fd, int max_size);\n"
c_read_leb_128_u_sig = "uint64_t read_leb_128_u(int _fd, int max_size);\n"
c_read_until_delimiter_sig = "int32_t read_until_delimiter(int _fd, uint8_t delimiter);\n"
c_read_until_delimiter_proto = "read_until_delimiter(_fd, XXX)"
+ c_void_manager_sig = "void void_manager(void* ptr);"
+ c_void_manager_proto = "void_manager(XXX);"
c_read_leb_macro_defs = """
#define READ_VAR_UINT_1(FD) read_leb128_u(FD, 1)