Changeset 485

Show
Ignore:
Timestamp:
04/07/06 04:00:42 (3 years ago)
Author:
common
Message:

library
- the new Library header & source file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • library/trunk/library-core/include/Library.hpp

    r484 r485  
    11/******************************************************************************** 
    2  *                              Nepenthes 
     2 *                              Library 
    33 *                        - finest collection - 
    44 * 
     
    2222 *  
    2323 *  
    24  *             contact nepenthesdev@users.sourceforge.net   
     24 *             contact librarydev@users.sourceforge.net   
    2525 * 
    2626 *******************************************************************************/ 
     
    4343typedef unsigned char byte; 
    4444 
    45 /* nepenthes specific log tags */ 
     45/* library specific log tags */ 
    4646#define l_crit          0x00000001 
    4747#define l_warn          0x00000002 
     
    7575 
    7676//#define __PRETTY_FUNCTION__ "FOO 
    77 #define logWrite(mask, format, ...) g_Nepenthes->getLogMgr()->logf(mask,format, __VA_ARGS__) 
     77#define logWrite(mask, format, ...) g_Library->getLogMgr()->logf(mask,format, __VA_ARGS__) 
    7878 
    7979#define logSpam(format, ...) logWrite(l_spam    | STDTAGS , format, __VA_ARGS__) 
     
    8989 
    9090#ifndef DEBUG 
    91 #define logWrite(mask, format, ...) g_Nepenthes->getLogMgr()->logf(mask,format, __VA_ARGS__) 
     91#define logWrite(mask, format, ...) g_Library->getLogMgr()->logf(mask,format, __VA_ARGS__) 
    9292#else 
    93 #define logWrite(mask, format, ...) printf("%s:%i ",__FILE__,__LINE__); g_Nepenthes->getLogMgr()->logf(mask,format, __VA_ARGS__) 
     93#define logWrite(mask, format, ...) printf("%s:%i ",__FILE__,__LINE__); g_Library->getLogMgr()->logf(mask,format, __VA_ARGS__) 
    9494#endif  
    9595 
     
    100100#define logCrit(format, ...) logWrite(l_crit    | STDTAGS , format, __VA_ARGS__) 
    101101#define logPF() logSpam("<in %s>\n", __PRETTY_FUNCTION__) 
    102  
     102//#define logPF() 
    103103#endif 
    104104 
    105 namespace nepenthes 
     105namespace library 
    106106{ 
    107107 
    108108        class Config; 
    109         class DownloadManager; 
    110109    class EventManager; 
    111     class LuaInterface; 
    112110    class LogManager; 
    113111    class ModuleManager; 
    114     class ShellcodeManager; 
    115     class SubmitManager; 
    116112        class SocketManager; 
    117113        class Utilities; 
    118         class DialogueFactoryManager; 
    119114        class DNSManager; 
    120115        class Message; 
    121116        class GeoLocationManager; 
    122         class UploadManager; 
     117        class SQLManager; 
    123118 
    124119 
    125120/** 
    126  * the Nepenthes main class (singleton). 
     121 * the Library main class (singleton). 
    127122 *  
    128  * all in all Nepenthes does nothing, he got plenty Managers to do something 
     123 * all in all Library does nothing, he got plenty Managers to do something 
    129124 *  
    130125 */ 
    131126 
    132     class Nepenthes 
     127    class Library 
    133128    { 
    134129    public: 
    135         Nepenthes(); 
    136         virtual ~Nepenthes(); 
     130        Library(); 
     131        virtual ~Library(); 
    137132         
    138133                virtual Config                          *getConfig(); 
    139         virtual DownloadManager         *getDownloadMgr(); 
    140134        virtual EventManager            *getEventMgr(); 
    141         virtual LuaInterface            *getLua(); 
    142135        virtual LogManager              *getLogMgr(); 
    143136        virtual ModuleManager           *getModuleMgr(); 
    144         virtual ShellcodeManager        *getShellcodeMgr(); 
    145         virtual SubmitManager           *getSubmitMgr(); 
    146137                virtual SocketManager           *getSocketMgr(); 
     138                virtual DNSManager                      *getDNSMgr(); 
    147139                virtual Utilities                       *getUtilities(); 
    148                 virtual DialogueFactoryManager *getFactoryMgr(); 
    149                 virtual DNSManager                      *getDNSMgr(); 
    150140 
    151141#ifdef HAVE_GEOLOCATION 
    152142                virtual GeoLocationManager      *getGeoMgr(); 
    153143#endif  
    154  
    155                 virtual UploadManager           *getUploadMgr(); 
     144                virtual SQLManager                      *getSQLMgr(); 
    156145 
    157146                virtual bool                            doLoop(); 
     
    162151    private: 
    163152                Config              *m_Config; 
    164                 DialogueFactoryManager *m_DialogueFactoryManager; 
    165                 DownloadManager     *m_DownloadManager; 
    166153                DNSManager          *m_DNSManager; 
    167154                EventManager        *m_EventManager; 
     
    169156                GeoLocationManager  *m_GeoLocationManager; 
    170157#endif 
    171                 LuaInterface        *m_Lua; 
    172158                LogManager          *m_LogManager; 
    173159                ModuleManager       *m_ModuleManager; 
    174                 ShellcodeManager    *m_ShellcodeManager; 
    175                 SubmitManager       *m_SubmitManager; 
    176160                SocketManager       *m_SocketManager; 
    177                 UploadManager       *m_UploadManager; 
    178161                Utilities           *m_Utilities; 
     162                SQLManager                      *m_SQLManager; 
    179163                 
    180164                 
     
    187171                gid_t                           m_GID; 
    188172        protected: 
    189                 bool fileCheckMain(char *filecheckarg,int32_t argc, int32_t opti, char **argv); 
    190                 uint8_t fileCheckPrinter(const char *filename, uint8_t options); 
    191                 int32_t fileCheck(const char *filename, Message **Msg); 
    192173 
    193174                bool changeUser(char *user); 
     
    202183} 
    203184 
    204 extern nepenthes::Nepenthes *g_Nepenthes
     185extern library::Library *g_Library
    205186 
    206187void show_help(bool defaults); 
  • library/trunk/library-core/src/Library.cpp

    r484 r485  
    11/******************************************************************************** 
    2  *                              Nepenthes 
     2 *                              Library 
    33 *                        - finest collection - 
    44 * 
     
    2222 *  
    2323 *  
    24  *             contact nepenthesdev@users.sourceforge.net   
     24 *             contact librarydev@users.sourceforge.net   
    2525 * 
    2626 *******************************************************************************/ 
     
    5050#endif 
    5151 
    52 #include "Nepenthes.hpp" 
     52#include "Library.hpp" 
    5353#include "SocketManager.hpp" 
    5454#include "EventManager.hpp" 
    55 #include "DownloadManager.hpp" 
    5655#include "LogManager.hpp" 
    5756#include "ConsoleLogger.hpp" 
     
    5958#include "RingFileLogger.hpp" 
    6059#include "ModuleManager.hpp" 
    61 #include "ShellcodeManager.hpp" 
    62 #include "SubmitManager.hpp" 
    6360#include "Config.hpp" 
    6461#include "Utilities.hpp" 
    65 #include "DialogueFactoryManager.hpp" 
    6662#include "DNSManager.hpp" 
    6763#include "GeoLocationManager.hpp" 
    68 #include "UploadManager.hpp" 
    69  
    70 #include "Message.hpp" 
     64#include "SQLManager.hpp" 
    7165 
    7266 
     
    7670#endif   
    7771 
    78 using namespace nepenthes
     72using namespace library
    7973 
    8074enum ColorSetting { colorAuto, colorAlways, colorNever }; 
    8175 
    82 Nepenthes *g_Nepenthes
     76Library *g_Library
    8377/** 
    8478 * the constructor 
     
    8781 * inits all managers 
    8882 */ 
    89 Nepenthes::Nepenthes() 
    90 { 
    91         g_Nepenthes = this; 
     83Library::Library() 
     84{ 
     85        g_Library = this; 
    9286        m_running = true; 
    9387 
    9488        m_Config = NULL; 
    95         m_DialogueFactoryManager    = NULL; 
    9689        m_DNSManager = NULL; 
    97         m_DownloadManager   = NULL; 
    9890        m_EventManager  = NULL; 
    9991#ifdef HAVE_GEOLOCATION 
     
    10294        m_LogManager    = NULL; 
    10395        m_ModuleManager = NULL; 
    104         m_ShellcodeManager  = NULL; 
    10596        m_SocketManager = NULL; 
    106         m_SubmitManager = NULL; 
    10797        m_Utilities = NULL; 
    10898 
     
    112102 
    113103/** 
    114  * Nepenthes destuctor 
    115  */ 
    116 Nepenthes::~Nepenthes() 
     104 * Library destuctor 
     105 */ 
     106Library::~Library() 
    117107{ 
    118108        if ( m_SocketManager != NULL ) 
    119109        delete m_SocketManager; 
    120110 
    121         if (m_DownloadManager != NULL ) 
    122                 delete m_DownloadManager; 
    123  
    124111        if (m_EventManager != NULL) 
    125112                delete m_EventManager; 
    126113 
    127         if (m_SubmitManager != NULL) 
    128         { 
    129                 m_SubmitManager->Exit(); 
    130         delete m_SubmitManager; 
    131         } 
    132  
    133114        if (m_ModuleManager != NULL) 
    134115                delete m_ModuleManager; 
    135116 
    136         if (m_ShellcodeManager != NULL) 
    137                 delete m_ShellcodeManager; 
    138  
    139117        if (m_Utilities != NULL) 
    140118                delete m_Utilities; 
    141  
    142         if (m_DialogueFactoryManager != NULL) 
    143                 delete m_DialogueFactoryManager; 
    144119 
    145120#ifdef HAVE_GEOLOCATION 
     
    157132 
    158133/** 
    159  * start nepenthes, using command line arguments. 
     134 * start library, using command line arguments. 
    160135 *  
    161136 * @param argc   number of arguments. 
     
    165140 */ 
    166141 
    167 int32_t Nepenthes::run(int32_t argc, char **argv) 
     142int32_t Library::run(int32_t argc, char **argv) 
    168143{ 
    169144        bool run=true; 
     
    173148 
    174149        char *filecheckarg =NULL; 
    175         char *confpath = SYSCONFDIR "/nepenthes/nepenthes.conf"; 
     150        char *confpath = SYSCONFDIR "/library/library.conf"; 
    176151        char *basedir; 
    177152        char *workingdir = PREFIX; 
     
    407382                if ( run == true || filecheck == true) 
    408383                { 
    409                 m_DialogueFactoryManager = new DialogueFactoryManager(this); 
    410  
    411                         m_DownloadManager   = new DownloadManager(this); 
    412384                        m_EventManager      = new EventManager(this); 
    413385 
     
    416388#endif  
    417389 
    418                         m_UploadManager         = new UploadManager(this); 
    419                         //      m_Lua                           = new Lua 
    420390                        m_ModuleManager     = new ModuleManager(this); 
    421                         m_ShellcodeManager  = new ShellcodeManager(this); 
    422391                        m_SocketManager     = new SocketManager(this); 
    423                         m_SubmitManager     = new SubmitManager(this); 
    424392                        m_Utilities         = new Utilities(); 
    425393                        m_DNSManager        = new DNSManager(this); 
     394                        m_SQLManager            = new SQLManager(this); 
    426395                } 
    427396        } 
     
    447416 
    448417        m_Config = new Config; 
    449                 logInfo("Trying to load Nepenthes Configuration from %s \n",confpath); 
     418                logInfo("Trying to load Library Configuration from %s \n",confpath); 
    450419                try 
    451420                { 
    452421                        m_Config->load(confpath); 
    453                         logInfo("Done loading Nepenthes Configuration from %s \n",confpath); 
     422                        logInfo("Done loading Library Configuration from %s \n",confpath); 
    454423                } catch ( LoadError e ) 
    455424                { 
     
    476445                                try 
    477446                                { 
    478                                         rlpath = m_Config->getValString("nepenthes.logmanager.ring_logging_file"); 
     447                                        rlpath = m_Config->getValString("library.logmanager.ring_logging_file"); 
    479448                                } catch ( ... ) 
    480449                                { 
    481                                         logCrit("%s","Could not find nepenthes.logmanager.ring_logging_file in Config\n"); 
     450                                        logCrit("%s","Could not find library.logmanager.ring_logging_file in Config\n"); 
    482451                                        run = false; 
    483452                                } 
     
    499468                                try 
    500469                                { 
    501                                         flpath = m_Config->getValString("nepenthes.logmanager.file_logging_file"); 
     470                                        flpath = m_Config->getValString("library.logmanager.file_logging_file"); 
    502471                                } catch ( ... ) 
    503472                                { 
    504                                         logCrit("%s","Could not find nepenthes.logmanager.file_logging_file in Config\n"); 
     473                                        logCrit("%s","Could not find library.logmanager.file_logging_file in Config\n"); 
    505474                                        run = false; 
    506475                                } 
     
    552521                if (run == true ) 
    553522                { 
    554                         run = m_DownloadManager->Init(); 
    555                         m_DownloadManager->doList(); 
     523                        m_EventManager->doList(); 
    556524                } 
    557525 
    558526                if (run == true ) 
    559527                { 
    560                         run = m_UploadManager->Init(); 
    561                         m_UploadManager->doList(); 
    562                 } 
     528                        run = m_SQLManager->Init(); 
     529                        m_SQLManager->doList(); 
     530                } 
     531 
    563532 
    564533                if (run == true ) 
    565534                { 
    566                         m_EventManager->doList(); 
    567                 } 
    568  
    569                 if (run == true ) 
    570                 { 
    571                         m_ShellcodeManager->doList(); 
    572                 } 
    573  
    574                 if (run == true ) 
    575                 { 
    576535            m_SocketManager->doList(); 
    577536                } 
    578537 
    579                 if (run == true ) 
    580                 { 
    581                         run = m_SubmitManager->Init(); 
    582                         m_SubmitManager->doList(); 
    583                 } 
    584  
    585                 if (run == true ) 
    586                 { 
    587                         m_DialogueFactoryManager->doList(); 
    588                 } 
    589  
    590  
    591                 if (filecheck == true ) 
    592                 { 
    593                         if (run == true) 
    594                         { 
    595                                 run = false;  
    596                         }else 
    597                         { 
    598                                 filecheck = false; 
    599                         } 
    600                 } 
     538 
    601539        } 
    602540 
     
    750688        } 
    751689 
    752         if (filecheck) 
    753         { 
    754                 show_version(); 
    755                 fileCheckMain(filecheckarg,argc,optind,argv); 
    756         } 
    757690        if( run == true ) 
    758691        { 
     
    771704 
    772705/** 
    773  * the Nepenthes mainloop 
     706 * the Library mainloop 
    774707 *  
    775708 * @return should never return ;) 
    776709 */ 
    777 bool Nepenthes::doLoop() 
     710bool Library::doLoop() 
    778711{ 
    779712 
     
    789722 
    790723 
    791 #define FC_DO_NONOP 0x001 
    792 #define FC_RM_NONOP 0x002 
    793 #define FC_RM_KNOWN 0x004 
    794  
    795 #define FC_IS_KNOWN 0x008 
    796 #define FC_IS_NONOP 0x010 
    797  
    798  
    799 bool Nepenthes::fileCheckMain(char *optval, int32_t argc, int32_t opti, char **argv) 
    800 
    801         if ( opti >= argc ) 
    802         { 
    803                 return true; 
    804         } 
    805  
    806  
    807         uint8_t options=0; 
    808         if (optval != NULL) 
    809         { 
    810                 if (strstr(optval,"rmnonop") != NULL) 
    811                 { 
    812                         options |= FC_RM_NONOP; 
    813                 } 
    814                 if (strstr(optval,"rmknown") != NULL) 
    815                 { 
    816                         options |= FC_RM_KNOWN; 
    817                 } 
    818                 if (strstr(optval,"dononop") != NULL) 
    819                 { 
    820                         options |= FC_DO_NONOP; 
    821                 } 
    822         } 
    823  
    824         printf ("Checking Files: \n"); 
    825         for ( ; opti < argc && m_running == true; ) 
    826         { 
    827  
    828                 struct stat fileinfo; 
    829                 if ( stat((const char*)argv[opti],&fileinfo) != 0 ) 
    830                 { 
    831                         printf("failed\n"); 
    832                         return -1; 
    833                 } 
    834  
    835                 if ( S_ISREG(fileinfo.st_mode)  ) 
    836                 { 
    837                          
    838                         uint8_t result = fileCheckPrinter(argv[opti],options); 
    839  
    840                         if ( 
    841                                 (options & FC_RM_KNOWN && result & FC_IS_KNOWN) || 
    842                                 (options & FC_RM_NONOP && result & FC_IS_NONOP)  
    843                                 ) 
    844                                  
    845                         { 
    846                                 unlink(argv[opti]); 
    847                         } 
    848  
    849                 }else 
    850         if ( S_ISDIR(fileinfo.st_mode) ) 
    851                 { 
    852                         DIR *bindir = opendir(argv[opti]); 
    853                         struct dirent *dirnode; 
    854                         string basepath = argv[opti]; 
    855  
    856                         while ( (dirnode = readdir(bindir)) != NULL && m_running == true ) 
    857                         { 
    858  
    859 #if !defined(CYGWIN)  && !defined(CYGWIN32) &&!defined(__CYGWIN__) || !defined(__CYGWIN32__) 
    860                                 if ( dirnode->d_type == 8 ) 
    861 #else 
    862                                 if (1) 
    863 #endif 
    864                                 { 
    865                                         string filepath = basepath + "/" + dirnode->d_name; 
    866                                         uint8_t result = fileCheckPrinter(filepath.c_str(),options); 
    867  
    868                                         if ( 
    869                                                 (options & FC_RM_KNOWN && result & FC_IS_KNOWN) || 
    870                                                 (options & FC_RM_NONOP && result & FC_IS_NONOP)  
    871                                                 ) 
    872                                                  
    873                                         { 
    874                                                 unlink(filepath.c_str()); 
    875                                         } 
    876                                 } 
    877                         } 
    878                         closedir(bindir); 
    879                 } 
    880  
    881                 opti++; 
    882         } 
    883         return true; 
    884 
    885  
    886 uint8_t Nepenthes::fileCheckPrinter(const char *filename, uint8_t options) 
    887 
    888         uint8_t result=0; 
    889  
    890         Message *Msg=NULL; 
    891  
    892         printf("\t %s\t",filename); 
    893         switch ( fileCheck(filename,&Msg) ) 
    894         { 
    895         case -1: 
    896                 printf("could not open file"); 
    897                 break; 
    898  
    899         case 0: 
    900                 if ( m_ShellcodeManager->fileCheck(&Msg) == SCH_DONE ) 
    901                 { 
    902                         result |= FC_IS_KNOWN; 
    903                         printf("\033[32;1mKNOWN\033[0m"); 
    904                 } else 
    905                 { 
    906                         printf("\033[31;1mFAILED\033[0m"); 
    907                 } 
    908                 delete Msg; 
    909                 break; 
    910  
    911         case 1: 
    912  
    913                 result |= FC_IS_NONOP; 
    914  
    915                 if ( options & FC_DO_NONOP ) 
    916                 { 
    917                         if ( m_ShellcodeManager->fileCheck(&Msg) == SCH_DONE ) 
    918                         { 
    919                                 result |= FC_IS_KNOWN; 
    920                                 printf("\033[32;1mKNOWN\033[0m"); 
    921                         } else 
    922                         { 
    923                                 printf("\033[31;1mFAILED\033[0m"); 
    924                         } 
    925                 } else 
    926                 { 
    927                         printf("NONOP"); 
    928                 } 
    929                  
    930  
    931                 delete Msg; 
    932                 break; 
    933         } 
    934         printf("\n"); 
    935         return result; 
    936 
    937  
    938  
    939 /** 
    940  *  
    941  * @param filename 
    942  * @param Msg 
    943  *  
    944  * @return -1 cound not open file 
    945  *         0 cool 
    946  *         1 no nop slide 
    947  */ 
    948 int32_t Nepenthes::fileCheck(const char *filename, Message **Msg) 
    949 
    950     logPF(); 
    951         uint32_t filesize=0; 
    952         unsigned char *buffer=NULL; 
    953         struct stat fileinfo; 
    954         int32_t retval = -1; 
    955  
    956         if (stat((const char*)filename,&fileinfo) != 0) 
    957         { 
    958         return -1; 
    959         } 
    960  
    961                 filesize=fileinfo.st_size; 
    962                 printf("%5i\t",filesize); 
    963                 buffer = (unsigned char *)malloc(fileinfo.st_size); 
    964  
    965                 FILE *f; 
    966                 if ( (f = fopen((const char *)filename,"rb")) == NULL ) 
    967                 { 
    968                         return -1; 
    969                 } else 
    970                 { 
    971                         fread(buffer,1,filesize,f); 
    972                         fclose(f); 
    973  
    974                         uint32_t i; 
    975                         bool nopslide=false; 
    976                         for ( i=0;i<filesize;i++ ) 
    977                         { 
    978                                 if ( buffer[i] == 0x90 ) 
    979                                 { 
    980                                         nopslide = true; 
    981                                         break; 
    982                                 } 
    983                         } 
    984                         if ( nopslide ) 
    985                         { 
    986                                 *Msg = new Message((char *)buffer, filesize, 0, 0, 0, 0, NULL, NULL); 
    987                                 retval = 0; 
    988                         } else 
    989                         { 
    990                                 *Msg = new Message((char *)buffer, filesize, 0, 0, 0, 0, NULL, NULL); 
    991                                 retval = 1; 
    992                         } 
    993                 } 
    994                 free(buffer); 
    995         return retval; 
    996 
    997  
    998  
    999  
    1000 /** 
    1001  * get nepenthes Config 
    1002  *  
    1003  * @return returns pointer to nepenthes Config 
    1004  */ 
    1005 Config *Nepenthes::getConfig() 
     724 
     725 
     726 
     727/** 
     728 * get library Config 
     729 *  
     730 * @return returns pointer to library Config 
     731 */ 
     732Config *Library::getConfig() 
    1006733{ 
    1007734        return m_Config; 
    1008735} 
    1009736 
    1010 /** 
    1011  * get DownloadManager 
    1012  *  
    1013  * @return returns pointer to the DownloadManager 
    1014  */ 
    1015 DownloadManager *Nepenthes::getDownloadMgr() 
    1016 { 
    1017         return m_DownloadManager; 
    1018 } 
    1019737 
    1020738/** 
     
    1023741 * @return returns EventManager 
    1024742 */ 
    1025 EventManager *Nepenthes::getEventMgr() 
     743EventManager *Library::getEventMgr() 
    1026744{ 
    1027745        return m_EventManager; 
     
    1033751 * @return returns LogManager 
    1034752 */ 
    1035 LogManager *Nepenthes::getLogMgr() 
     753LogManager *Library::getLogMgr() 
    1036754{ 
    1037755        return m_LogManager; 
    1038756} 
    1039757 
    1040 LuaInterface *Nepenthes::getLua() 
    1041 { 
    1042         return m_Lua; 
    1043 } 
    1044758 
    1045759/** 
     
    1048762 * @return returns ModuleManager 
    1049763 */ 
    1050 ModuleManager *Nepenthes::getModuleMgr() 
     764ModuleManager *Library::getModuleMgr() 
    1051765{ 
    1052766        return m_ModuleManager; 
     
    1054768 
    1055769 
    1056 /** 
    1057  * get ShellcodeManager 
    1058  *  
    1059  * @return returns ShellcodeManager 
    1060  */ 
    1061 ShellcodeManager *Nepenthes::getShellcodeMgr() 
    1062 { 
    1063         return m_ShellcodeManager; 
    1064 } 
    1065770 
    1066771/** 
     
    1069774 * @return returns SocketManager 
    1070775 */ 
    1071 SocketManager *Nepenthes::getSocketMgr() 
     776SocketManager *Library::getSocketMgr() 
    1072777{ 
    1073778        return m_SocketManager; 
     
    1075780 
    1076781 
    1077 /** 
    1078  * get SubmitManager 
    1079  *  
    1080  * @return returns SubmitManager 
    1081  */ 
    1082 SubmitManager *Nepenthes::getSubmitMgr() 
    1083 { 
    1084         return m_SubmitManager; 
    1085 } 
    1086782 
    1087783/** 
     
    1090786 * @return returns the Utilities 
    1091787 */ 
    1092 Utilities *Nepenthes::getUtilities() 
     788Utilities *Library::getUtilities() 
    1093789{ 
    1094790        return m_Utilities; 
    1095791} 
    1096792 
    1097 /** 
    1098  * get the DialogueFactoryManager 
    1099  *  
    1100  * @return returns the DialogueFactoryManager 
    1101  */ 
    1102 DialogueFactoryManager *Nepenthes::getFactoryMgr() 
    1103 { 
    1104         return m_DialogueFactoryManager; 
    1105 } 
    1106793 
    1107794/** 
     
    1110797 * @return returns the DNSManager 
    1111798 */ 
    1112 DNSManager *Nepenthes::getDNSMgr() 
     799DNSManager *Library::getDNSMgr() 
    1113800{ 
    1114801        return m_DNSManager; 
     
    1122809 * @return returns the GeoLocationManager 
    1123810 */ 
    1124 GeoLocationManager *Nepenthes::getGeoMgr() 
     811GeoLocationManager *Library::getGeoMgr() 
    1125812{ 
    1126813        return m_GeoLocationManager; 
     
    1129816#endif 
    1130817 
    1131 /** 
    1132  * get the UploadManager 
    1133  *  
    1134  * @return returns the UploadManager 
    1135  */ 
    1136 UploadManager *Nepenthes::getUploadMgr() 
    1137 
    1138         return m_UploadManager; 
    1139 
    1140  
    1141 /** 
    1142  * stop the nepenthes 
     818 
     819SQLManager *Library::getSQLMgr() 
     820
     821        return m_SQLManager; 
     822
     823 
     824/** 
     825 * stop the library 
    1143826 *  
    1144827 * @return returns true if running, else false 
    1145828 */ 
    1146 bool Nepenthes::stop() 
     829bool Library::stop() 
    1147830{ 
    1148831        if(m_running) 
     
    1158841 *  
    1159842 * FIXME does not work 
    1160  * exits nepenthes 
     843 * exits library 
    1161844 *  
    1162845 * @return returns false 
    1163846 */ 
    1164 bool Nepenthes::reloadConfig() 
     847bool Library::reloadConfig() 
    1165848{ 
    1166849        bool retval=true; 
     
    1184867 *         else false 
    1185868 */ 
    1186 bool Nepenthes::changeUser(char *user) 
     869bool Library::changeUser(char *user) 
    1187870{ 
    1188871        passwd * pass;                                 
     
    1217900 * @return true if the userid was changed successfully, else false 
    1218901 */ 
    1219 bool Nepenthes::changeUser() 
     902bool Library::changeUser() 
    1220903{ 
    1221904#ifdef HAVE_SETRESUID 
     
    1274957 * @return returns true on success, else false 
    1275958 */ 
    1276 bool Nepenthes::changeGroup(char *gruppe) 
     959bool Library::changeGroup(char *gruppe) 
    1277960{ 
    1278961        struct group *grp; 
     
    1306989 * @return true if change worked, else false 
    1307990 */ 
    1308 bool Nepenthes::changeGroup() 
     991bool Library::changeGroup() 
    1309992{ 
    1310993         
     
    13741057 *         else false 
    13751058 */ 
    1376 bool Nepenthes::changeRoot(char *path) 
     1059bool Library::changeRoot(char *path) 
    13771060{ 
    13781061        if ( chroot(path) < 0) 
     
    13891072 
    13901073 
    1391 bool Nepenthes::setCapabilties() 
     1074bool Library::setCapabilties() 
    13921075{ 
    13931076        logPF(); 
     
    14491132        case SIGHUP: 
    14501133                logCrit("%s\n", "Got SIGHUP\nRereading Config File!\n"); 
    1451                 g_Nepenthes->reloadConfig(); 
     1134                g_Library->reloadConfig(); 
    14521135                break; 
    14531136 
    14541137        case SIGINT: 
    14551138                logCrit("%s\n", "Got SIGINT\nStopping NOW!\n"); 
    1456                 g_Nepenthes->stop(); 
     1139                g_Library->stop(); 
    14571140                break; 
    14581141 
     
    14671150                break; 
    14681151 
     1152        case SIGWINCH: 
     1153                printf("window change\n"); 
     1154                break; 
     1155 
    14691156        default: 
    14701157                logCrit("Exit 'cause of %i\n", iSignal); 
    1471                 g_Nepenthes->stop(); 
    1472         } 
    1473 } 
    1474  
    1475 /** 
    1476  * show the nepenthes logo 
     1158                g_Library->stop(); 
     1159        } 
     1160} 
     1161 
     1162/** 
     1163 * show the library logo 
    14771164 */ 
    14781165void show_logo(); 
     
    15691256#endif 
    15701257//  signal(SIGLOST,  SignalHandler);    //     -,-,-     Term    File lock lost 
    1571         signal(SIGWINCH, SIG_IGN      );        //   28,28,20    Ign     Window resize signal (4.3 BSD, Sun) 
     1258//      signal(SIGWINCH, SIG_IGN      );        //   28,28,20    Ign     Window resize signal (4.3 BSD, Sun) 
     1259        signal(SIGWINCH, SignalHandler);        //   28,28,20    Ign     Window resize signal (4.3 BSD, Sun) 
    15721260#ifdef HAVE_SIGUNUSED 
    15731261        signal(SIGUNUSED,SignalHandler);        //    -,31,-     Term    Unused signal (will be SIGSYS) 
     
    15751263#endif 
    15761264         
    1577         Nepenthes nepenthes
    1578         return nepenthes.run(argc, argv); 
     1265        Library library
     1266        return library.run(argc, argv); 
    15791267} 
    15801268 
     
    15831271        puts("#                                                                             #\n" \ 
    15841272                 "                                                                               \n" \ 
    1585                  "                 !Š..,('                                                       \n" \ 
    1586                  "                 !!..,Š,                                                       \n" \ 
    1587                  "                 !*'.,!*                                                       \n" \ 
    1588                  "                 *!'.,!Š                                                       \n" \ 
    1589                  "                 '!'.,!Š                                                       \n" \ 
    1590                  "                 .Š,',*Š,,.                                                    \n" \ 
    1591                  "            ,#=%(#%#%%#%%%C                                                    \n" \ 
    1592                  "         .#%C=,:::::::,,5%#.                                                   \n" \ 
    1593                  "         (#!!,,,,,,,,,,,J7#'                                                   \n" \ 
    1594                  "         =#!(=,,,,,,,,:==(7!                       ,%###!##%'.                 \n" \ 
    1595                  "         .=#(CJ3$#%C7==Š((77                     ,%##%%!#%%%#%*                \n" \ 
    1596                  "       .#(#J#A3#$==7=J=!Š(=3'                 ,%##%%::::,,::%#%, '!(====((!,'. \n" \ 
    1597                  "     ######$@53C=(ŠŠŠŠ==(Š=C7                %##(::::,,,,,::%##A$$3$CCJ3CJC(7C!\n" \ 
    1598                  "   #(###3#'JÐ%J(Š!!!*!!J(((=J'              ,##(:::,,,,,:::%##5%C'           . \n" \ 
    1599                  " .#3#3#$#. C5$C7Š!=ŠŠŠ!7=(Š(7=              ;##(:,,,,,,,::%###%.               \n" \ 
    1600                  " '####*.   7AJC7Š!7Š(ŠŠ!Š((=7C.             |###((,,,,,,,)%##%=C,    .*Š(7!    \n" \ 
    1601                  "           (%7C77!(==!Š!ŠŠ=7=C!             ((%############%!(CCŠ.,ŠJAA%3C'    \n" \ 
    1602                  "           Š$C7C7=Š(=ŠŠŠ((=(=J= ,:%%@M;%%;.77C7(=C!Š!*!Š=!ŠC(777J3$3=!,'.      \n" \ 
    1603                  "           ,%CJJ=C(7(((((=((=JC 7####::###CC=(CC=(=Š(*!=!=Š=7=77JJ,            \n" \ 
    1604                  "           .%J337J==(=7==C=C7C3,##J!::::77#%J=CJ==ŠŠŠ=!=Š===(7C7C*             \n" \ 
    1605                  "            C$33C3C7=7C777CJJJ%7##C:,,,,,:#$3CJC==(=7(ŠŠŠ(=C(J$CJ*             \n" \ 
    1606                  "            '%$333CCC3CCCCCJ%3%#%#$C:,,,:3#AJJ3C7=JC=(((((7C7C3J3!             \n" \ 
    1607                  "             (#$$3JJJ%3J$J33$$AA33#5J:,,:A#$$$JC7CJCC7=(=(CJ$CJJ$,             \n" \ 
    1608                  "              J#%$$%33%$5$A#$%#%CJ3#A%:35#%J3$3JJCCC$C7J77JC$J33$'             \n" \ 
    1609                  "              .75AA%%%$AA%#A%5#%CJC#J###3#J$%3$JJCCJCC3J33$33$$A.              \n" \ 
    1610                  "                =5555A%AA5#5@%,%CJC3J###ACJJ$5$33JJJJJJJJ%%%3%%A%              \n" \ 
    1611                  "                .3@55##A5###='!AJCJJ3###ACJ3A#$$$%$$33333$%%%AA5!              \n" \ 
    1612                  "                 %3J%5Ð5$J='  '533CC3###ACJ$#@A%%%AA$A%$$A%AA55Š               \n" \ 
    1613                  "                 A=(3$A'.      3A3J33###%CJ$Ð#AA55AA%5#AA%%5#5Š                \n" \ 
    1614                  "                .AC=Š$J        'A%$J$A##A33AAÐ555###55#5555#A!                 \n" \ 
    1615         &nbs