!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/usr/src/linux-2.4.18-xfs-1.1/drivers/macintosh/   drwxr-xr-x
Free 318.34 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     nvram.c (2.4 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * /dev/nvram driver for Power Macintosh.
 */

#define NVRAM_VERSION "1.0"

#include <linux/module.h>

#include <linux/types.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/fcntl.h>
#include <linux/nvram.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <asm/nvram.h>

#define NVRAM_SIZE    8192

static loff_t nvram_llseek(struct file *file, loff_t offset, int origin)
{
    switch (origin) {
    case 1:
        offset += file->f_pos;
        break;
    case 2:
        offset += NVRAM_SIZE;
        break;
    }
    if (offset < 0)
        return -EINVAL;
    file->f_pos = offset;
    return file->f_pos;
}

static ssize_t read_nvram(struct file *file, char *buf,
              size_t count, loff_t *ppos)
{
    unsigned int i;
    char *p = buf;

    if (verify_area(VERIFY_WRITE, buf, count))
        return -EFAULT;
    if (*ppos >= NVRAM_SIZE)
        return 0;
    for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count)
        if (__put_user(nvram_read_byte(i), p))
            return -EFAULT;
    *ppos = i;
    return p - buf;
}

static ssize_t write_nvram(struct file *file, const char *buf,
               size_t count, loff_t *ppos)
{
    unsigned int i;
    const char *p = buf;
    char c;

    if (verify_area(VERIFY_READ, buf, count))
        return -EFAULT;
    if (*ppos >= NVRAM_SIZE)
        return 0;
    for (i = *ppos; count > 0 && i < NVRAM_SIZE; ++i, ++p, --count) {
        if (__get_user(c, p))
            return -EFAULT;
        nvram_write_byte(c, i);
    }
    *ppos = i;
    return p - buf;
}

static int nvram_ioctl(struct inode *inode, struct file *file,
    unsigned int cmd, unsigned long arg)
{
    switch(cmd) {
        case PMAC_NVRAM_GET_OFFSET:
        {
            int part, offset;
            if (copy_from_user(&part,(void*)arg,sizeof(part))!=0)
                return -EFAULT;
            if (part < pmac_nvram_OF || part > pmac_nvram_NR)
                return -EINVAL;
            offset = pmac_get_partition(part);
            if (copy_to_user((void*)arg,&offset,sizeof(offset))!=0)
                return -EFAULT;
            break;
        }

        default:
            return -EINVAL;
    }

    return 0;
}

struct file_operations nvram_fops = {
    owner:        THIS_MODULE,
    llseek:        nvram_llseek,
    read:        read_nvram,
    write:        write_nvram,
    ioctl:        nvram_ioctl,
};

static struct miscdevice nvram_dev = {
    NVRAM_MINOR,
    "nvram",
    &nvram_fops
};

int __init nvram_init(void)
{
    printk(KERN_INFO "Macintosh non-volatile memory driver v%s\n",
        NVRAM_VERSION);
    misc_register(&nvram_dev);
    return 0;
}

void __exit nvram_cleanup(void)
{
        misc_deregister( &nvram_dev );
}

module_init(nvram_init);
module_exit(nvram_cleanup);
MODULE_LICENSE("GPL");

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.004 ]--