Skip to content

Instantly share code, notes, and snippets.

View big-lip-bob's full-sized avatar
🪤
Overwhelmed

RustHaruspex big-lip-bob

🪤
Overwhelmed
View GitHub Profile
@Fingercomp
Fingercomp / 00-sound-card-toc.md
Last active June 8, 2024 03:47
Guide to the Sound Card

Exploiting Lua 5.1 on x86_64

The following Lua program generates a Lua bytecode program called lua-sandbox-rce.luac, which in turn spawns a shell from within Lua 5.1 sandbox. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed
  local function middle()
    local co, upval
    local ub1 = {[0] = -- Convert uint8_t to char[1]
@MCJack123
MCJack123 / on-writing-an-os.md
Last active May 28, 2024 16:07
On Writing a ComputerCraft OS

On Writing a ComputerCraft OS

One of the most common projects I've seen for ComputerCraft is to write an operating system. People look at the limited command-line interface that CraftOS provides, and think, "I want this to work like my normal computer does!" Time and time again, a new post pops up on the ComputerCraft forums or Discord either announcing an OS, or asking for help with an OS, or releasing an OS. Usually, there are some very obvious flaws in these "OS"es, ranging from poor design choices, to overstating what they are and underdelivering. There are many common misunderstandings and undersights that newbie developers run into when writing an operating system, and these end up creating mediocre products at best.

A Critical Distinction

The term "OS" is thrown around a lot, and in my opinion it's very overused. According to [Wikipedia]: "An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs." However, m

@makamys
makamys / 1.7.10-essentials.md
Last active July 23, 2024 19:53
List of "Essential" 1.7.10 Mods

List of "Essential" 1.7.10 Mods

This is a list of Minecraft 1.7.10 mods that are not focused on adding new original content. Instead, they make the base game run better, or port over features from other versions of vanilla.

These lists try to comprehensively list all the available options. You will not want to use all of the listed mods at once.

Some of the listed mods require a Mixin bootstrap mod in order to work. See the Mixin mods section near the end of the document for information about that.

Table of Contents

@T-Dark0
T-Dark0 / what_as_does.md
Last active July 18, 2023 08:26
What `as` does

as does a huge number of things. Probably too many. Here's a comprehensive list of everything it can do. Note that as conversions are transitive: If a as B as C compiles, then so does a as C, though it might not take the same "path" through intermediate conversions.

  • int <-> int
    • zero_extend: unsigned int -> bigger unsigned int. Pads the number with leading zeroes.
    • sign_extend: signed int -> bigger signed int. Pads the number with leading zeroes if positive, and leading ones if negative.
    • truncate: bigger int -> smaller int (regardless of signedness). Throws away the high bits of the number
    • reinterpret_sign: int -> int of the same size and opposite signedness. Does nothing to the bits.
  • int <-> float
    • cast_saturate_to_infinity: Yields the float closest to the specified integer. Yields infinity if the integer is out of bounds.
  • cast_nan_to_zero_saturating_when_out_of_bounds: Truncates the float and yields the corresponding integer.