Lucciefr
Lua code caving, injection and exploration framework
mpkutils.h
Go to the documentation of this file.
1 
3 #ifndef MPKUTILS_H
4 #define MPKUTILS_H
5 
6 #include "msgpack.h"
7 
8 // pack string with a given length
9 int msgpack_pack_lstring(msgpack_packer *pk, const char *str, size_t len);
10 
12 #define msgpack_pack_string(pk, s) \
13  msgpack_pack_lstring(pk, s, s ? strlen(s) : 0)
14 
16 #define msgpack_pack_literal(pk, s) \
17  msgpack_pack_lstring(pk, "" s, sizeof(s)-1)
18 
19 // create msgpack object from string (with given length)
20 void msgpack_object_from_lstring(msgpack_object *object, const char *str, size_t len);
21 
23 #define msgpack_object_from_string(object, s) \
24  msgpack_object_from_lstring(object, s, s ? strlen(s) : 0)
25 
27 #define msgpack_object_from_literal(object, s) \
28  msgpack_object_from_lstring(object, "" s, sizeof(s)-1)
29 
30 // write msgpack_object_str to a stream
31 size_t msgpack_object_str_fwrite(msgpack_object_str str, FILE *stream);
32 
33 #endif // MPKUTILS_H
size_t msgpack_object_str_fwrite(msgpack_object_str str, FILE *stream)
Write msgpack_object_str to a stream.
Definition: mpkutils.c:40
void msgpack_object_from_lstring(msgpack_object *object, const char *str, size_t len)
Create msgpack object from string (with given length).
Definition: mpkutils.c:26
int msgpack_pack_lstring(msgpack_packer *pk, const char *str, size_t len)
Pack string with a given length.
Definition: mpkutils.c:14