"Fossies" - the Fresh Open Source Software Archive

Member "unrar/rarvm.hpp" (4 May 2022, 985 Bytes) of package /linux/misc/unrarsrc-6.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "rarvm.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _RAR_VM_
    2 #define _RAR_VM_
    3 
    4 #define VM_MEMSIZE                  0x40000
    5 #define VM_MEMMASK           (VM_MEMSIZE-1)
    6 
    7 enum VM_StandardFilters {
    8   VMSF_NONE, VMSF_E8, VMSF_E8E9, VMSF_ITANIUM, VMSF_RGB, VMSF_AUDIO, 
    9   VMSF_DELTA
   10 };
   11 
   12 struct VM_PreparedProgram
   13 {
   14   VM_PreparedProgram() 
   15   {
   16     FilteredDataSize=0;
   17     Type=VMSF_NONE;
   18   }
   19   VM_StandardFilters Type;
   20   uint InitR[7];
   21   byte *FilteredData;
   22   uint FilteredDataSize;
   23 };
   24 
   25 class RarVM
   26 {
   27   private:
   28     bool ExecuteStandardFilter(VM_StandardFilters FilterType);
   29     uint FilterItanium_GetBits(byte *Data,uint BitPos,uint BitCount);
   30     void FilterItanium_SetBits(byte *Data,uint BitField,uint BitPos,uint BitCount);
   31 
   32     byte *Mem;
   33     uint R[8];
   34   public:
   35     RarVM();
   36     ~RarVM();
   37     void Init();
   38     void Prepare(byte *Code,uint CodeSize,VM_PreparedProgram *Prg);
   39     void Execute(VM_PreparedProgram *Prg);
   40     void SetMemory(size_t Pos,byte *Data,size_t DataSize);
   41     static uint ReadData(BitInput &Inp);
   42 };
   43 
   44 #endif