{"title":"The Incredible Shrinking Context... in a decompiler near you","authors":"Sifis Lagouvardos, Yannis Bollanos, Neville Grech, Yannis Smaragdakis","doi":"arxiv-2409.11157","DOIUrl":null,"url":null,"abstract":"Decompilation of binary code has arisen as a highly-important application in\nthe space of Ethereum VM (EVM) smart contracts. Major new decompilers appear\nnearly every year and attain popularity, for a multitude of reverse-engineering\nor tool-building purposes. Technically, the problem is fundamental: it consists\nof recovering high-level control flow from a highly-optimized\ncontinuation-passing-style (CPS) representation. Architecturally, decompilers\ncan be built using either static analysis or symbolic execution techniques. We present Shrknr, a static-analysis-based decompiler succeeding the\nstate-of-the-art Elipmoc decompiler. Shrknr manages to achieve drastic\nimprovements relative to the state of the art, in all significant dimensions:\nscalability, completeness, precision. Chief among the techniques employed is a\nnew variant of static analysis context: shrinking context sensitivity.\nShrinking context sensitivity performs deep cuts in the static analysis\ncontext, eagerly \"forgetting\" control-flow history, in order to leave room for\nfurther precise reasoning. We compare Shrnkr to state-of-the-art decompilers, both static-analysis- and\nsymbolic-execution-based. In a standard benchmark set, Shrnkr scales to over\n99.5% of contracts (compared to ~95%), covers (i.e., reaches and manages to\ndecompile) 67% more code, and reduces key imprecision metrics by over 65%.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":"10 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Programming Languages","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.11157","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Decompilation of binary code has arisen as a highly-important application in
the space of Ethereum VM (EVM) smart contracts. Major new decompilers appear
nearly every year and attain popularity, for a multitude of reverse-engineering
or tool-building purposes. Technically, the problem is fundamental: it consists
of recovering high-level control flow from a highly-optimized
continuation-passing-style (CPS) representation. Architecturally, decompilers
can be built using either static analysis or symbolic execution techniques. We present Shrknr, a static-analysis-based decompiler succeeding the
state-of-the-art Elipmoc decompiler. Shrknr manages to achieve drastic
improvements relative to the state of the art, in all significant dimensions:
scalability, completeness, precision. Chief among the techniques employed is a
new variant of static analysis context: shrinking context sensitivity.
Shrinking context sensitivity performs deep cuts in the static analysis
context, eagerly "forgetting" control-flow history, in order to leave room for
further precise reasoning. We compare Shrnkr to state-of-the-art decompilers, both static-analysis- and
symbolic-execution-based. In a standard benchmark set, Shrnkr scales to over
99.5% of contracts (compared to ~95%), covers (i.e., reaches and manages to
decompile) 67% more code, and reduces key imprecision metrics by over 65%.