Wednesday, March 01, 2023

Linear Sweeping vs Recursive Disassembly

Objdump's linear sweep

While objdump's linear algorithm makes it fast, there are tradeoffs. For example, if we construct a Linux executable, we find we can insert strings into various headers which objdump will, to no surprise, blindly misinterpret.

Sunday, February 26, 2023

Use xargs

Get out of the habit of using while read as an idiom and instead use xargs to process arguments when you're doing batch compute stuff.

Saturday, January 21, 2023

Mm .. Malware Analysis

TL;DR: Analysis of malspam potentially targeting an organization. C#/.NET binary using KoiVM, process hollowing, and abusing vulnerable procexp152.sys driver.

Friday, January 20, 2023

Cannabis vs Cognition

Searching through papers this morning curious about evidence-based studies on cannabis (and synthetic cannabis[1][2]) in relation to psychosis, schizophrenia, and general effects on cognition.

Saturday, December 24, 2022

FrodoPIR

This morning I'm currently staring down a stack of research papers on my desk. But I just saw a headline from Hacker News that Brave, a privacy-preserving browser I'm a fan of, published a paper and code for an improved private information retrieval system.

Saturday, November 19, 2022

James Garfield's Pythagorean Proof

Today I learned James Garfield, who once worked as a lawyer, Civil War General, and served as the 20th President of the United States, was math savvy and published a novel Pythagorean theorem proof.[1]

\[ \text{Area}_{\text{trapezoid } ACED} = \frac{1}{2} \cdot (AC + DE) \cdot CE = \frac{1}{2} \cdot (a + b) \cdot (a + b) = \frac{(a + b)^2}{2} \] \[ \begin{aligned} \text{Area}_{\text{trapezoid } ACED} &= \text{Area}_{\Delta ACB} + \text{Area}_{\Delta ABD} + \text{Area}_{\Delta BDE} \\ &= \frac{1}{2}(a \times b) + \frac{1}{2}(c \times c) + \frac{1}{2}(a \times b) \end{aligned} \] \[ (a + b) \times \frac{1}{2}(a + b) = \frac{1}{2}(a \times b) + \frac{1}{2}(c \times c) + \frac{1}{2}(a \times b) \] \[ a^{2} + b^{2} = c^{2} \]

Small Pieces

We can take this in smaller pieces. First, we can find the area of the right-angled trapezoid with the following equation:

\[ \text{Area}_{\text{trapezoid}} = \frac{1}{2} \cdot (a + b) \cdot (a + b) = \frac{(a + b)^2}{2} \]

We can find the area of each of the two outer triangles with the following:

\[ \text{Area}_{\text{triangle}} = \frac{ab}{2} \]

And the area of the inner triangle with:

\[ \text{Area}_{\text{inner triangle}} = \frac{c^2}{2} \]

Proof

Reducing, we can go to the end, beginning with our substituted and now simplified area equation demonstrated above:

\[ \frac{(a + b)^2}{2} = 2 \cdot \frac{ab}{2} + \frac{c^2}{2} \]

Then we expand \( (a + b)^2 \) on the left hand side. And our equation on the right can also be simplified since we're both multiplying and dividing \( ab \) by 2:

\[ \frac{a^2 + 2ab + b^2}{2} = ab + \frac{c^2}{2} \]

Multiply both sides by 2 to eliminate denominators:

\[ a^2 + 2ab + b^2 = 2ab + c^2 \]

Lastly, subtract \( 2ab \) from both sides:

\[ a^2 + b^2 = c^2 \]

Footnotes

  1. Mathematical Treasure: James A. Garfield’s Proof of the Pythagorean Theorem ↩︎

Wednesday, October 05, 2022

Casio F-91 Repair

Exposure to harsh weather wore my watch band down until eventually breaking. So, I re-strapped my F-91W with a sport-grade band (and spring bars) from a W-216H.

Using Python To Access archive.today, July 2025

It seems like a lot of the previous software wrappers to interact with archive.today (and archive.is, archive.ph, etc) via the command-line ...