~ubuntu-branches/ubuntu/lucid/unrar-nonfree/lucid

« back to all changes in this revision

Viewing changes to rarvm.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Meredith
  • Date: 2009-06-06 17:46:05 UTC
  • mfrom: (1.1.11 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090606174605-h4ciqxlpy39jmjx0
Tags: 1:3.9.3-1
* New upstream release
* Updated Copyright file (Closes: #531432)

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 
60
60
struct VM_PreparedProgram
61
61
{
62
 
  VM_PreparedProgram() {AltCmd=NULL;}
 
62
  VM_PreparedProgram() 
 
63
  {
 
64
    AltCmd=NULL;
 
65
    FilteredDataSize=0;
 
66
    CmdCount=0;
 
67
  }
63
68
 
64
69
  Array<VM_PreparedCommand> Cmd;
65
70
  VM_PreparedCommand *AltCmd;
70
75
  uint InitR[7];
71
76
 
72
77
  byte *FilteredData;
73
 
  unsigned int FilteredDataSize;
 
78
  uint FilteredDataSize;
74
79
};
75
80
 
76
81
class RarVM:private BitInput
83
88
#ifdef VM_OPTIMIZE
84
89
    void Optimize(VM_PreparedProgram *Prg);
85
90
#endif
86
 
    bool ExecuteCode(VM_PreparedCommand *PreparedCode,int CodeSize);
 
91
    bool ExecuteCode(VM_PreparedCommand *PreparedCode,uint CodeSize);
87
92
#ifdef VM_STANDARDFILTERS
88
 
    VM_StandardFilters IsStandardFilter(byte *Code,int CodeSize);
 
93
    VM_StandardFilters IsStandardFilter(byte *Code,uint CodeSize);
89
94
    void ExecuteStandardFilter(VM_StandardFilters FilterType);
90
 
    unsigned int FilterItanium_GetBits(byte *Data,int BitPos,int BitCount);
91
 
    void FilterItanium_SetBits(byte *Data,unsigned int BitField,int BitPos,
92
 
      int BitCount);
 
95
    uint FilterItanium_GetBits(byte *Data,int BitPos,int BitCount);
 
96
    void FilterItanium_SetBits(byte *Data,uint BitField,int BitPos,int BitCount);
93
97
#endif
94
98
 
95
99
    byte *Mem;
99
103
    RarVM();
100
104
    ~RarVM();
101
105
    void Init();
102
 
    void Prepare(byte *Code,int CodeSize,VM_PreparedProgram *Prg);
 
106
    void Prepare(byte *Code,uint CodeSize,VM_PreparedProgram *Prg);
103
107
    void Execute(VM_PreparedProgram *Prg);
104
108
    void SetLowEndianValue(uint *Addr,uint Value);
105
 
    void SetMemory(unsigned int Pos,byte *Data,unsigned int DataSize);
 
109
    void SetMemory(uint Pos,byte *Data,uint DataSize);
106
110
    static uint ReadData(BitInput &Inp);
107
111
};
108
112