forked from mansoor-s/Linux-Memory-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
56 lines (49 loc) · 1.04 KB
/
main.cpp
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
#include <QtGui/QApplication>
#include <QCleanlooksStyle>
#include <typeinfo>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "mainwindow.h"
#include "Memory.h"
#include "VMA.h"
//#define _XOPEN_SOURCE 500
#define _FILE_OFFSET_BITS 64
void readmem();
unsigned int main(int argc, char *argv[])
{
//readmem();
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
return 0;
}
/*
void readmem()
{
int wantedLocations = REGION_ALL;
Memory mem(8115);
mem.attach();
std::vector<VMA>* regions= new std::vector<VMA>;
mem.vmaList(regions, wantedLocations);
unsigned char* buffer = new unsigned char[256];
int HANDLE= open("/proc/8115/mem", O_RDONLY);
for(int i= 0; i < 500; i++)
{
printf("||");
VMA tt= regions->at(i);
unsigned long addr= tt.baseAddr();
for(int k= 0; k < tt.size() - 4; k+= 4)
{
addr+= 4;
if(pread(HANDLE, buffer, 4, addr) == -1)
{
printf("Failed to read this is why: %s\n", strerror(errno));
}
//printf("%s", buffer);
}
}
mem.detach();
}
*/