Click here to Skip to main content
15,886,795 members
Articles / Programming Languages / C++

Driver to Hide Processes and Files. Second Edition: Splicing

,
Rate me:
Please Sign up or sign in to vote.
4.93/5 (33 votes)
11 Mar 2011CPOL9 min read 69.4K   8.8K   115  
This article describes a driver that hides processes and files using the method of splicing.
# ifndef _STLP_INTERNAL_IOSFWD
#  define _STLP_INTERNAL_IOSFWD

#if defined(__sgi) && !defined(__GNUC__) && !defined(_STANDARD_C_PLUS_PLUS)
#error This header file requires the -LANG:std option
#endif

// This file provides forward declarations of the most important I/O
// classes.  Note that almost all of those classes are class templates,
// with default template arguments.  According to the C++ standard, 
// if a class template is declared more than once in the same scope
// then only one of those declarations may have default arguments.  

// <iosfwd> contains the same declarations as other headers, and including
// both <iosfwd> and (say) <iostream> is permitted.  This means that only
// one header may contain those default template arguments.

// In this implementation, the declarations in <iosfwd> contain default
// template arguments.  All of the other I/O headers include <iosfwd>.

#ifndef _STLP_CHAR_TRAITS_H
# include <stl/char_traits.h>
#endif

_STLP_BEGIN_NAMESPACE

class _STLP_CLASS_DECLSPEC ios_base;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_ios;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_streambuf;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_istream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_ostream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_iostream;

template <class _CharT, __DFL_TMPL_PARAM( _Traits , char_traits<_CharT>),
          __DFL_TMPL_PARAM(_Allocator , allocator<_CharT>) >
class basic_stringbuf;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>),
          __DFL_TMPL_PARAM(_Allocator , allocator<_CharT>) >
class basic_istringstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>),
          __DFL_TMPL_PARAM(_Allocator , allocator<_CharT>) >
class basic_ostringstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>),
          __DFL_TMPL_PARAM(_Allocator , allocator<_CharT>) >
class basic_stringstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_filebuf;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_ifstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_ofstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class basic_fstream;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class istreambuf_iterator;

template <class _CharT, __DFL_TMPL_PARAM(_Traits , char_traits<_CharT>) >
class ostreambuf_iterator;

typedef basic_ios<char, char_traits<char> >    ios;

# ifndef _STLP_NO_WCHAR_T
typedef basic_ios<wchar_t, char_traits<wchar_t> > wios;
# endif

// Forward declaration of class locale, and of the most important facets.
class locale;
# ifdef _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS
template <class _Facet>
struct _Use_facet {
  const locale& __loc;
  _Use_facet(const locale& __p_loc) : __loc(__p_loc) {}
  inline const _Facet& operator *() const;
};
# define use_facet *_Use_facet
# else
template <class _Facet> inline const _Facet& use_facet(const locale&);
# endif

template <class _CharT> class ctype;
template <class _CharT> class ctype_byname;
template <class _CharT> class collate;
template <class _CharT> class collate_byname;

_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC ctype<char>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC ctype_byname<char>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC collate<char>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC collate_byname<char>;

#  ifndef _STLP_NO_WCHAR_T
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC ctype<wchar_t>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC ctype_byname<wchar_t>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC collate<wchar_t>;
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC collate_byname<wchar_t>;
#  endif

# if !(defined (__SUNPRO_CC) && __SUNPRO_CC < 0x500 ) && !defined(_STLP_WINCE)
// Typedefs for ordinary (narrow-character) streams.
_STLP_TEMPLATE_NULL class _STLP_CLASS_DECLSPEC basic_streambuf<char, char_traits<char> >;
# endif

typedef basic_istream<char, char_traits<char> >   istream;
typedef basic_ostream<char, char_traits<char> >   ostream;
typedef basic_iostream<char, char_traits<char> >  iostream;
typedef basic_streambuf<char,char_traits<char> > streambuf;

typedef basic_stringbuf<char, char_traits<char>, allocator<char> >     stringbuf;
typedef basic_istringstream<char, char_traits<char>, allocator<char> > istringstream;
typedef basic_ostringstream<char, char_traits<char>, allocator<char> > ostringstream;
typedef basic_stringstream<char, char_traits<char>, allocator<char> >  stringstream;

typedef basic_filebuf<char, char_traits<char> >  filebuf;
typedef basic_ifstream<char, char_traits<char> > ifstream;
typedef basic_ofstream<char, char_traits<char> > ofstream;
typedef basic_fstream<char, char_traits<char> >  fstream;

# ifndef _STLP_NO_WCHAR_T
// Typedefs for wide-character streams.
typedef basic_streambuf<wchar_t, char_traits<wchar_t> > wstreambuf;
typedef basic_istream<wchar_t, char_traits<wchar_t> >   wistream;
typedef basic_ostream<wchar_t, char_traits<wchar_t> >   wostream;
typedef basic_iostream<wchar_t, char_traits<wchar_t> >  wiostream;

typedef basic_stringbuf<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >     wstringbuf;
typedef basic_istringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wistringstream;
typedef basic_ostringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wostringstream;
typedef basic_stringstream<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >  wstringstream;

typedef basic_filebuf<wchar_t, char_traits<wchar_t> >  wfilebuf;
typedef basic_ifstream<wchar_t, char_traits<wchar_t> > wifstream;
typedef basic_ofstream<wchar_t, char_traits<wchar_t> > wofstream;
typedef basic_fstream<wchar_t, char_traits<wchar_t> >  wfstream;
# endif

_STLP_END_NAMESPACE

#endif

// Local Variables:
// mode:C++
// End:

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer Apriorit Inc.
United States United States
ApriorIT is a software research and development company specializing in cybersecurity and data management technology engineering. We work for a broad range of clients from Fortune 500 technology leaders to small innovative startups building unique solutions.

As Apriorit offers integrated research&development services for the software projects in such areas as endpoint security, network security, data security, embedded Systems, and virtualization, we have strong kernel and driver development skills, huge system programming expertise, and are reals fans of research projects.

Our specialty is reverse engineering, we apply it for security testing and security-related projects.

A separate department of Apriorit works on large-scale business SaaS solutions, handling tasks from business analysis, data architecture design, and web development to performance optimization and DevOps.

Official site: https://www.apriorit.com
Clutch profile: https://clutch.co/profile/apriorit
This is a Organisation

33 members

Written By
Technical Lead Apriorit Inc.
Ukraine Ukraine
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions