From 6b77774296f19677539fc51e5a2a59812793ec19 Mon Sep 17 00:00:00 2001 From: q3aql Date: Sun, 7 Jul 2024 18:10:07 +0200 Subject: [PATCH] README.md --- README.md | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 86f7a2b..3a7bba3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ `packelf` was inspired by [the idea of Klaus D](https://askubuntu.com/a/546305). It is used to pack a ELF program and its dependent libraries into a single executable file. -## usage +## Usage (packelf): ``` -Usage: ./packelf.sh [-zjJn] [ADDITIONAL_LIBS ...] - -zjJ compress flag passed to tar, '-z' by default - -n pack without compress +Usage: ./packelf.sh [ADDITIONAL_LIBS] ``` First, pack a ELF program. For example, you can pack `ls` like this: @@ -28,41 +26,17 @@ You can execute the packed program directly: However, every time the packed program is executed, an internal unpacking operation is performed automatically, which results in a slower startup of the program. -If you need to execute the program many times and want to reduce the startup time, you can unpack the program before executing it. +## USAGE EXTRA TOOLS: -``` -# Run the packed program directly, it takes longer. -~ # time bash -c 'for i in {1..100};do /root/ls >/dev/null; done' -real 0m4.203s -user 0m2.067s -sys 0m3.093s - -# You can unpack it first. -~ # PACKELF_UNPACK_DIR=/usr/local/bin /root/ls -'ls' was unpacked to '/usr/local/bin'. -You can run '/usr/local/bin/ls ARGS...' to execute the command. - -# ls and ls.res are generated after unpacking. -~ # /usr/local/bin/ls -lh /usr/local/bin/ls* --rwxr-xr-x 1 root root 3.9K May 21 09:00 /usr/local/bin/ls -/usr/local/bin/ls.res: -total 3.0M --rwxr-xr-x 1 root root 175K May 21 09:00 ld-linux-x86-64.so.2 --rwxr-xr-x 1 root root 2.0M May 3 2022 libc.so.6 --rw-r--r-- 1 root root 15K May 3 2022 libdl.so.2 --rw-r--r-- 1 root root 454K Feb 3 2018 libpcre.so.3 --rwxr-xr-x 1 root root 142K May 3 2022 libpthread.so.0 --rw-r--r-- 1 root root 152K Mar 1 2018 libselinux.so.1 --rwxr-xr-x 1 root root 131K Jan 18 2018 ls - -# Running the unpacked launch script (/usr/local/bin/ls) will take much less time. -~ # time bash -c 'for i in {1..100};do /usr/local/bin/ls >/dev/null; done' -real 0m0.370s -user 0m0.239s -sys 0m0.133s +``` +Usage: ./packelf-copylibs.sh ``` -## dependence +``` +Usage: ./packelf-folder.sh +``` + +## Dependencies * sh * tar * sed