!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/arch/ppc/kernel/   drwxr-xr-x
Free 318.37 GB of 458.09 GB (69.5%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     softemu8xx.c (3.46 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*
 * BK Id: SCCS/s.softemu8xx.c 1.8 05/17/01 18:14:22 cort
 */
/*
 * Software emulation of some PPC instructions for the 8xx core.
 *
 * Copyright (C) 1998 Dan Malek (dmalek@jlc.net)
 *
 * Software floating emuation for the MPC8xx processor.  I did this mostly
 * because it was easier than trying to get the libraries compiled for
 * software floating point.  The goal is still to get the libraries done,
 * but I lost patience and needed some hacks to at least get init and
 * shells running.  The first problem is the setjmp/longjmp that save
 * and restore the floating point registers.
 *
 * For this emulation, our working registers are found on the register
 * save area.
 */

#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/interrupt.h>

#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>

/* Eventually we may need a look-up table, but this works for now.
*/
#define LFS    48
#define LFD    50
#define LFDU    51
#define STFD    54
#define STFDU    55
#define FMR    63

/*
 * We return 0 on success, 1 on unimplemented instruction, and EFAULT
 * if a load/store faulted.
 */
int
Soft_emulate_8xx(struct pt_regs *regs)
{
    uint    inst, instword;
    uint    flreg, idxreg, disp;
    uint    retval;
    signed short sdisp;
    uint    *ea, *ip;

    retval = 0;

    instword = *((uint *)regs->nip);
    inst = instword >> 26;

    flreg = (instword >> 21) & 0x1f;
    idxreg = (instword >> 16) & 0x1f;
    disp = instword & 0xffff;

    ea = (uint *)(regs->gpr[idxreg] + disp);
    ip = (uint *)&current->thread.fpr[flreg];

    switch ( inst )
    {
    case LFD:
        /* this is a 16 bit quantity that is sign extended
         * so use a signed short here -- Cort
         */
        sdisp = (instword & 0xffff);
        ea = (uint *)(regs->gpr[idxreg] + sdisp);
        if (copy_from_user(ip, ea, sizeof(double)))
            retval = -EFAULT;
        break;
        
    case LFDU:
        if (copy_from_user(ip, ea, sizeof(double)))
            retval = -EFAULT;
        else
            regs->gpr[idxreg] = (uint)ea;
        break;
    case LFS:
        sdisp = (instword & 0xffff);
        ea = (uint *)(regs->gpr[idxreg] + sdisp);
        if (copy_from_user(ip, ea, sizeof(float)))
            retval = -EFAULT;
        break;
    case STFD:
        /* this is a 16 bit quantity that is sign extended
         * so use a signed short here -- Cort
         */
        sdisp = (instword & 0xffff);
        ea = (uint *)(regs->gpr[idxreg] + sdisp);
        if (copy_to_user(ea, ip, sizeof(double)))
            retval = -EFAULT;
        break;

    case STFDU:
        if (copy_to_user(ea, ip, sizeof(double)))
            retval = -EFAULT;
        else
            regs->gpr[idxreg] = (uint)ea;
        break;
    case FMR:
        /* assume this is a fp move -- Cort */
        memcpy( ip, &current->thread.fpr[(instword>>11)&0x1f],
            sizeof(double) );
        break;
    default:
        retval = 1;
        printk("Bad emulation %s/%d\n"
               " NIP: %08x instruction: %08x opcode: %x "
               "A: %x B: %x C: %x code: %x rc: %x\n",
               current->comm,current->pid,
               regs->nip,
               instword,inst,
               (instword>>16)&0x1f,
               (instword>>11)&0x1f,
               (instword>>6)&0x1f,
               (instword>>1)&0x3ff,
               instword&1);
        {
            int pa;
            print_8xx_pte(current->mm,regs->nip);
            pa = get_8xx_pte(current->mm,regs->nip) & PAGE_MASK;
            pa |= (regs->nip & ~PAGE_MASK);
            pa = __va(pa);
            printk("Kernel VA for NIP %x ", pa);
            print_8xx_pte(current->mm,pa);
        }
        
    }

    if (retval == 0)
        regs->nip += 4;
    return(retval);
}


:: 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.0366 ]--