Simple manager para usb
#!usr/bin/perl
#USB Manager 0.2
#Coded By Doddy H
use Cwd;
head();
nave:
chomp(my $rta = <stdin>); if ($rta=~/list/) {
my @files = coleccionar(getcwd());
for(@files) {
if (-f $_) {
print "[File] : ".$_."\n"; } else {
print "[Directory] : ".$_."\n"; }}}
if ($rta=~/show (.*)/) {
my $fu = $1;
if (-f $fu or -d $fu) {
hideit($fu,"show");
print "\n\n[+] Attributes changed\n\n"; }
}
if ($rta=~/hide (.*)/) {
my $fua = $1;
if (-f $fua or -d $fua) {
hideit($fua,"hide");
print "\n\n[+] Attributes changed\n\n"; }
}
if ($rta=~/cd (.*)/) {
my $dir = $1;
print "\n[+] Directory changed\n"; } else {
}}
if ($rta=~/del (.*)/) {
my $file = getcwd()."/".$1;
if (-f $file) {
print "\n[+] File Deleted\n"; } else {
}
} else {
print "\n[+] Directory Deleted\n"; } else {
}}}
if ($rta=~/rename (.*) (.*)/) { if (rename(getcwd
()."/".$1,getcwd
()."/".$2)) { print "\n[+] File Changed\n"; } else {
}}
my $file = $1;
#system(getcwd()."/".$file);
}
if ($rta=~/help/) {
print "\nCommands : help cd list del rename open hide show exit\n\n"; }
copyright();
}
sub coleccionar {
}
sub hideit {
use Win32::File;
if ($_[1] eq "show") {
Win32::File::SetAttributes($_[0],NORMAL);
}
elsif ($_[1] eq "hide") {
Win32::File::SetAttributes($_[0],HIDDEN);
}
else {
}
}
sub head {
print "\n\n-- == USB Manager == --\n"; }
sub copyright {
print "\n\n(C) Doddy Hackman 2011\n\n"; }
# The End ?