[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating a minimal ELF file using poke
From: |
Jose E. Marchesi |
Subject: |
Re: Creating a minimal ELF file using poke |
Date: |
Sat, 16 Jul 2022 11:14:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> Hello people!
>
> I've added a new entry to https://pokology.org/fun-with-elf.html article.
>
> `3 Building "Hello, world" from scratch`
>
> It is based on an interesting blog post:
> https://kevinboone.me/elfdemo.html?i=1
>
> The idea here is to create a valid working ELF executable which runs
> on a x86_64 Linux machine.
>
> The following Poke script will create `fun-with-elf.exe` file in your
> current directory. You can run in after `chmod +x fun-with-elf.exe`.
>
> I'd be happy to hear your suggestions/reviews/improvements/... :)
Very nice.
> BTW we soon don't need functions like `u32off_as_le_bytes` (when I
> finished the cast from integers/offsets to byte arrays!)
Bravo :)
> save :ios fd
> :file "fun-with-elf.exe"
> :from 0#B
> :size off
> :append 0
> ;
The usage of `save' (which is a poke command) in the example makes me
think: we probably should factor out the functionality of the command to
a ios_save function in pickles/ios.pk, much like we did with `dump' and
ios_dump_bytes...
Otherwise it won't be available to other poke applications.