Skip to content

Commit

Permalink
Merge pull request #134 from sunnydanu/feat(new-tool)--js-unobfuscator
Browse files Browse the repository at this point in the history
feat(new-tool):-js-unobfuscator
  • Loading branch information
sunnydanu authored Nov 4, 2024
2 parents 087b153 + aafbbaa commit 35bcebd
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 117 deletions.
3 changes: 3 additions & 0 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ declare module '@vue/runtime-core' {
JsonToXml: typeof import('./src/tools/json-to-xml/json-to-xml.vue')['default']
JsonToYaml: typeof import('./src/tools/json-to-yaml-converter/json-to-yaml.vue')['default']
JsonViewer: typeof import('./src/tools/json-viewer/json-viewer.vue')['default']
JsUnobfuscator: typeof import('./src/tools/js-unobfuscator/js-unobfuscator.vue')['default']
JwtParser: typeof import('./src/tools/jwt-parser/jwt-parser.vue')['default']
KeycodeInfo: typeof import('./src/tools/keycode-info/keycode-info.vue')['default']
ListConverter: typeof import('./src/tools/list-converter/list-converter.vue')['default']
Expand Down Expand Up @@ -181,6 +182,8 @@ declare module '@vue/runtime-core' {
NIcon: typeof import('naive-ui')['NIcon']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput']
NInputGroup: typeof import('naive-ui')['NInputGroup']
NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
NInputNumber: typeof import('naive-ui')['NInputNumber']
NLayout: typeof import('naive-ui')['NLayout']
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@
"unplugin-auto-import": "^0.16.4",
"uuid": "^9.0.0",
"vanilla-jsoneditor": "^0.23.8",
"vite-plugin-node-polyfills": "^0.21.0",
"vue": "^3.3.4",
"vue-i18n": "^9.9.1",
"vue-router": "^4.1.6",
"vue-shadow-dom": "^4.2.0",
"vue-tsc": "^1.8.1",
"vuedraggable": "^4.1.0",
"webcrack": "^2.13.0",
"xml-formatter": "^3.3.2",
"xml-js": "^1.6.11",
"yaml": "^2.2.1"
Expand Down
502 changes: 386 additions & 116 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { tool as emailNormalizer } from './email-normalizer';
import { tool as energyComputer } from './energy-computer';
import { tool as peerShare } from './peer-share';
import { tool as macAddressConverter } from './mac-address-converter';
import { tool as jsUnobfuscator } from './js-unobfuscator';

import { tool as asciiTextDrawer } from './ascii-text-drawer';
import { tool as textToUnicode } from './text-to-unicode';
import { tool as gzipConverter } from './gzip-converter';
Expand Down Expand Up @@ -175,6 +177,7 @@ export const toolsByCategory: ToolCategory[] = [
jsonDiff,
safelinkDecoder,
apiTester,
jsUnobfuscator,
],
},
{
Expand Down
12 changes: 12 additions & 0 deletions src/tools/js-unobfuscator/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { BrandJavascript } from '@vicons/tabler';
import { defineTool } from '../tool';

export const tool = defineTool({
name: 'Javascript Unobfuscator/Unpacker',
path: '/js-unobfuscator',
description: 'webcrack is a tool for reverse engineering javascript. It can deobfuscate obfuscator.io, unminify, transpile, and unpack webpack/browserify, to resemble the original source code as much as possible.',
keywords: ['js', 'unobfuscator', 'obfuscator.io', 'unminify', 'transpile', 'unpack', 'webpack', 'browserify'],
component: () => import('./js-unobfuscator.vue'),
icon: BrandJavascript,
createdAt: new Date('2024-05-11'),
});
36 changes: 36 additions & 0 deletions src/tools/js-unobfuscator/js-unobfuscator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script setup lang="ts">
import { webcrack } from 'webcrack';
const input = ref('');
const result = computedAsync(async () => {
try {
return await webcrack(input.value);
}
catch (e: any) {
return {
code: `/*\n${e.toString()}\n*/`,
bundle: '',
};
}
});
</script>

<template>
<CInputText
v-model:value="input"
placeholder="Your obfuscate Javascript code"
label="Obfuscate Javascript code:"
rows="20"
autosize
raw-text
multiline
monospace
/>

<n-form-item label="Deobfuscated code:">
<textarea-copyable :value="result?.code" language="javascript" />
</n-form-item>
<n-form-item label="Bundle:">
<textarea-copyable :value="result?.bundle" language="javascript" />
</n-form-item>
</template>
8 changes: 7 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export default defineConfig({
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: 'icon' })],
}),
Unocss(),
nodePolyfills(),
nodePolyfills({
exclude: ['fs'],
}),
],
base: baseUrl,
resolve: {
Expand All @@ -118,8 +120,12 @@ export default defineConfig({
},
build: {
target: 'esnext',
rollupOptions: {
external: ['./out/isolated_vm'],
},
},
optimizeDeps: {
exclude: ['isolated-vm'],
include: ['pdfjs-dist'], // optionally specify dependency name
esbuildOptions: {
supported: {
Expand Down

0 comments on commit 35bcebd

Please sign in to comment.