Posted 15 May 2016 - 04:06 PM
Hey, I am back!
Due to mysterious reasons my account was deleted, so I'll just post this again.
I made a program that can pack multiple files into one and another program to unpack those files. This allows for self-extracting programs and utilities, it even can unpack itself!
File packer: AnN7sQNg
File unpacker: 1b2u56ms
My pastebin: Greygraphics
How it works:
Due to mysterious reasons my account was deleted, so I'll just post this again.
I made a program that can pack multiple files into one and another program to unpack those files. This allows for self-extracting programs and utilities, it even can unpack itself!
File packer: AnN7sQNg
File unpacker: 1b2u56ms
My pastebin: Greygraphics
How it works:
Spoiler
Packing the files:- Open target file
- Read files to pack into an array and add "NEWFILE" and "EOF" as headers
- Pack everything into "–[[" and "–]]"
- Write the array to the target file, write or append mode
- Cleanup
- Read the whole file into an array
- Scan this array for any headers ("NEWFILE")
- 1. Go to next header 2. Read name below 3. Read contents below 4. Write all the contents into file 5. Repeat
- Cleanup