forked from floaterxk/DatDefragAC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBTree.h
66 lines (47 loc) · 1.02 KB
/
BTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
class BlockLoader;
struct BTEntry_t
{
BTEntry_t()
{
m_FileID = 0;
m_BlockHead = 0;
m_FileLength = 0;
}
DWORD m_Unknown00;
DWORD m_FileID;
DWORD m_BlockHead;
DWORD m_FileLength;
DWORD m_TimeStamp;
DWORD m_Unknown14;
};
class BTree
{
public:
BTree(BlockLoader *);
~BTree();
BOOL Load(DWORD TreePos, float ProgressBase = 0, float ProgressDelta = 100.0f);
DWORD GetTotalEntries();
DWORD GetTotalBranches();
BOOL CopyFiles(float ProgressBase = 0, float ProgressDelta = 100.0f);
BOOL CopyTreeData(float ProgressBase = 0, float ProgressDelta = 100.0f);
BYTE* NodeDataPtr();
DWORD NodeDataSize();
DWORD BlocksNeededForNode();
BOOL AssignNodePositions(DWORD *pdwOffset);
private:
BOOL ReadTree();
HANDLE m_hFile;
DWORD m_TreePos;
BlockLoader *m_pBlockLoader;
struct TreeData {
DWORD SPACER;
DWORD m_Branches[0x3E];
DWORD m_EntryCount;
BTEntry_t m_Entries[0x3D];
} m_TreeData;
BTree* m_pBranches[0x3E];
BOOL m_bLeaf;
// After defragmenting, the new info..
DWORD m_TargetTreePos;
};