| 
#!/bin/perl 
 
local $JOS = "DOS"; 
local $JMJSDES = "/home/jmjs/fcdes/bin/jmjsdes"; 
if($JOS eq "DOS") { 
        $JMJSDES = "C:\\fcdes\\bin\\jmjsdes.exe"; 
} 
 
local @IDXLIST = (); 
 
print "Input user id:"; local $jmjsid=<STDIN>; chop($jmjsid); 
print "Input log password:"; local $jmjstpass=<STDIN>; chop($jmjstpass); 
system("cls"); 
 
my $inkey=""; 
&read_index(); 
do { 
        if(        $inkey =~ /^[\s\n]*$/) { } 
        elsif(        $inkey =~ /^[0-9]/i ) { &view($inkey);} 
        elsif(        $inkey =~ /^index/i ) { &read_index();} 
        elsif(        $inkey =~ /^find/i ) { &find_list($inkey);} 
        elsif(        $inkey =~ /^jdec/i ) { &read_file($inkey);} 
        elsif(        $inkey =~ /^jenc/i ) { &read_file($inkey);} 
        elsif(        $inkey =~ /^jevi/i ) { &read_file($inkey);} 
        elsif(        $inkey =~ /^jexp/i ) { &read_file($inkey);} 
        elsif(        $inkey =~ /^jvi/i  ) { &read_file($inkey);} 
        else {        system("$inkey");} 
        print "[index,find,jdec,jenc,jexp,jvi]Pro>"; 
        $inkey=<STDIN>; 
        chop($inkey); 
} while($inkey!~/^[qx¤²¤¼]/); 
 
sub read_index { 
        @IDXLIST = (); 
        &jdecode("index.pro","index.txt"); 
        open(IDX,"index.txt"); 
        @IDXLIST=<IDX>; 
        close(IDX); 
        #system("del /q /s /f index.txt"); 
        system("del index.txt"); 
} 
 
sub view { 
        my ($comline) = @_; 
        my @nums = split(/[\s\n]/,$comline); 
        &jdecode("$nums[0].pro","0.jpg"); 
        system("C:\\Program Files\\HoneyView2\\HoneyView.exe","0.jpg"); 
        system("del /q /s /f 0.jpg"); 
} 
 
sub find_list { 
        my ($comline) = @_; 
        $comline =~ s/^[\s]+//g; 
        my @coms = split(/[\s\n]/,$comline); 
        shift(@coms); 
        foreach $aline (@IDXLIST) { 
                my $flag = 1; 
                foreach $acom (@coms) { 
                        if($aline !~ /$acom/) { 
                                $flag = 0; 
                        } 
                } 
                if($flag) { 
                        print $aline; 
                } 
        } 
} 
 
sub read_file { 
        my ($inkey) = @_; 
        my @cmd = split(/[\s]+/,$inkey); 
        if(   $cmd[0] =~ /^jdec/i) { 
                &jdecode($cmd[1],$cmd[2]); 
        } 
        elsif($cmd[0] =~ /^jenc/i) { 
                &jencode($cmd[1],$cmd[2]); 
        } 
        elsif($cmd[0] =~ /^jevi/i) { 
                &jdecode($cmd[1],$cmd[2]); 
                 system("\"C:\\Program Files\\Ulead Systems\\Ulead Photo Explorer 7.0\\eViewer.exe\" $cmd[2]"); 
        } 
        elsif($cmd[0] =~ /^jvi/i) { 
                &jdecode($cmd[1],$cmd[2]); 
                system("vi $cmd[2]"); 
        } 
        else { 
                &jdecode($cmd[1],$cmd[2]); 
                 system("explorer $cmd[2]"); 
        } 
} 
 
sub jjj { 
        open(LST,"abc.lst"); 
        my @lists=<LST>; 
        close(LST); 
        open(OUT,">index.txt"); 
        for(my $i=0;$i<=$#lists;$i++) { 
                $j=$i+1; 
                chop($lists[$i]); 
                &jencode($lists[$i],"$j.pro"); 
                print OUT "$j|1|$lists[$i]|jinsung|tnum|1\n"; 
        } 
        close(OUT); 
} 
 
sub jencode { 
        my ($infile,$outfile) = @_; 
        &jsystem("copy \"$infile\" jencode.in\n"); 
        open(CMD,"|$JMJSDES -html_mode -enc jencode.in jencode.out"); 
        print CMD "$jmjsid\n"; 
        print CMD "$jmjstpass\n"; 
        close(CMD); 
        &jsystem("del jencode.in"); 
        &jsystem("move jencode.out \"$outfile\"\n"); 
} 
 
sub jdecode { 
        my ($infile,$outfile) = @_; 
        print "TTT:jdecode|$infile|$outfile|\n"; 
        &jsystem("copy \"$infile\" jdecode.in\n"); 
        open(CMD,"|$JMJSDES -html_mode -dec jdecode.in jdecode.out"); 
        print CMD "$jmjsid\n"; 
        print CMD "$jmjstpass\n"; 
        close(CMD); 
        &jsystem("del jdecode.in"); 
        &jsystem("move jdecode.out \"$outfile\"\n"); 
} 
 
sub jsystem { 
        my ($comline) = @_; 
        $comline =~ s/^[\s\n]+//g; 
        $comline =~ s/[\s\n]+$//g; 
        if($JOS eq "DOS") { 
                if(        $comline =~ /^copy/) { $comline .= " > $ARGV[0].log";} 
        } 
        else { 
                if(        $comline =~ /^copy/) { $comline =~ s/^copy/cp/g;} 
                elsif(        $comline =~ /^del/ ) { $comline =~ s/^del/rm -rf/g;} 
                elsif(        $comline =~ /^move/) { $comline =~ s/^move/mv/g;} 
        } 
        system($comline); 
} 
  | 
 |