{"id":13642995,"url":"https://github.com/ben-sb/javascript-deobfuscator","last_synced_at":"2025-05-15T01:07:46.403Z","repository":{"id":38788415,"uuid":"332583170","full_name":"ben-sb/javascript-deobfuscator","owner":"ben-sb","description":"General purpose JavaScript deobfuscator","archived":false,"fork":false,"pushed_at":"2025-01-26T20:31:09.000Z","size":1560,"stargazers_count":887,"open_issues_count":9,"forks_count":121,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-10T10:05:37.558Z","etag":null,"topics":["deobfuscation","javascript","reverse-engineering"],"latest_commit_sha":null,"homepage":"https://deobfuscate.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben-sb.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-24T23:51:59.000Z","updated_at":"2025-04-09T13:23:44.000Z","dependencies_parsed_at":"2024-04-12T16:48:29.064Z","dependency_job_id":"a9145136-0e5e-44b9-821f-4988d6fbb9c6","html_url":"https://github.com/ben-sb/javascript-deobfuscator","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/ben-sb%2Fjavascript-deobfuscator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjavascript-deobfuscator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjavascript-deobfuscator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjavascript-deobfuscator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben-sb","download_url":"https://codeload.github.com/ben-sb/javascript-deobfuscator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254254041,"owners_count":22039792,"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":["deobfuscation","javascript","reverse-engineering"],"created_at":"2024-08-02T01:01:39.275Z","updated_at":"2025-05-15T01:07:41.368Z","avatar_url":"https://github.com/ben-sb.png","language":"TypeScript","readme":"# General purpose JavaScript deobfuscator\n\nA simple but powerful deobfuscator to remove common JavaScript obfuscation techniques.\nOpen an issue if there is a feature you think should be implemented.\n\nOnline version at [deobfuscate.io](https://deobfuscate.io)\n\nInstall via `npm install js-deobfuscator`\n\nLooking for a deobfuscator specific to Obfuscator.io/javascript-obfuscator? Try [this repo](https://github.com/ben-sb/deobfuscator-io)\n\nIf you would like to discuss/learn about JavaScript obfuscation and deobfuscation you can join the [Discord server](https://discord.com/invite/KQjZx2X28n)\n\n## Features\n\n-   Unpacks arrays containing literals (strings, numbers etc) and replaces all references to them\n-   Removes simple proxy functions (calls to another function), array proxy functions and arithmetic proxy functions (binary expressions)\n-   Simplifies arithmetic expressions\n-   Simplifies string concatenation\n-   Renames unreadable hexadecimal identifiers (e.g. \\_0xca830a)\n-   Converts computed to static member expressions and beautifies the code\n\n## Examples\n\nSee bottom for more complicated example with features chained together.\n\n### Array Unpacking\n\nBefore\n\n```javascript\nconst a = ['\\x20', '\\x57\\x6f\\x72\\x6c\\x64', '\\x48\\x65\\x6c\\x6c\\x6f'];\n\nconsole.log(a[2] + a[0] + a[1]);\n```\n\nAfter\n\n```javascript\nconsole.log('Hello' + ' ' + 'World');\n```\n\n\u003cbr/\u003e\n\n### Proxy Functions\n\n#### An example with simple proxy functions for other functions\n\nBefore\n\n```javascript\nfunction a(b, c) {\n    return someFunction(b, c);\n}\n\nconst result = a(5, 6);\n```\n\nAfter\n\n```javascript\nconst result = someFunction(5, 6);\n```\n\n\u003cbr/\u003e\n\n#### An example with proxy functions for arithmetic\n\nBefore\n\n```javascript\nfunction a(b, c) {\n    return c + 2 * b;\n}\n\nconst result = a(5, 6);\n```\n\nAfter\n\n```javascript\nconst result = 6 + 2 * 5;\n```\n\n\u003cbr/\u003e\n\n#### An example with chained proxy functions\n\nBefore\n\n```javascript\nfunction a(b, c) {\n    return c + 2 * b;\n}\nfunction b(c, d) {\n    return a(c, d);\n}\nfunction c(d, e) {\n    return b(d, e);\n}\n\nconst result = c(5, 6);\n```\n\nAfter\n\n```javascript\nconst result = 6 + 2 * 5;\n```\n\n\u003cbr/\u003e\n\n### Expression Simplification\n\n#### An example with numbers\n\nBefore\n\n```javascript\nlet total = 0x2 * 0x109e + -0xc * -0x16a + -0x3234;\nfor (let i = 0x1196 + 0x97b * 0x3 + -0x2e07; i \u003c -0x95 * -0x38 + -0x1a75 + -0x619; i++) {\n    total += i;\n}\n```\n\nAfter\n\n```javascript\nlet total = 0;\nfor (let i = 0; i \u003c 10; i++) {\n    total += i;\n}\n```\n\n\u003cbr/\u003e\n\n#### An example with strings.\n\nBefore\n\n```javascript\nconsole.log('He' + 'll' + 'o' + ' Wo' + 'r' + 'ld');\n```\n\nAfter\n\n```javascript\nconsole.log('Hello World');\n```\n\n\u003cbr/\u003e\n\n### Overall Example\n\nAll these features can be chained together to simplify code.\n\nBefore\n\n```javascript\nconst ar = [\n    '\\x48\\x65\\x6c\\x6c\\x6f',\n    0x95,\n    '\\x20',\n    0x1a75,\n    '\\x57\\x6f\\x72\\x6c\\x64',\n    -0x53,\n    '\\x6c\\x6f\\x67'\n];\nconst a = function (b, c) {\n        return c + 2 * b;\n    },\n    b = function (c, d) {\n        return a(c, d);\n    },\n    c = function (d, e) {\n        return b(d, e);\n    };\nconst message = ar[0] + ar[2] + ar[4];\nconst result = c(ar[1] * 0x38 + ar[3] + 0x619, 0x12 * ar[5] + 0x1a13 + 0x621);\nconsole[ar[6]](message + ' ' + result);\n```\n\nAfter\n\n```javascript\nconst message = 'Hello World';\nconst result = 40106;\nconsole.log(message + ' ' + result);\n```\n\n## Config\n\n```typescript\ninterface Config {\n    verbose: boolean;\n    isModule: boolean;\n    arrays: {\n        unpackArrays: boolean;\n        removeArrays: boolean;\n    };\n    proxyFunctions: {\n        replaceProxyFunctions: boolean;\n        removeProxyFunctions: boolean;\n    };\n    expressions: {\n        simplifyExpressions: boolean;\n        removeDeadBranches: boolean;\n    };\n    miscellaneous: {\n        beautify: boolean;\n        simplifyProperties: boolean;\n        renameHexIdentifiers: boolean;\n    };\n}\n```\n\n## To Run\n\nEither install the module locally via `npm install js-deobfuscator` and import as usual or install globally `npm install -g js-deobfuscator` and use the `js-deobfuscator` CLI:\n\n```shell\n\u003e js-deobfuscator -h\nUsage: js-deobfuscator [options]\n\nDeobfuscate a javascript file\n\nOptions:\n  -i, --input [input_file]    The input file to deobfuscate (default: \"input/source.js\")\n  -o, --output [output_file]  The deobfuscated output file (default: \"output/output.js\")\n  -m, --module                Parse an ESModule\n  -h, --help                  display help for command\n```\n\nAlternatively use the online version at [deobfuscate.io](https://deobfuscate.io)\n","funding_links":[],"categories":["TypeScript","Security"],"sub_categories":["Video"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-sb%2Fjavascript-deobfuscator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben-sb%2Fjavascript-deobfuscator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-sb%2Fjavascript-deobfuscator/lists"}