#include <fcntl.h>
#include <getopt.h>
#include <sys/stat.h>
-#include <arpa/inet.h>
#include "common.h"
#include "cbfs.h"
struct cbfs_payload_segment *segs;
int i;
+ if(!iself(input)){
+ printf("Fatal error: the payload file is not in ELF format!\n");
+ exit(1);
+ }
+
+
comp_func_ptr compress = compression_function(algo);
if (!compress)
return -1;
name = (char *)(strtab + shdr[i].sh_name);
- if (!strcmp(name, ".note.pinfo"))
+ if (!strcmp(name, ".note.pinfo")) {
segments++;
+ isize += (unsigned int)shdr[i].sh_size;
+ }
}
/* Now, regular headers - we only care about PT_LOAD headers,