!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/isdn/sc/   drwxr-xr-x
Free 318.31 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:     shmem.c (3.78 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* $Id: shmem.c,v 1.1.4.1 2001/11/20 14:19:37 kai Exp $
 *
 * Copyright (C) 1996  SpellCaster Telecommunications Inc.
 *
 * Card functions implementing ISDN4Linux functionality
 *
 * This software may be used and distributed according to the terms
 * of the GNU General Public License, incorporated herein by reference.
 *
 * For more information, please contact gpl-info@spellcast.com or write:
 *
 *     SpellCaster Telecommunications Inc.
 *     5621 Finch Avenue East, Unit #3
 *     Scarborough, Ontario  Canada
 *     M1B 2T9
 *     +1 (416) 297-8565
 *     +1 (416) 297-6433 Facsimile
 */

#define __NO_VERSION__
#include "includes.h"        /* This must be first */
#include "hardware.h"
#include "card.h"

/*
 * Main adapter array
 */
extern board *adapter[];
extern int cinst;

/*
 *
 */
void *memcpy_toshmem(int card, void *dest, const void *src, size_t n)
{
    unsigned long flags;
    void *ret;
    unsigned char ch;

    if(!IS_VALID_CARD(card)) {
        pr_debug("Invalid param: %d is not a valid card id\n", card);
        return NULL;
    }

    if(n > SRAM_PAGESIZE) {
        return NULL;
    }

    /*
     * determine the page to load from the address
     */
    ch = (unsigned long) dest / SRAM_PAGESIZE;
    pr_debug("%s: loaded page %d\n",adapter[card]->devicename,ch);
    /*
     * Block interrupts and load the page
     */
    save_flags(flags);
    cli();

    outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
        adapter[card]->ioport[adapter[card]->shmem_pgport]);
    pr_debug("%s: set page to %#x\n",adapter[card]->devicename,
        ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
    ret = memcpy_toio(adapter[card]->rambase + 
        ((unsigned long) dest % 0x4000), src, n);
    pr_debug("%s: copying %d bytes from %#x to %#x\n",adapter[card]->devicename, n,
         (unsigned long) src, adapter[card]->rambase + ((unsigned long) dest %0x4000));
    restore_flags(flags);

    return ret;
}

/*
 * Reverse of above
 */
void *memcpy_fromshmem(int card, void *dest, const void *src, size_t n)
{
    unsigned long flags;
    void *ret;
    unsigned char ch;

    if(!IS_VALID_CARD(card)) {
        pr_debug("Invalid param: %d is not a valid card id\n", card);
        return NULL;
    }

    if(n > SRAM_PAGESIZE) {
        return NULL;
    }

    /*
     * determine the page to load from the address
     */
    ch = (unsigned long) src / SRAM_PAGESIZE;
    pr_debug("%s: loaded page %d\n",adapter[card]->devicename,ch);
    
    
    /*
     * Block interrupts and load the page
     */
    save_flags(flags);
    cli();

    outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
        adapter[card]->ioport[adapter[card]->shmem_pgport]);
    pr_debug("%s: set page to %#x\n",adapter[card]->devicename,
        ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
    ret = memcpy_fromio(dest,(void *)(adapter[card]->rambase + 
        ((unsigned long) src % 0x4000)), n);
/*    pr_debug("%s: copying %d bytes from %#x to %#x\n",
        adapter[card]->devicename, n,
        adapter[card]->rambase + ((unsigned long) src %0x4000), (unsigned long) dest); */
    restore_flags(flags);

    return ret;
}

void *memset_shmem(int card, void *dest, int c, size_t n)
{
    unsigned long flags;
    unsigned char ch;
    void *ret;

    if(!IS_VALID_CARD(card)) {
        pr_debug("Invalid param: %d is not a valid card id\n", card);
        return NULL;
    }

    if(n > SRAM_PAGESIZE) {
        return NULL;
    }

    /*
     * determine the page to load from the address
     */
    ch = (unsigned long) dest / SRAM_PAGESIZE;
    pr_debug("%s: loaded page %d\n",adapter[card]->devicename,ch);

    /*
     * Block interrupts and load the page
     */
    save_flags(flags);
    cli();

    outb(((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
        adapter[card]->ioport[adapter[card]->shmem_pgport]);
    pr_debug("%s: set page to %#x\n",adapter[card]->devicename,
        ((adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);
    ret = memset_io(adapter[card]->rambase + 
        ((unsigned long) dest % 0x4000), c, n);
    restore_flags(flags);

    return ret;
}

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