#include #include #include #include #include #include #include #include #include #include #include #include typedef struct { char filename[100]; char mode[8]; char uid[8]; char gid[8]; char size[12]; char mtime[12]; char chksum[8]; char typeflag[1]; } tar_header; uint32_t getsize(const char *in) { uint32_t size=0; uint32_t j; uint32_t count=1; for (j=11;j>0;j--,count*=8) { size+=((in[j-1]-'0')*count); } return size; } uint32_t find_loc(char* name,char* initrd) { uint32_t pos=0; tar_header tar_hdr; for (int i=0;;i++) { char* tar_hdr_ptr=(char*)&tar_hdr; for (size_t i=0;i0) { pos=pheader.offset+datapos; for (size_t i=0;i