Version Nichts ist wahr. Alles ist erlaubt.
Lecture: Rust Binary Analysis, Feature by Feature
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.
Info
Day:
2023-12-28
Start time:
17:15
Duration:
00:40
Room:
Saal Zuse
Track:
Security
Language:
en
Links:
Feedback
Click here to let us know how you liked this event.
Concurrent Events
Speakers
Ben H |