forked from geohot/eda-reversing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.cc
More file actions
75 lines (61 loc) · 1.71 KB
/
Copy pathCore.cc
File metadata and controls
75 lines (61 loc) · 1.71 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
// Core.cc -- Apr 14, 2009
// by posixninja, geohot
// released under GPLv3, see http://gplv3.fsf.org/
#include "Mailbox.h"
#include <iostream>
#include "Core.h"
#include "macros.h"
using namespace std;
int ParsedInstruction_test();
int File_test();
int InstructionARM_test();
int Memory_test();
namespace eda {
Core::Core() {
info << "where's the Bank at" << endl;
}
Core::Core(Bank* bank) :
mBank(bank) {
}
Core::~Core() {
}
InstructionIterator Core::disassemble(Data addr) {
info << "I am a generic Core, I can't disassemble" << endl;
return InstructionIterator();
}
void Core::fastAnalyse(Data addr, Function *fxn, bool crap) {
info << "I am a generic Core, I can't fastAnalyse" << endl;
return;
}
void Core::update() {
}
void Core::runLoop()
//this is where the Core actually works
//it is event driven completely
{
while (1) {
Mail event = mMail.waitForMail();
if (event.mCommand == CORE_DISASSEMBLE) {
//cout << "disassembling " << event.mParam << endl;
disassemble((Data) event.mParam);
//lexer(event);
} else if (event.mCommand == CORE_ANALYSE) {
fastAnalyse((Data) event.mParam, mBank->mem()->addFunction(
(Data) event.mParam), false);
}
//info << "i've got mail: " << event.mParam << endl;
}
}
void Core::test() {
// From testSuite.cc
/*cout << "running tests. " << endl;
cout << "ParsedInstruction test: "; ParsedInstruction_test();
cout << "File test: "; File_test();
cout << "debug macro test: "; info << "test" << endl;
cout << "InstructionARM test: "; InstructionARM_test();
cout << "Memory test: "; Memory_test();*/
/*Mailbox test;
ConsoleFrontEnd a(&test,0);*/
return;// 0;
}
}