Coder Social home page Coder Social logo

jslinux-deobfuscated's Introduction

De-obfuscated JSLinux

I wanted to understand how the amazing JsLinux worked.

I have no idea if he passed it through a minifier or if the code was generated algorithmically from stuff in the QEMU codebase. In any case, it's hard to follow the action as presented originally, let alone extend it to do new tricks.

I hand de-obfuscated the codebase (primarily the core cpu-emulation routines and a bit of the rest as well) while studying it over a few days' time.

In the off-chance someone else might be interested in this code as a basis for further weird in-browser x86 hacking I'm posting this redacted version of the code here.

There is a much more complete, ground-up project to build a 386-style emulator in javascript called jslm32.

Status

It's still a dense code base, it's an emulator of a rather complicated architecture, after all. However this version is nowhere near so incomprehensible as the original. Nearly all of the global variables and function names have been named somewhat sensibly. Many comments have been added.

The core opcode execution loop has been autocommented to indicate what instruction operation the opcode refers to.

ETC

I highly recommend, by the way, the excellent JSShaper library for transforming large javascript code bases. The hacks I made from it are in this repo: a little symbol-name-transformer node.js script and an emacs function for doing this in live buffers.

Caveat Coder

This is a pedagogical/aesthetic reinterpretation of the original JSLinux code Copyright (c) 2011 Fabrice Bellard. It seems to run identically to the original.

References

Some other helpful references for understanding what's going on:

x86

Bit Hacking

Other devices

jslinux-deobfuscated's People

Contributors

danluu avatar levskaya avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.