Rizin
unix-like reverse engineering framework and cli tools
rz_protobuf.h File Reference
#include <rz_types.h>

Go to the source code of this file.

Functions

RZ_API char * rz_protobuf_decode (const ut8 *buffer, const ut64 size, bool debug)
 

Function Documentation

◆ rz_protobuf_decode()

RZ_API char* rz_protobuf_decode ( const ut8 buffer,
const ut64  size,
bool  debug 
)

Definition at line 146 of file protobuf.c.

146  {
147  if (!start || !size) {
148  eprintf("Invalid buffer pointer or size.\n");
149  return NULL;
150  }
151  const ut8 *end = start + size;
152  RzStrBuf *sb = rz_strbuf_new("");
153  decode_buffer(sb, start, end, 0u, debug);
154  return rz_strbuf_drain(sb);
155 }
static SblHeader sb
Definition: bin_mbn.c:26
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
Definition: sflib.h:133
voidpf void uLong size
Definition: ioapi.h:138
uint8_t ut8
Definition: lh5801.h:11
static void decode_buffer(RzStrBuf *sb, const ut8 *start, const ut8 *end, ut32 padcnt, bool debug)
Definition: protobuf.c:62
#define eprintf(x, y...)
Definition: rlcc.c:7
RZ_API RZ_OWN char * rz_strbuf_drain(RzStrBuf *sb)
Definition: strbuf.c:342
RZ_API RzStrBuf * rz_strbuf_new(const char *s)
Definition: strbuf.c:8
static int debug
Definition: visual.c:21

References debug, decode_buffer(), test_evm::end, eprintf, NULL, rz_strbuf_drain(), rz_strbuf_new(), sb, and start.

Referenced by cmd_print_fromage().