-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazazelkiller.pl
70 lines (65 loc) · 1.18 KB
/
azazelkiller.pl
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
#!/usr/bin/perl
use strict;
use warnings;
local $/ = undef;
my $key;
#here be dragons
sub main ()
{
&unpackxor(&readin(&arguments));
#lol
exit();
}
sub arguments ()
{
if (@ARGV == 1 || @ARGV == 2) {
if (-f $ARGV[0]) {
$key = $ARGV[1];
if (@ARGV == 1) {
$key = "0xfe";
}
return $ARGV[0];
}
else {
print ("The file specified doesn't exist.\n");
exit ();
}
}
else {
print "Supply an absolute path to a file and optionally an 0x XOR key.\nThanks.\n";
exit();
}
}
sub readin ()
{
open FILE, $_[0] or die("File exists, but we can't read it. Dying");
binmode FILE;
my $t = unpack("H*",<FILE>);
close FILE;
if ($t eq "") {
print "Empty file.\n";
exit();
}
return $t;
}
sub unpackxor ()
{
my ($bbb) = $_[0] =~ m/73696e2e00(.*?)ffff/;
if ($bbb eq "") {
print "This isn't azazel!\n";
exit();
}
my @baa = split(/00/, $bbb);
foreach my $baa(@baa) {
my @hex = unpack("(A2)*",$baa);
foreach my $hex(@hex)
{
$hex = chr(hex($hex) ^ hex($key));
if ($hex =~ m/[a-zA-Z0-9]/ || $hex eq "=" || $hex eq "."|| $hex eq "/" || $hex eq "_" ) {
print "$hex";
}
}
print "\n";
}
}
&main ();