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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Patch.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.9.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center>
<hr><h1>Patch.hpp</h1><div class="fragment"><pre>00001 <font class="comment">/*</font>
00002 <font class="comment"> * Patch.hpp:</font>
00003 <font class="comment"> * representation of a kernel patch.</font>
00004 <font class="comment"> * written by palmers / teso</font>
00005 <font class="comment"> */</font>
00006 <font class="preprocessor">#ifndef __PATCH_C</font>
00007 <font class="preprocessor"></font><font class="preprocessor">#define __PATCH_C</font>
00008 <font class="preprocessor"></font>
00009 <font class="preprocessor">#include <rwKernel.hpp></font>
00010 <font class="preprocessor">#include <SymbolTable.hpp></font>
00011 <font class="preprocessor">#include <SystemMap.hpp></font>
00012 <font class="preprocessor">#include <stoi16.hpp></font>
00013 <font class="preprocessor">#include <itos16.hpp></font>
00014 <font class="preprocessor">#include <utility></font>
00015 <font class="preprocessor">#include <functional></font>
00016 <font class="preprocessor">#include <algorithm></font>
00017 <font class="preprocessor">#include <list></font>
00018 <font class="preprocessor">#include <fstream></font>
00019 <font class="preprocessor">#include <string></font>
00020 <font class="preprocessor">#include <name2add.h></font>
00021
00022
00023 <font class="keyword">typedef</font> pair<unsigned int, unsigned int> Addr2Addr;
00024 <font class="keyword">typedef</font> list<Addr2Addr *> Addr2AddrList;
00025
00026 Addr2AddrList *genReplaceValMap (<a class="code" href="classSymbolTable.html">SymbolTable</a> *st);
00027 <font class="keywordtype">void</font> genDummyValMap ();
00028 <font class="keyword">extern</font> <a class="code" href="classSystemMap.html">SystemMap</a> DummyValMap;
00029
00030
00031 <font class="preprocessor">#define CLEAN 1</font>
00032 <font class="preprocessor"></font><font class="preprocessor">#define LINKED 2</font>
00033 <font class="preprocessor"></font><font class="preprocessor">#define APPLIED 4</font>
00034 <font class="preprocessor"></font><font class="preprocessor">#define LFAILED 8</font>
00035 <font class="preprocessor"></font><font class="preprocessor">#define AFAILED 16</font>
00036 <font class="preprocessor"></font>
00037
<a name="l00050"></a><a class="code" href="classPatch.html">00050</a> <font class="keyword">class </font><a class="code" href="classPatch.html">Patch</a>
00051 {
00052 <font class="keyword">private</font>:
00053 <font class="keywordtype">int</font> state;
00054 <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font> len;
00055 <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *back_data, *data, *overwr;
00056 <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> address;
00057 <a class="code" href="classrwKernel.html">rwKernel</a> *local_rw;
00058
00059 <font class="keywordtype">bool</font> initObjects (<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *, <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font>, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font>, <a class="code" href="classrwKernel.html">rwKernel</a> *);
00060 string state2string ();
00061 <font class="keywordtype">void</font> string2state (string);
00062 string data2string (<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *);
00063 <font class="keywordtype">void</font> string2data (string, <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *);
00064 <font class="keywordtype">void</font> parse (string);
00065
00066 <font class="keyword">public</font>:
00070 <a class="code" href="classPatch.html#a0">Patch</a> ();
00071
00078 <a class="code" href="classPatch.html#a0">Patch</a> (<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *data, <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font> len, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> addr);
00079
00085 <a class="code" href="classPatch.html#a0">Patch</a> (<font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *data, <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font> len, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> addr, <a class="code" href="classrwKernel.html">rwKernel</a> *x);
00086
00091 <a class="code" href="classPatch.html#a0">Patch</a> (string);
00092
00097 <a class="code" href="classPatch.html#a0">Patch</a> (string, <a class="code" href="classrwKernel.html">rwKernel</a> *);
00098
00102 <a class="code" href="classPatch.html#a5">~Patch</a> ();
00103
00104
00108 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a6">initFromString</a> (string);
00109
00113 string <a class="code" href="classPatch.html#a7">getPatchAsString</a> ();
00114
00119 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a8">wasChanged</a> ();
00120
00124 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a9">isLinked</a> ();
00125
00129 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a10">isApplied</a> ();
00130
00134 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a11">isFailed</a> ();
00135
00139 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a12">isClean</a> ();
00140
00144 <font class="keywordtype">int</font> <a class="code" href="classPatch.html#a13">getState</a> ();
00145
00149 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a14">restore</a> ();
00150
00154 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a15">remove</a> ();
00155
00159 <font class="keywordtype">bool</font> <a class="code" href="classPatch.html#a15">remove</a> (<a class="code" href="classrwKernel.html">rwKernel</a> *);
00160
00164 <font class="keywordtype">unsigned</font> <font class="keywordtype">char</font> *<a class="code" href="classPatch.html#a17">getData</a> ();
00165
00171 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a19">apply</a> (<a class="code" href="classrwKernel.html">rwKernel</a> *);
00172
00177 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a19">apply</a> ();
00178
00182 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a20">link</a> (Addr2AddrList *);
00183
00192 <font class="keywordtype">void</font> <a class="code" href="classPatch.html#a21">dump</a> (string file);
00193
00197 <font class="keyword">friend</font> istream& <a class="code" href="classPatch.html#l0">operator>> </a>(istream&, <a class="code" href="classPatch.html">Patch</a>&);
00198
00202 <font class="keyword">friend</font> ostream& <a class="code" href="classPatch.html#l1">operator<< </a>(ostream&, <a class="code" href="classPatch.html">Patch</a>&);
00203 };
00204 <font class="preprocessor">#endif </font><font class="comment">/* __PATCH_C */</font>
</pre></div><hr><address><small>Generated at Tue Aug 14 18:04:51 2001 for Kermit by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.9.1 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
© 1997-2001</small></address>
</body>
</html>
|