PagedOut_002_beta2.pdf

(9495 KB) Pobierz
Paged Out! Institute
https://pagedout.institute/
Project Lead
Gynvael Coldwind
Executive Assistant
Arashi Coldwind
DTP Programmer
foxtrot_charlie
DTP Advisor
tusiak_charlie
Lead Reviewers
Mateusz "j00ru" Jurczyk
KrzaQ
Reviewers
kele
disconnect3d
We would also like to thank:
Artist (cover)
Vlad Gradobyk
instagram.com/vladgradobyk
facebook.com/gradobyk.graphic
Additional Art
cgartists (cgartists.eu)
Templates
Matt Miller, wiechu,
Mariusz "oshogbo" Zaborski
Issue #2 Donators
Alex Popescu, celephais,
Ayla Khan, and others!
If you like Paged Out!,
let your friends know about it!
It seems PO!#1 was received well. OK, that was an
understatement - the download count (over 135k at the
moment of writing these words) and the positive feedback
we've received blew my predictions out of the water! It seems
our readers appreciated the old-school zine feel, liked the
experimental one-page format, and enjoyed the topic choice.
At the same time I realize we still have a long way to go on
multiple fronts. To give you a glimpse of what's on my mind, here
are three most urgent matters.
First of all, the print files proved to be more tricky than
expected. Thankfully the first version is being battle-tested at a
printing house as we speak, so it shouldn't be long now. Once we
have these, we'll claim we've reached beta2.
Secondly, and even more importantly, we have even more delays
with optimizing the PDFs towards screen readers (text-to-
speech engines and the like). This requires more work both on
the process side and technical side, but we'll get there. And
once we do, we'll call it the final version.
And last, I'm thinking of re-working the article review process for
PO!#3 to distribute the review work more evenly both in terms of
time and between reviewers, and to automate certain things we
usually check for. So, if you've written an article for PO!#1 or PO!
#2, note that there will be changes ("the only constant thing is
change" and all that).
But enough shop talk. The second issue of Paged Out! has
arrived, and it is time for you to start browsing through the
articles our amazing authors conjured up! And in case you have
any feedback, please don't hesitate to email
gynvael@pagedout.institute, or just jump on our Discord
(https://discord.gg/QAwfE5R).
Enjoy!
Gynvael Coldwind
Project Lead
Legal Note
This zine is free! Feel free to share it around.
�½��
Licenses for most articles allow anyone to record audio versions and post
them online — it might make a cool podcast or be useful for the visually
impaired.
If you would like to mass-print some copies to give away, the print files are
available on our website (in A4 and US Letter formats, 300 DPI).
If you would like to sell printed copies, please contact the Institute.
When in legal doubt, check the given article's license or contact us.
5
Asymptotic Arithmetic Coding for Trees
The anatomy of x86 instruction
C as a portable assembly - Porting 32-bit assembly code to 6
Baking really good x86/x64 shellcode for Windows
Hacking 3.3V USB TTL Serial Adapters To Operate At 1.8V
How did I force Unity to unload native plugins
A Simple Tile-Based Game Engine With LÖVE
Faking kernel pointers as user pointers
How Much Has *NIX Changed?
Ad-hoc workspaces with nix-shell
Windows Script Chimera
The Dork's unofficial guide to scripting Slack
Traveling Back in Time (in Conway's Game of Life)
An artisanal QR code
Super Simple but Efficient C Allocator
Easy TOTP 2fa for SSH bash shells
Looping with Untyped Lambda Calculus in Python and Go
Quick n' dirty static analysis with Prolog
Using a MIDI controller to control your system's volume
Abusing C – Have Fun!
Programming with 1’s and 0’s
Adding a yield statement to your Go programs - an annotated
emergency serial console
Tracing Recipes!
Rule 30 in APL
Python Server Profiling: A quick guide (with real data)
ZALGO TEXT DISCORD BOT IN 17 LINES OF PYTHON
Prime quine
STRCASE: A practical support for Multiway branches (switch).
execs: the missing exec functions in the standard C library.
NLINLINE: network configuration must be simple, inlined and
Draw over screen
What If - We tried to malloc infinitely?
Spooky Fizz Buzz
A look inside Raspberry Pi hardware decoders licenses
Ret-To-Python or How to solve Flare-On 6 wopr
Cheat (Engine) Python
Looking at the RarVM
Control Flow Guard Teleportation
Identifying crypto functions
Turing-Complete SQL Injections with SQLVM
Fuzzing Essentials
How to get a free HackYeah2019 ticket?
A story of a SMEP bypass
Creating a Backdoored App for Pentesting
Sigreturn-Oriented Programming
Gigacage
Royal Flags Wave Kings Above
RISC-V Shellcoding Cheatsheet
Intercept Android app traffic with Burp suite
picoCTF 2019 - The JavaScript Kiddie writeup
Peering AWS VPCs
cURL- tips to remember
Deprecating set-uid - Capability DO
An article for Paged Out! about how to write an article for
Algorithms
5
6
Assembly
6
7
8
9
Electronics
9
10
GameDev
10
11
OS Internals
12
12
Operating Systems
13
13
Programming
14
14
15
17
18
19
20
21
22
23
24
25
26
28
29
30
31
32
33
34
35
36
37
39
40
41
Reverse Engineering
42
42
43
44
45
46
47
Security/Hacking
48
48
49
50
51
52
53
54
55
56
57
58
59
SysAdmin
59
60
61
Writing Articles
62
62
3
Algorithms
Asymptotic Arithmetic Coding for Trees
Asymptotic Arithmetic Coding for Trees
You have a tree and you want to sort a list of some of its nodes. You need a sorting key. Parents should go
before children, and sibling order is respected. You could number every single node in the tree, but you
need to renumber often. You can assign fixed paths like [1, 5, 2, 1], to reduce that, but now your keys are
variable length and harder to compare. Can we combine both and get O(1) space-and-time keys on the fly?
Arithmetic Coding is a well-known lossless encoding technique.
Given a string in
some alphabet,
we can map its symbols onto the range

[0…1] relative to their expected distribution.
These divisions can be nested.

We can encode our string by picking the
matching interval for each character.
The final interval uniquely identifies this
particular string.
Pick a short number in this range, e.g.
and encode it in binary. Likelier strings
have longer intervals and require less bits.
Asymptotic Arithmetic Coding is the same
idea, but for encoding an infinitely large
alphabet, e.g. strings of natural numbers.
This is done using an artificial 1/(x+1)
cumulative distribution to split [1…0] into
infinitely many intervals.

These intervals are infinitely nested too
(1→0 is better for numerical precision).
This encoding is only reversible and 1-to-1 if
you remember the string’s original length.
To avoid this, we treat
0
as the
stopping
symbol
and increment child indices by 1.

We can then pick e.g. the
start
of each
interval to get a direct
1-to-1 encoding.
Parents
don’t renumber
when children
change. This
fractional index
is stateless
and its mapping curve can be tuned.
A
16
67%
B
0.667
A
B
C
A
B
6
25%
C
2
8%
C
0.917 1
B
C
A
BC
ABAAAAABAAABCBBBACAAAAAA
A
0
0.4605617319
0.460561732
0.01110101111001110101111110101
0.4605617344
[ 2, 1, 5, 9, 103 ] ?
[ 1, 0, 2, 5 ] ?
0
1
2
1/3
0 1 2
2
5
0.01110000010010111101101000
3 4
1/4
1/5
1/6
0
1
1/2
[1]
1/2 .. 1/3
[ 1, 0 ]
1/2 .. 5/12
[1] =
[ 1,
0
]
1/2
.. 5/12
1/2
2
3
7/18
[ 1, 0 ] =
[ 1,
1
]
5/12
.. 7/18
5/12
0
0
1
4 5 6
1
2/3
1/2
When truncated to a
float
or
double,
it takes quite a large tree before the precision breaks down.
Example code in JavaScript: https://gist.github.com/unconed/e0624438740b6450b05c07b7992766c5
5
acko.net / @unconed (gh)
Steven Wittens
WTFPL
Zgłoś jeśli naruszono regulamin