updated readme

This commit is contained in:
Anselm Levskaya 2011-12-25 06:40:57 -08:00
parent 85304bd7cc
commit 0ba7c3b259

View File

@ -1,30 +1,40 @@
Fabrix - (De-obfuscated) JSLinux De-obfuscated JSLinux
========================================================= =========================================================
I wanted to understand how the amazing [JsLinux][1] worked. However, Mr Bellard seems to have applied a decidedly french proclivity towards obfuscatory algorithmic prose, replete with two-letter variable names and the like... ;) 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 wanted to understand how the amazing [JsLinux][1] worked.
So in order to better understand the code, I started transforming all the symbols and commenting it up, which isn't all that hard a thing to do given that it's been built to imitate a very well-specified piece of hardware. However, Mr Bellard seems to have applied a decidedly french proclivity towards obfuscatory algorithmic prose, replete with two-letter variable names and the like... ;) 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 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. basis for further weird in-browser x86 hacking I'm posting this
redacted version of the code here.
### Status ### Status
It's still a dense code base, it's an emulator of a rather It's still a dense code base, it's an emulator of a rather
complicated architecture, after all. However this version is nowhere complicated architecture, after all. However this version is nowhere
near so incomprehensible as the original. Nearly all of the variables near so incomprehensible as the original. Nearly all of the global variables
and function names have been named somewhat sensibly. It's been and function names have been named somewhat sensibly. Many comments
heavily commented. It's all still a bit hectic, but readable. have been added.
The core opcode execution loop has been autocommented to indicate what instruction operation the opcode refers to. The core opcode execution loop has been autocommented to indicate what
instruction operation the opcode refers to.
Everything but the flow-control (JMP CALL RET) routines is fairly
comprehensible. There's still some unnamed functions there as I
haven't worked out exactly what's going on.
### ETC
I highly recommend, by the way, the excellent [JSShaper][2] 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. I highly recommend, by the way, the excellent [JSShaper][2] 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 ### Caveat Coder
This is a pedagogical reinterpretation of the original JSLinux code Copyright (c) 2011 Fabrice Bellard. This is a pedagogical/aesthetic reinterpretation of the original
JSLinux code Copyright (c) 2011 Fabrice Bellard. It seems to run
There's no alteration in the algorithmic content. I do check that identically to the original.
that it still runs as the original.
### References ### References
Some other helpful references for understanding what's going on: Some other helpful references for understanding what's going on: