home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 242 / Issue 242 - April 2008 - DPCS0408DVD.ISO / Open Source / AutoHotKey / Source / AutoHotkey104705_source.exe / source / lib / exearc_read.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-21  |  1.3 KB  |  57 lines

  1. #ifndef __HS_EXEARC_READ_H
  2. #define __HS_EXEARC_READ_H
  3.  
  4. //
  5. // exearc_read.h
  6. // (c)2002 Jonathan Bennett (jon@hiddensoft.com)
  7. //
  8. // Version: v3
  9. //
  10. // STANDALONE CLASS
  11. //
  12.  
  13. #define HS_EXEARC_FILEVERSION        3            // File wrapper version
  14.  
  15. // Error codes
  16. #define HS_EXEARC_E_OK                0
  17. #define HS_EXEARC_E_OPENEXE            1
  18. #define HS_EXEARC_E_OPENINPUT        2        
  19. #define HS_EXEARC_E_NOTARC            3
  20. #define HS_EXEARC_E_BADVERSION        4
  21. #define HS_EXEARC_E_BADPWD            5
  22. #define HS_EXEARC_E_FILENOTFOUND    6
  23. #define HS_EXEARC_E_OPENOUTPUT        7        
  24. #define HS_EXEARC_E_MEMALLOC        8
  25.  
  26. #define HS_EXEARC_MAXPWDLEN            256
  27.  
  28.  
  29. class HS_EXEArc_Read
  30. {
  31. public:
  32.     // Functions
  33.     int        Open(const char *szEXEArcFile, const char *szPwd);
  34.     void    Close(void);
  35.     int        FileExtract(const char *szFileID, const char *szFileName);
  36.     int        FileExtractToMem(const char *szFileID, UCHAR **lpData, ULONG *nDataSize);
  37.     int        FileGetFullPath(const char *szFileID, char *szFilename);
  38.  
  39.  
  40. private:
  41.     // Variables
  42.     FILE    *m_fEXE;
  43.     ULONG    m_nArchivePtr;
  44.     ULONG    m_nFileSectionPtr;
  45.     char    m_szPwd[HS_EXEARC_MAXPWDLEN+1];
  46.     UINT    m_nPwdHash;
  47.  
  48.     // Functions
  49.     void    Decrypt(UCHAR *bData, UINT nLen, UINT nSeed);
  50.     int        FileFind(const char *szFileID, char *szFilename);
  51.     void    FileSetTime(const char *szFilename, FILETIME &ftCreated, FILETIME &ftModified);
  52.  
  53. };
  54.  
  55.  
  56. #endif
  57.