11<template >
22 <div class =" container text-left" >
33 <h1 class =" my-4" >JavaScript Deobfuscator</h1 >
4+
5+ <Alert ref =" alert" ></Alert >
6+
47 <div class =" form-group mb-4 text-left" >
58 <label for =" TargetFuncName" >Target function name</label >
69 <input
710 type =" text"
811 class =" form-control"
912 id =" TargetFuncName"
10- placeholder =" _0x "
13+ placeholder =" _0x1234 "
1114 v-model =" targetName"
1215 />
1316 </div >
1720 class =" form-control"
1821 id =" codeInputTextarea"
1922 rows =" 5"
23+ placeholder =" var _0x14bb=['EMKjwoXCuTB1PsKIbSnDkMKY','RsKLwrHCpQ==','wpPCisOQI ..."
2024 v-model =" mainCode"
2125 ></textarea >
2226 </div >
5256</template >
5357
5458<script >
55- // import Decoder from "@/Decoder.js";
59+ import Analizer from " @/Analizer.js" ;
60+ import Alert from " @/components/Alert.vue" ;
5661
5762export default {
63+ components: {
64+ Alert,
65+ },
66+
5867 data () {
5968 return {
60- decoder : null ,
69+ analizer : null ,
6170 targetName: null ,
6271 mainCode: null ,
6372 outputCode: null ,
@@ -68,26 +77,48 @@ export default {
6877 methods: {
6978 decode () {
7079 this .running = true ;
80+ this .$refs .alert .hide ();
81+
82+ const type = this .analizer .checkType (this .targetName , this .mainCode );
83+ if (! type)
84+ return this .$refs .alert .showAlert (
85+ " danger" ,
86+ " [Error]" ,
87+ " Invalid obfuscation type! Please report to us or try again."
88+ );
89+
7190 this .changeProgress (100 );
91+
7292 this .axios
7393 .post (
7494 " https://us-central1-deobfuscator.cloudfunctions.net/api/request" ,
7595 {
7696 targetName: this .targetName ,
77- code: this .mainCode
97+ code: this .mainCode ,
98+ type,
7899 }
79100 )
80101 .then ((res ) => {
81102 this .running = false ;
82103 // console.log(res);
83104 res .data = res .data .replace (/ \n / g , " " );
84105 this .changeProgress (0 );
106+ this .$refs .alert .showAlert (
107+ " success" ,
108+ " [Success]" ,
109+ " Successfully decoded the code!!"
110+ );
85111 this .outputCode = window .js_beautify (res .data );
86112 })
87113 .catch ((e ) => {
88114 this .running = false ;
89115 this .changeProgress (0 );
90116 console .log (e);
117+ this .$refs .alert .showAlert (
118+ " danger" ,
119+ " [Error]" ,
120+ " Server error! Please check target code and name of target function."
121+ );
91122 });
92123 },
93124 changeProgress (rate ) {
@@ -99,7 +130,7 @@ export default {
99130 },
100131
101132 mounted () {
102- // this.decoder = Decoder ();
133+ this .analizer = Analizer ();
103134 },
104135};
105136 </script >
0 commit comments