-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
785 additions
and
915 deletions.
There are no files selected for viewing
134 changes: 0 additions & 134 deletions
134
packages/deobfuscate/test/__snapshots__/deobfuscate.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
159 changes: 0 additions & 159 deletions
159
packages/deobfuscate/test/__snapshots__/deobfuscator.test.ts.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { readFile, readdir } from 'fs/promises'; | ||
import { join } from 'node:path'; | ||
import { describe, test } from 'vitest'; | ||
import { webcrack } from '../../webcrack/src/index'; | ||
|
||
const SAMPLES_DIR = join(__dirname, 'samples'); | ||
|
||
describe('samples', async () => { | ||
const fileNames = (await readdir(SAMPLES_DIR)).filter((name) => | ||
name.endsWith('.js'), | ||
); | ||
|
||
fileNames.forEach((fileName) => { | ||
test.concurrent(`deobfuscate ${fileName}`, async ({ expect }) => { | ||
const code = await readFile(join(SAMPLES_DIR, fileName), 'utf8'); | ||
const result = await webcrack(code); | ||
|
||
await expect(result.code).toMatchFileSnapshot( | ||
join(SAMPLES_DIR, fileName + '.snap'), | ||
); | ||
}); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
packages/deobfuscate/test/samples/obfuscator.io-calls-transform.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function foo() { | ||
var c = "string1"; | ||
var d = "string2"; | ||
var e = "string3"; | ||
var f = "string4"; | ||
var g = "string5"; | ||
var h = "string6"; | ||
} | ||
console.log(foo()); |
8 changes: 8 additions & 0 deletions
8
packages/deobfuscate/test/samples/obfuscator.io-control-flow-keys.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function hi() { | ||
const _0x46643e = 1; | ||
const _0x4d295f = 2; | ||
if (_0x46643e < _0x4d295f) { | ||
console.log("Hello World!"); | ||
} | ||
} | ||
hi(); |
8 changes: 8 additions & 0 deletions
8
packages/deobfuscate/test/samples/obfuscator.io-control-flow-partial-keys.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function hi() { | ||
const _0x46643e = 1; | ||
const _0x4d295f = 2; | ||
if (_0x46643e < _0x4d295f) { | ||
console.log("Hello World!"); | ||
} | ||
} | ||
hi(); |
8 changes: 8 additions & 0 deletions
8
packages/deobfuscate/test/samples/obfuscator.io-control-flow-split-strings.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function _0x225c6a() { | ||
console.log("Hello World!"); | ||
console.log("Hello World!"); | ||
console.log("Hello World!"); | ||
console.log("Hello World!"); | ||
console.log("Hello World!"); | ||
} | ||
_0x225c6a(); |
Oops, something went wrong.