-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cpp
45 lines (33 loc) · 1.52 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
#include "main.hpp"
using namespace std;
int main() {
remote::Handle proc = remote::OpenProcess(5388);
if(proc.IsRunning()) {
remote::Module libc = remote::GetModuleHandle(proc, "libpthread-2.19.so");
if(libc.IsValid()) {
// We need to grab symbol list
cout << "libc = " << hex << libc.GetStart() << endl;
}
/*
std::vector<remote::Region> rs = remote::GetRegions(proc.pid);
for(size_t i = 0; i < rs.size(); i++) {
if(!rs[i].filename.empty()) {
std::cout << "Filename: " << rs[i].filename << std::endl;
}
if(!rs[i].pathname.empty()) {
std::cout << "Path: " << rs[i].pathname << std::endl;
}
std::cout << "Start: " << std::hex << rs[i].start << std::endl;
std::cout << "End: " << std::hex << rs[i].end << std::endl;
std::cout << "Permissions: " << rs[i].read << rs[i].write << rs[i].exec << rs[i].shared << std::endl;
std::cout << "Offset: " << std::hex << rs[i].offset << std::endl;
std::cout << "Device: " << std::dec << rs[i].deviceMajor << ":" << rs[i].deviceMinor << std::endl;
std::cout << "INode: " << std::dec << rs[i].inodeFileNumber << std::endl;
std::cout << "-------------------------------------" << std::endl;
}
size_t calc_base = proc.GetModuleAddress("gnome-calculator");
cout << "Calculator Base: " << hex << calc_base << endl;
*/
}
return 0;
}