Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef _RAR_VM_ |
2 | | #define _RAR_VM_ |
3 | | |
4 | 52.4k | #define VM_MEMSIZE 0x40000 |
5 | 0 | #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 | 73.6k | { |
16 | 73.6k | FilteredDataSize=0; |
17 | 73.6k | Type=VMSF_NONE; |
18 | 73.6k | } |
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 |