Printf-Oriented Programming
Printf Oriented Programming Alright, now we can get to the real fun. We perform arbitrary computation with printf treating memory as a binary array--one bit per pair of bytes: • The zero bit is represented by the sequence 00 00 • The one-bit is represented by the sequence xx 00 where xx is any non-zero byte. We can use format strings to compute the OR/NOT of arbitrary "bits". We'll start with the simplest, OR: printf("%1$s%2$s%3$hhn", a, b, c) will compute *c = strlen(a) + strlen(b)
A screenshot of a technical page titled “Printf Oriented Programming” explains how to perform arbitrary computation using C printf format strings, including an OR operation represented by code. The joke is that a normally simple printing function is being used as a bizarre programming language and computational system, making low-level programming absurdly overcomplicated. EN: A screenshot of a technical page titled “Printf Oriented Programming” explains how to perform arbitrary computation using C printf format strings, including an OR operation represented by code. The joke is that a normally simple printing function is being used as a bizarre programming language and computational system, making low-level programming absurdly overcomplicated.
- @ithueti / 2458 2020-06-07
- Type
- image
- Size
- 800×417 · 44.4 KiB
- Mood
- absurd, sarcastic
- Language
- en
- Added