216 results for "":
2018 Retrospective
The year is drawing to a close, and I’m going off on a much-needed holiday next week. This seems like a good time to look back at the past twelve months!
I can’t believe that shipped
2018 was the year of foundational work. As far as “work work” is concerned, I spent the first 9 months finishing up my largest project ever, the itch v25 rewrite.
Huffman 101
Let’s play a game: your objective is to guess a word, but you can only ask yes or no questions. You should also aim to ask as few questions as possible.
You might have played a variant of this game before, guessing famous actors or musicians. You’d usually ask questions like “Are they alive?”, or “Have they won an Oscar”? And that would allow you to narrow down the possibilities, until you finally resort to a list of direct guesses (“Is it Amy Adams?”) or simply give up.
Fine, we'll relocate our own binary!
Welcome back to the eighteenth and final part of “Making our own executable packer”.
In the last article, we had
a lot of fun. We already had a “packer” executable, minipak
, which joined
together stage1
(a launcher), and a compressed version of whichever executable
we wanted to pack.
What we added, was a whole bunch of abstractions to parse ELF headers using
deku, which we used from stage1
to be able to
launch the guest executable from memory, instead of writing it to a file and
using execve
on it.
My ideal Rust workflow
Writing Rust is pretty neat. But you know what’s even neater? Continuously testing Rust, releasing Rust, and eventually, shipping Rust to production. And for that, we want more than plug-in for a code editor.
We want… a workflow.
Why I specifically care about this
This gets pretty long, so if all you want is the advice, feel free to jump to it directly.
Developing over SSH
With the previous part’s VM still running, let’s try connecting to our machine over SSH.
Network addresses, loopback and IP nets
Normally, to connect to a machine, you’d find its IP address. On Linux, a decade
ago, you would’ve used ifconfig
. Nowadays you can use ip addr
:
The loopback interface (lo
) is local, so it’s not useful to reach the box from
the outside: you can see it can be accessed over IPv4 at address 127.0.0.1 but
not just! What we’re reading here is 127.0.0.1/8, which corresponds to the range
127.0.0.1 - 127.255.255.255
Day 2 (Advent of Code 2022)
Part 1
In the day 2 challenge, we’re playing Rock Papers Scissors.
We’re given a strategy guide like so:
A Y
B X
C Z
Left column is “their move”: A means Rock, B means Paper, C means Scissors. Right column is “our move”: X means Rock, Y means Paper, Z means Scissors.
Each line corresponds to a turn, and we must calculate the total score we get. Picking “Rock” gives 1 point, “Paper” gives 2 points, and “Scissors” gives 3. Losing the round gives 0 points, drawing gives 3, winning it gives 6.
Day 14 (Advent of Code 2020)
It’s time for the Day 14 problem!
After the hassle that was Day 13, I hope this time we’ll have a relatively chill time. And, at least for Part 1, that is true.
Our input looks something like this:
mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
mem[8] = 11
mem[7] = 101
mem[8] = 0
mem
is our memory. Our addresses are 36-bit wide, but as you’ll see, that
doesn’t matter much.
Reading files the hard way - Part 3 (ftrace, disk layouts, ext4)
So far, we’ve seen many ways to read a file from different programming languages, we’ve learned about syscalls, how to make those from assembly, then we’ve learned about memory mapping, virtual address spaces, and generally some of the mechanisms in which userland and the kernel interact.
But in our exploration, we’ve always considered the kernel more or less like a “black box”. It’s time to change that.
Damian Sommer on The Yawhg
Damian Sommer did a casual AMA on Reddit recently, about his upcoming game, The Yawhg. I got to ask him a few questions. Here’s what he had to say.
What brought you out of your usual “let’s make fucked up platformers” style?
“I was just kind of tired of them. There’s still one more platformer I really want to finish, (The Clown Who Wanted Everything), but besides that, I’m just extremely bored of them now.”