• Home
  • Search
  • Polymorphic type inference for machine code
  • Cite Icon10
  • https://doi.org/10.1145/2980983.2908119Copy DOI Icon

Polymorphic type inference for machine code

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

For many compiled languages, source-level types are erased very early in the compilation process. As a result, further compiler passes may convert type-safe source into type-unsafe machine code. Type-unsafe idioms in the original source and type-unsafe optimizations mean that type information in a stripped binary is essentially nonexistent. The problem of recovering high-level types by performing type inference over stripped machine code is called type reconstruction, and offers a useful capability in support of reverse engineering and decompilation. In this paper, we motivate and develop a novel type system and algorithm for machine-code type inference. The features of this type system were developed by surveying a wide collection of common source- and machine-code idioms, building a catalog of challenging cases for type reconstruction. We found that these idioms place a sophisticated set of requirements on the type system, inducing features such as recursively-constrained polymorphic types. Many of the features we identify are often seen only in expressive and powerful type systems used by high-level functional languages. Using these type-system features as a guideline, we have developed Retypd: a novel static type-inference algorithm for machine code that supports recursive types, polymorphism, and subtyping. Retypd yields more accurate inferred types than existing algorithms, while also enabling new capabilities such as reconstruction of pointer const annotations with 98% recall. Retypd can operate on weaker program representations than the current state of the art, removing the need for high-quality points-to information that may be impractical to compute.

Similar Papers
  • Conference Article
  • Citations30

Polymorphic type inference for machine code

  • Jun 02, 2016
  • Matt Noonan +2
  • Book Chapter

Type Inference in Java: Characteristics and Limitations

  • Jan 01, 2021
  • Neha Kumari +1
  • Conference Article
  • Citations21

Type inference for datalog and its application to query optimisation

  • Jun 09, 2008
  • Oege De Moor +3
  • Research Article

From ML type inference to stratified type inference

  • Sep 12, 2005
  • ACM SIGPLAN Notices
  • François Pottier
  • Conference Article
  • Citations1

Type-based Enforcement of Infinitary Trace Properties for Java

  • Sep 06, 2021
  • Serdar Erbatur +2
  • Conference Article
  • Citations14

Polymorphic type inference for scripting languages with object extensions

  • Oct 24, 2011
  • Tian Zhao
  • Conference Article
  • Citations412

Refinement types for ML

  • Jan 01, 1991
  • Tim Freeman +1
  • Research Article
  • Citations3

Relating typability and expressiveness in finite-rank intersection type systems (extended abstract)

  • Sep 01, 1999
  • ACM SIGPLAN Notices
  • Assaf J Kfoury +3
  • Research Article

Type inference, principal typings, and let-polymorphism for first-class mixin modules

  • Sep 12, 2005
  • ACM SIGPLAN Notices
  • Henning Makholm +1
  • Book Chapter
  • Citations26

On the Unification of Substitutions in Type Inference

  • Jan 01, 1999
  • Bruce J Mcadam
  • Conference Article
  • Citations42

Type inference for COBOL systems

  • Oct 12, 1998
  • A Van Deursen +1
  • Conference Article
  • Citations10

From ML to ML F

  • Sep 20, 2008
  • Didier Rémy +1
  • Book Chapter
  • Citations227

Towards Type Inference for JavaScript

  • Jan 01, 2005
  • Christopher Anderson +2
  • Conference Article

On Synergies between Type Inference, Generation and Normalization of SK-Combinator Trees

  • Sep 01, 2015
  • Paul Tarau
  • Book Chapter
  • Citations36

Practical Optional Types for Clojure

  • Jan 01, 2016
  • Ambrose Bonnaire-Sergeant +2
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.