{"id":13511933,"url":"https://github.com/levskaya/jslinux-deobfuscated","last_synced_at":"2025-04-12T23:40:47.234Z","repository":{"id":2102275,"uuid":"3043468","full_name":"levskaya/jslinux-deobfuscated","owner":"levskaya","description":"An old version of Mr. Bellard's JSLinux rewritten to be human readable, hand deobfuscated and annotated.","archived":false,"fork":false,"pushed_at":"2019-01-15T05:50:57.000Z","size":2165,"stargazers_count":1049,"open_issues_count":0,"forks_count":146,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-04-12T23:40:03.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levskaya.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-24T03:16:37.000Z","updated_at":"2025-04-07T17:43:24.000Z","dependencies_parsed_at":"2022-09-25T02:41:08.085Z","dependency_job_id":null,"html_url":"https://github.com/levskaya/jslinux-deobfuscated","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levskaya%2Fjslinux-deobfuscated","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levskaya%2Fjslinux-deobfuscated/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levskaya%2Fjslinux-deobfuscated/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levskaya%2Fjslinux-deobfuscated/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levskaya","download_url":"https://codeload.github.com/levskaya/jslinux-deobfuscated/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647254,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T03:01:20.133Z","updated_at":"2025-04-12T23:40:47.204Z","avatar_url":"https://github.com/levskaya.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","\u003ca id=\"1d9dec1320a5d774dc8e0e7604edfcd3\"\u003e\u003c/a\u003e工具-新添加的"],"sub_categories":["\u003ca id=\"8f1b9c5c2737493524809684b934d49a\"\u003e\u003c/a\u003e文章\u0026\u0026视频"],"readme":"De-obfuscated JSLinux\n=========================================================\n\nThis repo corresponds to a very old version of jslinux, Mr. Bellard \ncurrently uses an emscripten converted emulator for the current jslinux.\n\nThere are better emulator codebases out there for pedagogical use!\n\nI highly recommend checking out another open-source x86 emulation\nproject that includes vga support, \"v86\" ([demo][6] / [source][7]).\nThere's yet another open-source 386-style emulator in javascript\ncalled [jslm32][3].\n\nFor a simpler RISC architecture, take a look at the linux on\n[jor1k][5] emulator project.\n\nFinally, the [Angel][8] emulator ([source][9]) shows off the elegant\nopen-ISA 64bit [RISC-V][10] architecture that is being brought to\nsilicon by the [lowrisc][11] team.  This is by far the cleanest\narchitecture for studying general low-level hardware and operating\nsystem implementation details.\n\n### History\nI wanted to understand how the amazing [JsLinux][1] worked, so in a\nfit of mania I hand de-obfuscated the codebase while studying it over\na few days' time.  In the off-chance someone else might be interested\nin this code as a basis for further weird in-browser x86 hacking I\nposted this redacted version of the code here, with permission of\nMr. Bellard.\n\n### Status\n\nThe current codebase should run on most modern versions of Chrome,\nSafari, and Firefox.  If you're running it locally, you will need to\nload it via a local server to allow the XHR requests to load the\nbinaries.\n\njslinux-deobfuscated is still a dense, messy code base from any\npedagogic point of view.  However for those interested in\nMr. Bellard's code, this version is nowhere near so incomprehensible\nas the original.  Nearly all of the global variables and function\nnames have been named somewhat sensibly.  Many pointers to references\nhave been added to the source.\n\nThe core opcode execution loop has been commented to indicate what\ninstruction the opcode refers to.\n\n### Unresolved\n\nOne mystery is, why does CPUID(1) return 8 \u003c\u003c 8 in EBX? EBX[15:8] is\nnow used to indicate CLFLUSH line size, but that field must have been\nused for something else in the past.\n\nThe CALL/RET/INT/IRET routines are still quite confused and haven't\nyet been rewritten.  The code dealing with segmentation, and some of\nthe code for real-mode remains relatively messy.\n\nAny recommendations / clarifications are welcome!\n\n### ETC\n\nI highly recommend, by the way, the excellent [JSShaper][2] library\nfor transforming large javascript code bases.  The hacks I made from\nit are in this repo: a little symbol-name-transformer node.js script\nand an emacs function for doing this in live buffers.\n\n### License\n\nThis is a pedagogical/aesthetic derivative of the original JSLinux\ncode Copyright (c) 2011-2014 Fabrice Bellard.  It is posted here with\npermission of the original author subject to his original\nconstraints : Redistribution or commercial use is prohibited without\nthe (original) author's permission.\n\n### References\nSome other helpful references for understanding what's going on:\n\n#### x86\n- http://pdos.csail.mit.edu/6.828/2010/readings/i386/toc.htm\n- http://pdos.csail.mit.edu/6.828/2010/readings/i386.pdf (PDF of above)\n- http://ref.x86asm.net/coder32.html\n- http://www.sandpile.org/\n- http://en.wikibooks.org/wiki/X86_Assembly/X86_Architecture\n- http://en.wikipedia.org/wiki/X86\n- http://en.wikipedia.org/wiki/Control_register\n- http://en.wikipedia.org/wiki/X86_assembly_language\n- http://en.wikipedia.org/wiki/Translation_lookaside_buffer\n\n#### Bit Hacking\n- http://graphics.stanford.edu/~seander/bithacks.html\n\n#### Other devices\n- http://en.wikibooks.org/wiki/Serial_Programming/8250_UART_Programming\n\n[1]: http://bellard.org/jslinux/tech.html\n[2]: http://jsshaper.org\n[3]: https://github.com/ubercomp/jslm32\n[4]: https://bugs.webkit.org/show_bug.cgi?id=72154\n[5]: https://github.com/s-macke/jor1k\n[6]: http://copy.sh/v86/\n[7]: https://github.com/copy/v86\n[8]: http://riscv.org/angel/\n[9]: https://github.com/ucb-bar/riscv-angel\n[10]: http://riscv.org/\n[11]: http://www.lowrisc.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevskaya%2Fjslinux-deobfuscated","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevskaya%2Fjslinux-deobfuscated","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevskaya%2Fjslinux-deobfuscated/lists"}