| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# |
|
2
|
|
|
|
|
|
|
# $Id$ |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
# file::javascript Brik |
|
5
|
|
|
|
|
|
|
# |
|
6
|
|
|
|
|
|
|
package Metabrik::File::Javascript; |
|
7
|
1
|
|
|
1
|
|
670
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
28
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
28
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(Metabrik::String::Javascript); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
499
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
|
13
|
|
|
|
|
|
|
return { |
|
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
|
15
|
|
|
|
|
|
|
tags => [ qw(unstable) ], |
|
16
|
|
|
|
|
|
|
author => 'GomoR ', |
|
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
|
18
|
|
|
|
|
|
|
commands => { |
|
19
|
|
|
|
|
|
|
eval => [ qw(file_js) ], |
|
20
|
|
|
|
|
|
|
deobfuscate => [ qw(file_js) ], |
|
21
|
|
|
|
|
|
|
}, |
|
22
|
|
|
|
|
|
|
}; |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub eval { |
|
26
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
27
|
0
|
|
|
|
|
|
my ($file) = @_; |
|
28
|
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('eval', $file) or return; |
|
30
|
0
|
0
|
|
|
|
|
$self->brik_help_run_file_not_found('eval', $file) or return; |
|
31
|
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
my $fr = Metabrik::File::Raw->new_from_brik_init($self) or return; |
|
33
|
0
|
|
|
|
|
|
$fr->encoding('ascii'); |
|
34
|
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
|
|
|
my $js = $fr->read($file) or return; |
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $self->SUPER::eval($js); |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub deobfuscate { |
|
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
|
42
|
0
|
|
|
|
|
|
my ($file) = @_; |
|
43
|
|
|
|
|
|
|
|
|
44
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('deobfuscate', $file) or return; |
|
45
|
0
|
0
|
|
|
|
|
$self->brik_help_run_file_not_found('deobfuscate', $file) or return; |
|
46
|
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
my $fr = Metabrik::File::Raw->new_from_brik_init($self) or return; |
|
48
|
0
|
|
|
|
|
|
$fr->encoding('ascii'); |
|
49
|
|
|
|
|
|
|
|
|
50
|
0
|
0
|
|
|
|
|
my $js = $fr->read($file) or return; |
|
51
|
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return $self->SUPER::deobfuscate($js); |
|
53
|
|
|
|
|
|
|
} |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
__END__ |