• Refine Query
  • Source
  • Publication year
  • to
  • Language
  • 1
  • Tagged with
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • About
  • The Global ETD Search service is a free service for researchers to find electronic theses and dissertations. This service is provided by the Networked Digital Library of Theses and Dissertations.
    Our metadata is collected from universities around the world. If you manage a university/consortium/country archive and want to be added, details can be found on the NDLTD website.
1

Decompilation of WebAssembly using Datalog / Dekompilering av WebAssembly i Datalog

Brandefelt, Love January 2022 (has links)
With 92% of today’s browsers supporting WebAssembly the need for decompilers to discover malicious code is greater than ever. The introduction of the Datalog to C++ compiler Soufflé, in 2016, enables the implementation of effective Datalog-based decompilers. This thesis investigates if a Datalogbased approach to decompilation can be used to implement a WebAssembly decompiler. Such a decompiler is implemented and then evaluated in terms of decompilability, recompilabilty and semantic equivalence using randomly generated programs of various complexity. Each generated program is first decompiled, then recompiled if the decompilation was successful, and finally executed if the recompilation was successful. The results showed that the implementation can decompile all generated programs and that most of the decompiled programs are recompilable. However, only 70% of the lowest complexity programs maintained the output of the original program. As the complexity increased this percentage fell below 20%, a result of more complex programs being more likely to contain code structures that are not handled correctly. If the similarity of the decompiled programs were instead measured by recompiling the decompiled programs to WebAssembly and observing the number of instructions differing from the original WebAssembly binary the percentages were slightly more satisfying with the percentage of instructions differing ranging from 25% for the lowest complexity programs to 65% for the highest complexity programs. While the results are not distinct enough to draw the conclusion that a Datalog-based approach to decompilation is suitable for implementing a WebAssembly decompiler they instigate the need for further research on the topic, e.g. by supporting more WebAssembly instructions as well as supporting WebAssembly binaries compiled from other languages than C. / Idag stödjer 92% av alla webbläsare WebAssembly och behovet av dekompilatorer för att upptäcka skadlig kod är större än någonsin. Datalog-kompilatorn Soufflé som introducerades 2016 gjorde det möjligt att implementera effektiva Datalog-baserade dekompilatorer. Detta arbete undersöker om en Datalogbaserad dekompilator kan användas för att implementera en WebAssemblydekompilator. Detta genomförs genom att en Datalog-baserad WebAssemblydekompilator implementeras och sedan utvärderas i termer av dekompilerbarhet, återkompilerbarhet och semantisk ekvivalens med hjälp av slumpmässigt genererade program av varierande komplexitet. Varje genererat program dekompileras och kompileras sedan igen för att slutligen exekveras. Resultaten visade att dekompilatorn kunde dekompilera alla genererade program och att de flesta av de dekompilerade programmen var omkompilerbara. Däremot gav endast 70% av programmen med lägst komplexitet samma utdata som respektive ursprungsprogram. När komplexiteten ökade sjönk denna procentsats till under 20%, en följd av att program av en högre komplexitet i högre grad innehåller kodstrukturer som hanteras felaktigt. Om likheten mellan de dekompilerade programmen istället mättes genom att kompilera om de dekompilerade programmen till WebAssembly och titta på antalet instruktioner som skiljer sig från den ursprungliga WebAssembly-binären var resultaten något mer tillfredsställande med endast 25%’s skillnad för programmen med lägst komplexitet upp till 65%’s skillnad för programmen med högst komplexitet. Trots att resultaten inte är tillräckligt tydliga för att dra slutsatsen att en Datalog-baserad dekompilator är lämplig för att implementera en WebAssembly-dekompilator, tydliggör de behovet av vidare forskning på ämnet, t.ex genom att stödja fler WebAssembly-instruktioner samt genom att stödja WebAssembly-binärer kompilerade från andra språk än C.

Page generated in 0.0469 seconds