FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bytecode-viewer/plugins/example/ExampleStringDecrypter.js at master · pythonzz/bytecode-viewer · GitHub
pythonzz
bytecode-viewer
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
bytecode-viewer
/
plugins
/
example
/
ExampleStringDecrypter.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
75 lines (62 loc) · 2.87 KB
Breadcrumbs
bytecode-viewer
/
plugins
/
example
/
ExampleStringDecrypter.js
Copy path
File metadata and controls
75 lines (62 loc) · 2.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* This is an example of a string decrypter plugin
*/
var
PluginConsole
=
Java
.
type
(
"the.bytecode.club.bytecodeviewer.api.PluginConsole"
)
;
var
MultipleChoiceDialog
=
Java
.
type
(
"the.bytecode.club.bytecodeviewer.gui.components.MultipleChoiceDialog"
)
var
BytecodeViewer
=
Java
.
type
(
"the.bytecode.club.bytecodeviewer.api.BCV"
)
var
dialog
=
new
MultipleChoiceDialog
(
"Bytecode Viewer - WARNING"
,
"WARNING: This will load the classes into the JVM and execute the initialize function"
+
"\nfor each class. IF THE FILE YOU'RE LOADING IS MALICIOUS, DO NOT CONTINUE."
,
[
"Continue"
,
"Cancel"
]
)
;
var
gui
;
function
execute
(
classNodeList
)
{
gui
=
new
PluginConsole
(
"Skeleton"
)
;
if
(
dialog
.
promptChoice
(
)
==
0
)
{
var
needsWarning
=
false
;
for
(
cnIndex
=
0
;
cnIndex
<
classNodeList
.
length
;
cnIndex
++
)
{
try
{
var
cn
=
classNodeList
[
cnIndex
]
;
var
fields
=
cn
.
fields
.
toArray
(
)
;
//load the class node into the classloader
BytecodeViewer
.
loadClassIntoClassLoader
(
cn
)
;
for
(
fieldIndex
=
0
;
fieldIndex
<
fields
.
length
;
fieldIndex
++
)
{
var
field
=
fields
[
fieldIndex
]
;
//if the class contains the field z, get the class object from the class node
//then print out the value of the fields inside the class
//if the strings get decrypted on init, this allows you to dump the current values
if
(
field
.
name
.
equals
(
"z"
)
)
{
// && f.desc.equals("([Ljava/lang/String;)V")) {
try
{
var
loadedClass
=
BytecodeViewer
.
getClassNodeLoader
(
)
.
nodeToClass
(
cn
)
;
var
reflectedFields
=
loadedClass
.
getFields
(
)
;
for
(
reflectedFieldIndex
=
0
;
reflectedFieldIndex
<
reflectedFields
.
length
;
reflectedFieldIndex
++
)
{
var
reflectedField
=
reflectedFields
[
fieldIndex
]
;
var
s
=
reflectedField
.
get
(
null
)
;
if
(
s
!=
null
&&
!
s
.
empty
(
)
)
gui
.
appendText
(
cn
+
"->"
+
s
)
;
}
}
catch
(
e
)
{
}
}
}
}
catch
(
e
)
{
gui
.
appendText
(
"Failed loading class "
+
cn
.
getName
(
)
)
;
e
.
printStackTrace
(
)
;
needsWarning
=
true
;
}
}
if
(
needsWarning
)
{
BytecodeViewer
.
showMessage
(
"Some classes failed to decrypt, if you'd like to decrypt all of them"
+
nl
+
"makes sure you include ALL the libraries it requires."
)
;
}
gui
.
setVisible
(
true
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL