back

Rust Binary Analysis, Feature by Feature

If you suspend your transcription on amara.org, please add a timestamp below to indicate how far you progressed! This will help others to resume your work!

Please do not press “publish” on amara.org to save your progress, use “save draft” instead. Only press “publish” when you're done with quality control.

Video duration
00:42:10
Language
English
Abstract
A walkthrough of the assembly code idioms the Rust compiler uses to implement the language’s core features (as they appear in Klabnik’s and Nichols’ “The Rust Programming Language”) - starting with simple match expressions and all the way to monomorphized functions and iterator chains.

You attempt to analyze a binary file compiled in the Rust programming language. You open the file in your favorite disassembler. Twenty minutes later you wish you had never been born. You’ve trained yourself to think like g++ and msvc: Here’s a loop, there’s a vtable, that’s a global variable, a library function, an exception. Now you need to think like the Rust compiler. Maybe you’ve heard about “sum types” and “generics” and “iterators”, maybe you haven’t, and in both cases you are going to have an exceptionally bad time.

This talk will get you familiar with the assembly code idioms the Rust compiler uses to implement the language’s core features (as they appear in Klabnik’s and Nichols’ “The Rust Programming Language”), and more generally, the frame of mind required for reverse-engineering such programs. How is an Option<T> represented using the same amount of memory as a plain T? How do monomorphized generic functions complicate RE work? What's the right approach to untangle many-layered, unintuitive iterator chains? We will tackle these questions and many more.

Includes a publicly available lab setup with several sample programs that showcase core Rust features as compiled to assembly.

Talk ID
11684
Event:
37c3
Day
2
Room
Saal Zuse
Start
5:15 p.m.
Duration
00:40:00
Track
Security
Type of
lecture
Speaker
Ben H
Other Artists
Talk Slug & media link
37c3-11684-rust_binary_analysis_feature_by_feature
English
0.0% Checking done0.0%
0.0% Syncing done0.0%
0.0% Transcribing done0.0%
100.0% Nothing done yet100.0%
  

Work on this video on Amara!

English: Transcribed until

Last revision: 3 months ago