aboutsummaryrefslogtreecommitdiff
path: root/src/pack.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2021-07-22 22:30:48 +1000
committerDavid Timber <mieabby@gmail.com>2021-07-22 22:30:48 +1000
commit5a98bcd78867b4fb1a272ce26774c8811f28750d (patch)
treefebb7d4d3112d4ce598cd9352fc81d2da2d54ca6 /src/pack.c
parenta0b92490365dc88d50c81780ff9ebb6ddb681e5e (diff)
Impl PRNE_HTBT_OP_RCB ...
* Parameterize prne_start_bin_rcb() args * Change value of PRNE_ARCH_NONE to 0 to use it over the wire (problem arises deserialising) * tostr() and fstr() functions set errno to EINVAL * Run bne without binary archive to support same-arch infection
Diffstat (limited to 'src/pack.c')
-rw-r--r--src/pack.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pack.c b/src/pack.c
index 156da48..a11d60b 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -447,6 +447,10 @@ prne_pack_rc_t prne_start_bin_rcb (
prne_bin_tuple_t *t = NULL;
size_t seek = 0;
+ if (ba == NULL) {
+ return PRNE_PACK_RC_INVAL;
+ }
+
for (size_t i = 0; i < ba->nb_bin; i += 1) {
if (ba->bin[i].arch == target) {
t = &ba->bin[i];
@@ -590,6 +594,12 @@ bool prne_index_nybin (
return true;
}
+void prne_init_rcb_param (prne_rcb_param_t *rp) {
+ prne_memzero(rp, sizeof(prne_rcb_param_t));
+}
+
+void prne_free_rcb_param (prne_rcb_param_t *rp) {}
+
const prne_arch_t *prne_compat_arch (const prne_arch_t target) {
static const prne_arch_t F_X86[] = {
PRNE_ARCH_X86_64,
@@ -623,5 +633,6 @@ const char *prne_pack_rc_tostr (const prne_pack_rc_t prc) {
case PRNE_PACK_RC_Z_ERR: return "zlib error";
case PRNE_PACK_RC_NO_ARCH: return "no arch";
}
+ errno = EINVAL;
return NULL;
}