spacepaste

  1.  
  2. [universalpackagemanager@universalpackagemanager-pc usr]$ gcc -Wall ./main.c ./*.o ../../ul_exec_libc.so ; ./a.out #*/
  3. size is 126480
  4. size is 168680
  5. passing program and interperater to ul.so:
  6. allocating 8
  7. found 2 tokens.
  8. program_arguments[1] = -l
  9. program_arguments[2] = -h
  10. 00400000-00402000 r-xp 00000000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  11. 00601000-00602000 r-xp 00001000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  12. 00602000-00832000 rwxp 00002000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  13. 00832000-00835000 rwxp 00000000 00:00 0
  14. 00ad1000-00af2000 rwxp 00000000 00:00 0 [heap]
  15. 7f360c9f6000-7f360cb91000 r-xp 00000000 fe:00 2379249 /usr/lib/libc-2.25.so
  16. 7f360cb91000-7f360cd90000 ---p 0019b000 fe:00 2379249 /usr/lib/libc-2.25.so
  17. 7f360cd90000-7f360cd94000 r-xp 0019a000 fe:00 2379249 /usr/lib/libc-2.25.so
  18. 7f360cd94000-7f360cd96000 rwxp 0019e000 fe:00 2379249 /usr/lib/libc-2.25.so
  19. 7f360cd96000-7f360cd9a000 rwxp 00000000 00:00 0
  20. 7f360cd9a000-7f360cda2000 r-xp 00000000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  21. 7f360cda2000-7f360cfa1000 ---p 00008000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  22. 7f360cfa1000-7f360cfa2000 r-xp 00007000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  23. 7f360cfa2000-7f360cfa3000 rwxp 00008000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  24. 7f360cfa3000-7f360cfc6000 r-xp 00000000 fe:00 2378684 /usr/lib/ld-2.25.so
  25. 7f360d18a000-7f360d18d000 rwxp 00000000 00:00 0
  26. 7f360d199000-7f360d1c5000 rwxp 00000000 00:00 0
  27. 7f360d1c5000-7f360d1c6000 r-xp 00022000 fe:00 2378684 /usr/lib/ld-2.25.so
  28. 7f360d1c6000-7f360d1c7000 rwxp 00023000 fe:00 2378684 /usr/lib/ld-2.25.so
  29. 7f360d1c7000-7f360d1c8000 rwxp 00000000 00:00 0
  30. 7ffd7fb46000-7ffd7fb67000 rwxp 00000000 00:00 0 [stack]
  31. 7ffd7fb7a000-7ffd7fb7d000 r--p 00000000 00:00 0 [vvar]
  32. 7ffd7fb7d000-7ffd7fb7f000 r-xp 00000000 00:00 0 [vdso]
  33. ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
  34. aquiring header
  35. aquiring program header
  36. searching for PT_LOAD and PT_INTERP
  37. loading 0x7f360d199010
  38. anywhere = 0
  39. anywhere = 0
  40. LOAD_ELF mapping 0x7f360d199010
  41. anywhere = 1
  42. anywhere = 1
  43. unmapping
  44. argvb = save_argv(3, placeholder);
  45. printing maps before executing
  46. 00400000-0041e000 r-xp 00000000 00:00 0
  47. 00601000-00602000 r-xp 00001000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  48. 00602000-0061d000 rwxp 00002000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  49. 0061d000-00620000 rwxp 00000000 00:00 0
  50. 00620000-00832000 rwxp 00020000 fe:00 1750155 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/Converted/usr/a.out
  51. 00832000-00835000 rwxp 00000000 00:00 0
  52. 00ad1000-00af2000 rwxp 00000000 00:00 0 [heap]
  53. 7f360c9f6000-7f360cb91000 r-xp 00000000 fe:00 2379249 /usr/lib/libc-2.25.so
  54. 7f360cb91000-7f360cd90000 ---p 0019b000 fe:00 2379249 /usr/lib/libc-2.25.so
  55. 7f360cd90000-7f360cd94000 r-xp 0019a000 fe:00 2379249 /usr/lib/libc-2.25.so
  56. 7f360cd94000-7f360cd96000 rwxp 0019e000 fe:00 2379249 /usr/lib/libc-2.25.so
  57. 7f360cd96000-7f360cd9a000 rwxp 00000000 00:00 0
  58. 7f360cd9a000-7f360cda2000 r-xp 00000000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  59. 7f360cda2000-7f360cfa1000 ---p 00008000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  60. 7f360cfa1000-7f360cfa2000 r-xp 00007000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  61. 7f360cfa2000-7f360cfa3000 rwxp 00008000 fe:00 1750154 /home/universalpackagemanager/UPM/asm/elf-parser/not-compiled/ul_exec_libc.so
  62. 7f360cfa3000-7f360cfc6000 r-xp 00000000 fe:00 2378684 /usr/lib/ld-2.25.so
  63. 7f360d167000-7f360d18a000 r-xp 00000000 00:00 0
  64. 7f360d18a000-7f360d18d000 rwxp 00000000 00:00 0
  65. 7f360d199000-7f360d1c5000 rwxp 00000000 00:00 0
  66. 7f360d1c5000-7f360d1c6000 r-xp 00022000 fe:00 2378684 /usr/lib/ld-2.25.so
  67. 7f360d1c6000-7f360d1c7000 rwxp 00023000 fe:00 2378684 /usr/lib/ld-2.25.so
  68. 7f360d1c7000-7f360d1c8000 rwxp 00000000 00:00 0
  69. 7f360d389000-7f360d38c000 rwxp 00000000 00:00 0
  70. 7ffd7fb46000-7ffd7fb67000 rwxp 00000000 00:00 0 [stack]
  71. 7ffd7fb7a000-7ffd7fb7d000 r--p 00000000 00:00 0 [vvar]
  72. 7ffd7fb7d000-7ffd7fb7f000 r-xp 00000000 00:00 0 [vdso]
  73. ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
  74. jumping to 0x7f360d167d80
  75. total 4.5M
  76. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 125K Jan 25 06:56 0.o
  77. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 166K Jan 25 06:56 1.o
  78. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 18K Jan 25 06:56 2.o
  79. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 1.9M Jan 25 06:56 3.o
  80. -rwxr-xr-x 1 universalpackagemanager universalpackagemanager 2.2M Jan 25 14:22 a.out
  81. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 0 Jan 25 12:26 a.txt
  82. -rw-r--r-- 1 universalpackagemanager universalpackagemanager 17K Jan 25 14:21 main.c
  83. [universalpackagemanager@universalpackagemanager-pc usr]$ cat ./main.c
  84. /* */
  85. #include <stdlib.h>
  86. #include <stdio.h>
  87. #include <unistd.h>
  88. #include <limits.h>
  89. #include <assert.h>
  90. #include <string.h>
  91. #include <errno.h>
  92. #include <libgen.h>
  93. #include <sys/stat.h>
  94. #include <sys/types.h>
  95. void
  96. ulexec_array(void * mapped, void * mapped_interpreter, char * args, char **env);
  97. // "look deep into yourself, Clarice" -- Hanibal Lector
  98. char findyourself_save_pwd[PATH_MAX];
  99. char findyourself_save_argv0[PATH_MAX];
  100. char findyourself_save_path[PATH_MAX];
  101. char findyourself_path_separator='/';
  102. char findyourself_path_separator_as_string[2]="/";
  103. char findyourself_path_list_separator[8]=":"; // could be ":; "
  104. char findyourself_debug=0;
  105. int findyourself_initialized=0;
  106. void findyourself_init(char *argv0)
  107. {
  108. getcwd(findyourself_save_pwd, sizeof(findyourself_save_pwd));
  109. strncpy(findyourself_save_argv0, argv0, sizeof(findyourself_save_argv0));
  110. findyourself_save_argv0[sizeof(findyourself_save_argv0)-1]=0;
  111. strncpy(findyourself_save_path, getenv("PATH"), sizeof(findyourself_save_path));
  112. findyourself_save_path[sizeof(findyourself_save_path)-1]=0;
  113. findyourself_initialized=1;
  114. }
  115. int find_yourself(char *result, size_t size_of_result)
  116. {
  117. char newpath[PATH_MAX+256];
  118. char newpath2[PATH_MAX+256];
  119. assert(findyourself_initialized);
  120. result[0]=0;
  121. if(findyourself_save_argv0[0]==findyourself_path_separator) {
  122. if(findyourself_debug) printf(" absolute path\n");
  123. realpath(findyourself_save_argv0, newpath);
  124. if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath);
  125. if(!access(newpath, F_OK)) {
  126. strncpy(result, newpath, size_of_result);
  127. result[size_of_result-1]=0;
  128. return(0);
  129. } else {
  130. perror("access failed 1");
  131. }
  132. } else if( strchr(findyourself_save_argv0, findyourself_path_separator )) {
  133. if(findyourself_debug) printf(" relative path to pwd\n");
  134. strncpy(newpath2, findyourself_save_pwd, sizeof(newpath2));
  135. newpath2[sizeof(newpath2)-1]=0;
  136. strncat(newpath2, findyourself_path_separator_as_string, sizeof(newpath2));
  137. newpath2[sizeof(newpath2)-1]=0;
  138. strncat(newpath2, findyourself_save_argv0, sizeof(newpath2));
  139. newpath2[sizeof(newpath2)-1]=0;
  140. realpath(newpath2, newpath);
  141. if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath);
  142. if(!access(newpath, F_OK)) {
  143. strncpy(result, newpath, size_of_result);
  144. result[size_of_result-1]=0;
  145. return(0);
  146. } else {
  147. perror("access failed 2");
  148. }
  149. } else {
  150. if(findyourself_debug) printf(" searching $PATH\n");
  151. char *saveptr;
  152. char *pathitem;
  153. for(pathitem=strtok_r(findyourself_save_path, findyourself_path_list_separator, &saveptr); pathitem; pathitem=strtok_r(NULL, findyourself_path_list_separator, &saveptr) ) {
  154. if(findyourself_debug>=2) printf("pathitem=\"%s\"\n", pathitem);
  155. strncpy(newpath2, pathitem, sizeof(newpath2));
  156. newpath2[sizeof(newpath2)-1]=0;
  157. strncat(newpath2, findyourself_path_separator_as_string, sizeof(newpath2));
  158. newpath2[sizeof(newpath2)-1]=0;
  159. strncat(newpath2, findyourself_save_argv0, sizeof(newpath2));
  160. newpath2[sizeof(newpath2)-1]=0;
  161. realpath(newpath2, newpath);
  162. if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath);
  163. if(!access(newpath, F_OK)) {
  164. strncpy(result, newpath, size_of_result);
  165. result[size_of_result-1]=0;
  166. return(0);
  167. }
  168. } // end for
  169. perror("access failed 3");
  170. } // end else
  171. // if we get here, we have tried all three methods on argv[0] and still haven't succeeded. Include fallback methods here.
  172. return(1);
  173. }
  174. #include <stddef.h>
  175. #include <stdio.h>
  176. #include <errno.h>
  177. #include <stdlib.h>
  178. #include <string.h>
  179. #include <sys/socket.h>
  180. #include <sys/un.h>
  181. int
  182. make_named_socket (const char *filename)
  183. {
  184. struct sockaddr_un name;
  185. int sock;
  186. size_t size;
  187. /* Create the socket. */
  188. sock = socket (PF_LOCAL, SOCK_DGRAM, 0);
  189. if (sock < 0)
  190. {
  191. perror ("socket");
  192. exit (EXIT_FAILURE);
  193. }
  194. /* Bind a name to the socket. */
  195. name.sun_family = AF_LOCAL;
  196. strncpy (name.sun_path, filename, sizeof (name.sun_path));
  197. name.sun_path[sizeof (name.sun_path) - 1] = '\0';
  198. /* The size of the address is
  199. the offset of the start of the filename,
  200. plus its length (not including the terminating null byte).
  201. Alternatively you can just do:
  202. size = SUN_LEN (&name);
  203. */
  204. size = (offsetof (struct sockaddr_un, sun_path)
  205. + strlen (name.sun_path));
  206. if (bind (sock, (struct sockaddr *) &name, size) < 0)
  207. {
  208. perror ("bind");
  209. exit (EXIT_FAILURE);
  210. }
  211. return sock;
  212. }
  213. int main(int argc, char **argv, char ** env)
  214. {
  215. findyourself_init(argv[0]);
  216. char newpath[PATH_MAX];
  217. find_yourself(newpath, sizeof(newpath));
  218. // if(1 || strcmp(argv[0],newpath)) { }
  219. // char *dummy = strdup( newpath );
  220. // char *dname = dirname( dummy );
  221. // OBJECT START
  222. extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_start;
  223. extern size_t _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_size;
  224. extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_end;
  225. char * p = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_start;
  226. char ch;
  227. int bytes=1;
  228. printf("size is %zu\n", (size_t)&_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_size);
  229. char * array = malloc((size_t)&_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_size);
  230. while ( p != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_end ) {
  231. ch = *p++;
  232. array[bytes-1] = ch;
  233. bytes++;
  234. }
  235. bytes--;
  236. extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_start;
  237. extern size_t _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_size;
  238. extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_end;
  239. char * pi = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_start;
  240. char chi;
  241. int bytesi=1;
  242. printf("size is %zu\n", (size_t)&_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_size);
  243. char * arrayi = malloc((size_t)&_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_size);
  244. while ( pi != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_end ) {
  245. chi = *pi++;
  246. arrayi[bytesi-1] = chi;
  247. bytesi++;
  248. }
  249. bytesi--;
  250. printf("passing program and interperater to ul.so:\n");
  251. ulexec_array(array, arrayi, "-l -h", env);
  252. return (0);
  253. printf("Extracting...\n");
  254. // // OBJECT START
  255. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_start;
  256. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_size; // we keep this just in case we ever need it
  257. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_end;
  258. // char * a0p = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_start;
  259. // FILE *a0fp;
  260. // chdir(dname);
  261. //
  262. // mkdir("usr", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  263. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  264. // mkdir("bin", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  265. // chdir("bin"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  266. //
  267. // a0fp = fopen("./ls", ("w+"));
  268. // while ( a0p != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_bin_ls_end ) fputc(*a0p++, a0fp); // credit for fputc(*p++, fp): flawless_snowflake from kik messenger
  269. // fclose(a0fp);
  270. // chmod("./ls", 00755);
  271. // chdir(dname);
  272. //
  273. // // OBJECT END
  274. //
  275. // // OBJECT START
  276. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_start;
  277. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_size; // we keep this just in case we ever need it
  278. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_end;
  279. // char * a1p = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_start;
  280. // FILE *a1fp;
  281. // chdir(dname);
  282. //
  283. // mkdir("usr", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  284. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  285. // mkdir("lib64", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  286. // chdir("lib64"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  287. //
  288. // a1fp = fopen("./ld-linux-x86-64.so.2", ("w+"));
  289. // while ( a1p != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib64_ld_linux_x86_64_so_2_end ) fputc(*a1p++, a1fp); // credit for fputc(*p++, fp): flawless_snowflake from kik messenger
  290. // fclose(a1fp);
  291. // chmod("./ld-linux-x86-64.so.2", 00755);
  292. // chdir(dname);
  293. //
  294. // // OBJECT END
  295. //
  296. // // OBJECT START
  297. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libcap_so_2_start;
  298. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libcap_so_2_size; // we keep this just in case we ever need it
  299. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libcap_so_2_end;
  300. // char * a2p = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libcap_so_2_start;
  301. // FILE *a2fp;
  302. // chdir(dname);
  303. //
  304. // mkdir("usr", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  305. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  306. // mkdir("lib", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  307. // chdir("lib"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  308. //
  309. // a2fp = fopen("./libcap.so.2", ("w+"));
  310. // while ( a2p != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libcap_so_2_end ) fputc(*a2p++, a2fp); // credit for fputc(*p++, fp): flawless_snowflake from kik messenger
  311. // fclose(a2fp);
  312. // chmod("./libcap.so.2", 00644);
  313. // chdir(dname);
  314. //
  315. // // OBJECT END
  316. //
  317. // // OBJECT START
  318. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libc_so_6_start;
  319. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libc_so_6_size; // we keep this just in case we ever need it
  320. // extern char _binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libc_so_6_end;
  321. // char * a3p = &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libc_so_6_start;
  322. // FILE *a3fp;
  323. // chdir(dname);
  324. //
  325. // mkdir("usr", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  326. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  327. // mkdir("lib", 0777); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  328. // chdir("lib"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  329. //
  330. // a3fp = fopen("./libc.so.6", ("w+"));
  331. // while ( a3p != &_binary__home_universalpackagemanager_UPM_asm_elf_parser_not_compiled_usr_lib_libc_so_6_end ) fputc(*a3p++, a3fp); // credit for fputc(*p++, fp): flawless_snowflake from kik messenger
  332. // fclose(a3fp);
  333. // chmod("./libc.so.6", 00755);
  334. // chdir(dname);
  335. //
  336. // // OBJECT END
  337. //
  338. // // MKDIRS START
  339. // chdir(dname);
  340. //
  341. // mkdir("usr", 0777);
  342. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  343. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  344. //
  345. // chdir(dname);
  346. //
  347. // // MKDIRS END
  348. //
  349. // // MKDIRS START
  350. // chdir(dname);
  351. //
  352. // mkdir("usr", 0777);
  353. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  354. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  355. // mkdir("bin", 0777);
  356. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  357. // chdir("bin"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  358. //
  359. // chdir(dname);
  360. //
  361. // // MKDIRS END
  362. //
  363. // // MKDIRS START
  364. // chdir(dname);
  365. //
  366. // mkdir("usr", 0777);
  367. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  368. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  369. // mkdir("lib64", 0777);
  370. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  371. // chdir("lib64"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  372. //
  373. // chdir(dname);
  374. //
  375. // // MKDIRS END
  376. //
  377. // // MKDIRS START
  378. // chdir(dname);
  379. //
  380. // mkdir("usr", 0777);
  381. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  382. // chdir("usr"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  383. // mkdir("lib", 0777);
  384. // // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  385. // chdir("lib"); // Simulates the mkdir -p ( mkdir --help: -p, --parents ) argument of the mkdir binary found in /bin/mkdir or /usr/bin/mkdir
  386. //
  387. // chdir(dname);
  388. //
  389. // // MKDIRS END
  390. //
  391. // // CHMODDIR START
  392. // chdir(dname);
  393. // chmod("usr", 00755);
  394. // chdir(dname);
  395. //
  396. // // CHMODDIR END
  397. //
  398. // // CHMODDIR START
  399. // chdir(dname);
  400. // chmod("usr/bin", 00755);
  401. // chdir(dname);
  402. //
  403. // // CHMODDIR END
  404. //
  405. // // CHMODDIR START
  406. // chdir(dname);
  407. // chmod("usr/lib64", 00755);
  408. // chdir(dname);
  409. //
  410. // // CHMODDIR END
  411. //
  412. // // CHMODDIR START
  413. // chdir(dname);
  414. // chmod("usr/lib", 00755);
  415. // chdir(dname);
  416. //
  417. // // CHMODDIR END
  418. //
  419. // free( dummy );
  420. // printf("Extracted\n");
  421. return 0;
  422. }
  423. [universalpackagemanager@universalpackagemanager-pc usr]$
  424.