Repository navigation
Expand file tree
/
Copy pathimagefunctions.h
More file actions
123 lines (106 loc) · 2.81 KB
/
Copy pathimagefunctions.h
File metadata and controls
123 lines (106 loc) · 2.81 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef IMAGEFUNCTIONS_H
#define IMAGEFUNCTIONS_H
#include <fcntl.h>
#include <linux/fs.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>
#include <string>
#include <errno.h>
#include <stdio.h>
//#include <openssl/md5.h>
//#include <openssl/evp.h>
#include <cstring>
#include <sstream>
#include <fstream>
#include <libewf.h>
#include <afflib/afflib.h>
#include <aff4/aff4-c.h>
//#include <libsmraw.h>
#include <QString>
#include <QDebug>
#include <QDir>
#include <QDataStream>
#include <QtEndian>
#include <QCryptographicHash>
#include <blake3.h>
#include <lz4.h>
#include <lz4frame.h>
//#include <libbde.h>
#define DTTMFMT "%F %T %z"
#define DTTMSZ 35
class ImageSignals : public QObject
{
Q_OBJECT
public:
ImageSignals() { };
~ImageSignals() { };
quint8 cancelverify = 0;
void VerUpd(QString imgname, qint64 bytesread) { emit(VerUpdate(imgname, bytesread)); }
//void ProgUpd(void) { emit(ProgressUpdate(filesfound)); }
signals:
void VerUpdate(QString imgname, qint64 bytesread);
//void CancelVerify(quint8 vercancel);
//void ProgressUpdate(qint64 filecount);
private slots:
void StopVerify(quint8 stopverify) { cancelverify = stopverify; };
};
extern ImageSignals* imgsignals;
static char* GetDateTime(char *buff)
{
time_t t = time(0);
strftime(buff, DTTMSZ, DTTMFMT, localtime(&t));
return buff;
};
void FindNextFrame(qint64 initialindex, QList<qint64>* framelist, QFile* wfi);
unsigned long long GetTotalBytes(std::string infile);
void ReadBytes(std::string infile, std::string outfile, std::string footstr);
std::string Verify(QString outstr);
void StartImaging(std::string instr, std::string outpath, std::string outstr, std::string footstr, int radio);
class ForImg : public QIODevice
{
public:
ForImg(QString imgfile);
~ForImg();
QByteArray ReadContent(qint64 pos, qint64 size);
qint64 Size();
QString ImgPath();
QString MountPath();
void SetMountPath(QString mountpath);
int8_t ImgType();
protected:
qint64 readData(char* data, qint64 maxsize)
{
return maxsize;
};
qint64 writeData(const char* data, qint64 maxsize)
{
return maxsize;
};
private:
off64_t imgsize = 0;
qint64 imgoffset = 0;
QString imgpath = "";
QString mntpath = "";
//int imgtype = 15;
int8_t imgtype = -1;
uint8_t hashtype = 0;
int blake3hash = 0;
QList<qint64> framelist;
};
/*
class MyIODevice : public QIODevice
{
public:
MyIODevice(QString imgfile);
~MyIODevice();
qint64 readData(char *data, qint64 maxSize);
qint64 writeData(char* data, qint64 maxSize);
private:
qint64 imgoffset = 0;
QString imgpath = "";
int imgtype = -1;
qint64 imgsize = 0;
};
*/
#endif // IMAGEFUNCTIONS_H