25 size_t file_len0 = strlen(
file) + 1;
26 if (file_len0 > 255) {
37 buf[2] = (
ut8)(file_len0 & 0xff);
49 eprintf(
"RapClientOpen: Bad packet 0x%02x\n",
buf[0]);
52 eprintf(
"Cannot read 5 bytes from server\n");
65 size_t i = strlen(
cmd) + 1;
76 char *rcmd =
calloc(1, cmd_len + 1);
80 char *res =
c->cmdstr(
c->core, rcmd);
82 int res_len = strlen(res) + 1;
97 eprintf(
"Error: Wrong reply for command 0x%02x\n", bufr[0]);
101 if (cmd_len < 1 || cmd_len > 16384) {
102 eprintf(
"Error: cmd_len is wrong\n");
105 char *cmd_output =
calloc(1, cmd_len + 1);
107 eprintf(
"Error: Allocating cmd output\n");
112 cmd_output[cmd_len] = 0;
127 eprintf(
"__rap_write: malloc failed\n");
137 eprintf(
"__rap_write: error\n");
167 eprintf(
"__rap_read: Unexpected rap read reply "
168 "(%d=0x%02x) expected (%d=0x%02x)\n",
174 eprintf(
"__rap_read: Unexpected data size %d vs %d\n",
i,
count);
190 eprintf(
"Truncated socket read\n");
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 count
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 cmd
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
static void rz_write_be64(void *dest, ut64 val)
static ut64 rz_read_at_be64(const void *src, size_t offset)
static ut32 rz_read_at_be32(const void *src, size_t offset)
static ut32 rz_read_be32(const void *src)
static void rz_write_be32(void *dest, ut32 val)
RZ_API int rz_socket_read_block(RzSocket *s, unsigned char *buf, int len)
RZ_API int rz_socket_flush(RzSocket *s)
RZ_API bool rz_socket_block_time(RzSocket *s, bool block, int sec, int usec)
RZ_API int rz_socket_write(RzSocket *s, void *buf, int len)
RZ_API char * rz_socket_rap_client_command(RzSocket *s, const char *cmd, RzCoreBind *c)
RZ_API int rz_socket_rap_client_open(RzSocket *s, const char *file, int rw)
static ut8 * rz_rap_packet(ut8 type, ut32 len)
RZ_API int rz_socket_rap_client_write(RzSocket *s, const ut8 *buf, int count)
RZ_API int rz_socket_rap_client_read(RzSocket *s, ut8 *buf, int count)
static void rz_rap_packet_fill(ut8 *buf, const ut8 *src, int len)
RZ_API int rz_socket_rap_client_seek(RzSocket *s, ut64 offset, int whence)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]