-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainthread.cpp
More file actions
43 lines (32 loc) · 852 Bytes
/
mainthread.cpp
File metadata and controls
43 lines (32 loc) · 852 Bytes
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
#include "mainthread.h"
#include "process.h"
#include "elflibrary.h"
using namespace std;
extern char **environ;
MainThread::MainThread(LineProcess* process)
: LineThread(process)
{
}
MainThread::~MainThread()
{
}
void MainThread::entry(int argc, char** argv, char** env)
{
map<string, ElfLibrary*> libs = m_process->getExec()->getLibraries();
//singleStep(true);
m_process->getExec()->relocateLibrariesIFuncs();
map<string, ElfLibrary*>::iterator it;
for (it = libs.begin(); it != libs.end(); it++)
{
if (it->first != "libpthread.so.0")
{
it->second->entry(argc, argv, env);
}
}
if (m_process->getLine()->getConfigTrace())
{
singleStep(true);
}
// Execute the ELF (Note, no Elves were harmed...)
m_process->getExec()->entry(argc, argv, env);
}