##// END OF EJS Templates
ElfFile classes WIP.
jeandet -
r35:f6b4da9a999c default
parent child
Show More
@@ -0,0 +1,14
1 #include "elffilewidget.h"
2 #include "ui_elffilewidget.h"
3
4 elfFileWidget::elfFileWidget(QWidget *parent) :
5 QWidget(parent),
6 ui(new Ui::elfFileWidget)
7 {
8 ui->setupUi(this);
9 }
10
11 elfFileWidget::~elfFileWidget()
12 {
13 delete ui;
14 }
@@ -0,0 +1,22
1 #ifndef ELFFILEWIDGET_H
2 #define ELFFILEWIDGET_H
3
4 #include <QWidget>
5
6 namespace Ui {
7 class elfFileWidget;
8 }
9
10 class elfFileWidget : public QWidget
11 {
12 Q_OBJECT
13
14 public:
15 explicit elfFileWidget(QWidget *parent = 0);
16 ~elfFileWidget();
17
18 private:
19 Ui::elfFileWidget *ui;
20 };
21
22 #endif // ELFFILEWIDGET_H
@@ -0,0 +1,80
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>elfFileWidget</class>
4 <widget class="QWidget" name="elfFileWidget">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>622</width>
10 <height>398</height>
11 </rect>
12 </property>
13 <property name="minimumSize">
14 <size>
15 <width>0</width>
16 <height>0</height>
17 </size>
18 </property>
19 <property name="focusPolicy">
20 <enum>Qt::NoFocus</enum>
21 </property>
22 <property name="windowTitle">
23 <string>Form</string>
24 </property>
25 <layout class="QGridLayout" name="gridLayout">
26 <item row="0" column="0">
27 <widget class="QTabWidget" name="tabWidget">
28 <property name="currentIndex">
29 <number>0</number>
30 </property>
31 <widget class="QWidget" name="generalInfoTab">
32 <attribute name="title">
33 <string>General Informations</string>
34 </attribute>
35 </widget>
36 <widget class="QWidget" name="symbolsTab">
37 <attribute name="title">
38 <string>Symbols</string>
39 </attribute>
40 <layout class="QGridLayout" name="gridLayout_2">
41 <item row="0" column="0">
42 <widget class="QTableWidget" name="symbolsList"/>
43 </item>
44 </layout>
45 </widget>
46 <widget class="QWidget" name="sectionsTab">
47 <attribute name="title">
48 <string>Sections</string>
49 </attribute>
50 <layout class="QGridLayout" name="gridLayout_3">
51 <item row="0" column="0">
52 <widget class="QHexEdit" name="sectionsHexView" native="true">
53 <property name="minimumSize">
54 <size>
55 <width>100</width>
56 <height>0</height>
57 </size>
58 </property>
59 </widget>
60 </item>
61 <item row="0" column="1">
62 <widget class="QTableWidget" name="sectionsList"/>
63 </item>
64 </layout>
65 </widget>
66 </widget>
67 </item>
68 </layout>
69 </widget>
70 <customwidgets>
71 <customwidget>
72 <class>QHexEdit</class>
73 <extends>QWidget</extends>
74 <header location="global">qhexedit.h</header>
75 <container>1</container>
76 </customwidget>
77 </customwidgets>
78 <resources/>
79 <connections/>
80 </ui>
@@ -31,31 +31,6 abstractExecFile::abstractExecFile(const
31
31
32 }
32 }
33
33
34 bool abstractExecFile::openFile(const QString &File)
35 {
36
37 }
38
39 bool abstractExecFile::isopened()
40 {
41
42 }
43
44 int abstractExecFile::setFilename(const QString &name)
45 {
46
47 }
48
49 int abstractExecFile::closeFile()
50 {
51
52 }
53
54 QList<codeFragment> abstractExecFile::getFragments()
55 {
56
57 }
58
59
34
60 codeFragment::codeFragment()
35 codeFragment::codeFragment()
61 {
36 {
@@ -39,15 +39,16 class abstractExecFile : public QObject
39 public:
39 public:
40 abstractExecFile(QObject *parent = 0);
40 abstractExecFile(QObject *parent = 0);
41 abstractExecFile(const QString& File,QObject *parent = 0);
41 abstractExecFile(const QString& File,QObject *parent = 0);
42 virtual bool openFile(const QString& File);
42 virtual bool openFile(const QString& File)=0;
43 virtual bool isopened();
43 virtual bool isopened()=0;
44 virtual int setFilename(const QString& name);
44 virtual int closeFile()=0;
45 virtual int closeFile();
45 virtual QList<codeFragment> getFragments()=0;
46 virtual QList<codeFragment> getFragments();
47 signals:
46 signals:
48
47
49 public slots:
48 public slots:
50
49
50 protected:
51 QString p_fileName;
51 };
52 };
52
53
53 #endif // ABSTRACTEXECFILE_H
54 #endif // ABSTRACTEXECFILE_H
@@ -83,7 +83,8 HEADERS += \
83 elf/elffile.h \
83 elf/elffile.h \
84 qipdialogbox.h \
84 qipdialogbox.h \
85 PySocExplorer.h \
85 PySocExplorer.h \
86 SocExplorerPlot.h
86 SocExplorerPlot.h \
87 elf/elffilewidget.h
87
88
88
89
89 SOURCES += \
90 SOURCES += \
@@ -101,7 +102,11 SOURCES += \
101 abstractexecfile.cpp \
102 abstractexecfile.cpp \
102 elf/elffile.cpp \
103 elf/elffile.cpp \
103 qipdialogbox.cpp \
104 qipdialogbox.cpp \
104 SocExplorerPlot.cpp
105 SocExplorerPlot.cpp \
106 elf/elffilewidget.cpp
107
108 FORMS += \
109 elf/elffilewidget.ui
105
110
106
111
107
112
@@ -16,8 +16,10
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author :
20 -- Mail : alexis.jeandet@member.fsf.org
20 Alexis Jeandet
21 -- Mail :
22 alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
23 ----------------------------------------------------------------------------*/
22 #include "elffile.h"
24 #include "elffile.h"
23
25
@@ -27,6 +29,76 ElfFile::ElfFile(QObject *parent) :
27 }
29 }
28
30
29 ElfFile::ElfFile(const QString &File, QObject *parent)
31 ElfFile::ElfFile(const QString &File, QObject *parent)
32 :abstractExecFile(parent)
30 {
33 {
34 this->p_fileName = File;
35 parser.setFilename(File);
36 }
37
38 bool ElfFile::openFile(const QString &File)
39 {
40 this->p_fileName = File;
41 parser.setFilename(File);
42 }
43
44 bool ElfFile::isopened()
45 {
46 return parser.isopened();
47 }
48
49 int ElfFile::closeFile()
50 {
51 return parser.closeFile();
52 }
53
54 QList<codeFragment> ElfFile::getFragments()
55 {
56 QList<codeFragment> fragments;
57 if (parser.isopened())
58 {
59 fragments.append(getFragment(".text"));
60 fragments.append(getFragment(".data"));
61 }
62 }
63
64 QList<codeFragment> ElfFile::getFragments(QStringList fragmentList)
65 {
66 QList<codeFragment> fragments;
67 if (parser.isopened())
68 {
69 for(int i =0;i<fragmentList.count();i++)
70 {
71 fragments.append(getFragment(fragmentList.at(i)));
72 }
73 }
74 }
75
76 codeFragment ElfFile::getFragment(const QString &name)
77 {
78 codeFragment fragment;
79 for(int i=0;i<parser.getSectioncount();i++)
80 {
81 if(parser.getSectionName(i) == name)
82 {
83 fragment.data =NULL;
84 fragment.size = parser.getSectionDatasz(i);
85 fragment.address = parser.getSectionPaddr(i);
86 parser.getSectionData(i,&fragment.data);
87 }
88 }
31
89
32 }
90 }
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@@ -21,6 +21,9
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include <abstractexecfile.h>
22 #include <abstractexecfile.h>
23 #include <elf.h>
23 #include <elf.h>
24 #include "elfparser.h"
25 #include <QStringList>
26
24 #ifndef ELFFILE_H
27 #ifndef ELFFILE_H
25 #define ELFFILE_H
28 #define ELFFILE_H
26
29
@@ -30,10 +33,17 class ElfFile : public abstractExecFile
30 public:
33 public:
31 ElfFile(QObject *parent = 0);
34 ElfFile(QObject *parent = 0);
32 ElfFile(const QString& File,QObject *parent = 0);
35 ElfFile(const QString& File,QObject *parent = 0);
33
36 bool openFile(const QString& File);
37 bool isopened();
38 int closeFile();
39 QList<codeFragment> getFragments();
40 QList<codeFragment> getFragments(QStringList fragmentList);
34 signals:
41 signals:
35
42
36 public slots:
43 public slots:
44 private:
45 elfparser parser;
46 codeFragment getFragment(const QString& name);
37
47
38 };
48 };
39
49
@@ -25,236 +25,254
25 #include <fcntl.h>
25 #include <fcntl.h>
26 #include <unistd.h>
26 #include <unistd.h>
27
27
28 void elfresolveMachine(Elf64_Half e_machine,char* MachineName)
28 QString elfresolveMachine(Elf64_Half e_machine)
29 {
29 {
30
30 QString machineName;
31 //Update from with bash script don't write it by yourself!
31 //Update from with bash script don't write it by yourself!
32 switch(e_machine)
32 switch(e_machine)
33 {
33 {
34 case EM_NONE :
34 case EM_NONE:
35 strcpy(MachineName,"No machine");
35 machineName = " No machine ";
36 break;
36 break;
37 case EM_M32 :
37 case EM_M32:
38 strcpy(MachineName,"AT&T WE 32100");
38 machineName = " AT&T WE 32100 ";
39 break;
39 break;
40 case EM_SPARC :
40 case EM_SPARC:
41 strcpy(MachineName,"SUN SPARC");
41 machineName = " SUN SPARC ";
42 break;
42 break;
43 case EM_386 :
43 case EM_386:
44 strcpy(MachineName,"Intel 80386");
44 machineName = " Intel 80386 ";
45 break;
45 break;
46 case EM_68K :
46 case EM_68K:
47 strcpy(MachineName,"Motorola m68k family");
47 machineName = " Motorola m68k family ";
48 break;
48 break;
49 case EM_88K :
49 case EM_88K:
50 strcpy(MachineName,"Motorola m88k family");
50 machineName = " Motorola m88k family ";
51 break;
51 break;
52 case EM_860 :
52 case EM_860:
53 strcpy(MachineName,"Intel 80860");
53 machineName = " Intel 80860 ";
54 break;
54 break;
55 case EM_MIPS :
55 case EM_MIPS:
56 strcpy(MachineName,"MIPS R3000 big-endian");
56 machineName = " MIPS R3000 big-endian ";
57 break;
57 break;
58 case EM_S370 :
58 case EM_S370:
59 strcpy(MachineName,"IBM System\/370");
59 machineName = " IBM System/370 ";
60 break;
60 break;
61 case EM_MIPS_RS3_LE :
61 case EM_MIPS_RS3_LE:
62 strcpy(MachineName,"MIPS R3000 little-endian");
62 machineName = " MIPS R3000 little-endian ";
63 break;
63 break;
64 case EM_PARISC :
64 case EM_PARISC:
65 strcpy(MachineName,"HPPA");
65 machineName = " HPPA ";
66 break;
66 break;
67 case EM_VPP500 :
67 case EM_VPP500:
68 strcpy(MachineName,"Fujitsu VPP500");
68 machineName = " Fujitsu VPP500 ";
69 break;
69 break;
70 case EM_SPARC32PLUS :
70 case EM_SPARC32PLUS:
71 strcpy(MachineName,"Sun's \"v8plus\"");
71 machineName = " Sun's \"v8plus\" ";
72 break;
73 case EM_960:
74 machineName = " Intel 80960 ";
72 break;
75 break;
73 case EM_960 :
76 case EM_PPC:
74 strcpy(MachineName,"Intel 80960");
77 machineName = " PowerPC ";
75 break;
78 break;
76 case EM_PPC :
79 case EM_PPC64:
77 strcpy(MachineName,"PowerPC");
80 machineName = " PowerPC 64-bit ";
78 break;
81 break;
79 case EM_PPC64 :
82 case EM_S390:
80 strcpy(MachineName,"PowerPC 64-bit");
83 machineName = " IBM S390 ";
81 break;
84 break;
82 case EM_S390 :
85 case EM_V800:
83 strcpy(MachineName,"IBM S390");
86 machineName = " NEC V800 series ";
84 break;
87 break;
85 case EM_V800 :
88 case EM_FR20:
86 strcpy(MachineName,"NEC V800 series");
89 machineName = " Fujitsu FR20 ";
87 break;
90 break;
88 case EM_FR20 :
91 case EM_RH32:
89 strcpy(MachineName,"Fujitsu FR20");
92 machineName = " TRW RH-32 ";
90 break;
93 break;
91 case EM_RH32 :
94 case EM_RCE:
92 strcpy(MachineName,"TRW RH-32");
95 machineName = " Motorola RCE ";
93 break;
96 break;
94 case EM_RCE :
97 case EM_ARM:
95 strcpy(MachineName,"Motorola RCE");
98 machineName = " ARM ";
96 break;
99 break;
97 case EM_ARM :
100 case EM_FAKE_ALPHA:
98 strcpy(MachineName,"ARM");
101 machineName = " Digital Alpha ";
102 break;
103 case EM_SH:
104 machineName = " Hitachi SH ";
99 break;
105 break;
100 case EM_SH :
106 case EM_SPARCV9:
101 strcpy(MachineName,"Hitachi SH");
107 machineName = " SPARC v9 64-bit ";
102 break;
108 break;
103 case EM_SPARCV9 :
109 case EM_TRICORE:
104 strcpy(MachineName,"SPARC v9 64-bit");
110 machineName = " Siemens Tricore ";
105 break;
111 break;
106 case EM_TRICORE :
112 case EM_ARC:
107 strcpy(MachineName,"Siemens Tricore");
113 machineName = " Argonaut RISC Core ";
108 break;
114 break;
109 case EM_ARC :
115 case EM_H8_300:
110 strcpy(MachineName,"Argonaut RISC Core");
116 machineName = " Hitachi H8/300 ";
111 break;
117 break;
112 case EM_H8_300 :
118 case EM_H8_300H:
113 strcpy(MachineName,"Hitachi H8\/300");
119 machineName = " Hitachi H8/300H ";
114 break;
120 break;
115 case EM_H8_300H :
121 case EM_H8S:
116 strcpy(MachineName,"Hitachi H8\/300H");
122 machineName = " Hitachi H8S ";
117 break;
123 break;
118 case EM_H8S :
124 case EM_H8_500:
119 strcpy(MachineName,"Hitachi H8S");
125 machineName = " Hitachi H8/500 ";
120 break;
126 break;
121 case EM_H8_500 :
127 case EM_IA_64:
122 strcpy(MachineName,"Hitachi H8\/500");
128 machineName = " Intel Merced ";
123 break;
129 break;
124 case EM_IA_64 :
130 case EM_MIPS_X:
125 strcpy(MachineName,"Intel Merced");
131 machineName = " Stanford MIPS-X ";
132 break;
133 case EM_COLDFIRE:
134 machineName = " Motorola Coldfire ";
126 break;
135 break;
127 case EM_MIPS_X :
136 case EM_68HC12:
128 strcpy(MachineName,"Stanford MIPS-X");
137 machineName = " Motorola M68HC12 ";
129 break;
138 break;
130 case EM_COLDFIRE :
139 case EM_MMA:
131 strcpy(MachineName,"Motorola Coldfire");
140 machineName = " Fujitsu MMA Multimedia Accelerator";
132 break;
141 break;
133 case EM_68HC12 :
142 case EM_PCP:
134 strcpy(MachineName,"Motorola M68HC12");
143 machineName = " Siemens PCP ";
135 break;
144 break;
136 case EM_MMA :
145 case EM_NCPU:
137 strcpy(MachineName,"Fujitsu MMA Multimedia Accelerator");
146 machineName = " Sony nCPU embeeded RISC ";
138 break;
147 break;
139 case EM_PCP :
148 case EM_NDR1:
140 strcpy(MachineName,"Siemens PCP");
149 machineName = " Denso NDR1 microprocessor ";
141 break;
150 break;
142 case EM_NCPU :
151 case EM_STARCORE:
143 strcpy(MachineName,"Sony nCPU embeeded RISC");
152 machineName = " Motorola Start*Core processor ";
144 break;
153 break;
145 case EM_NDR1 :
154 case EM_ME16:
146 strcpy(MachineName,"Denso NDR1 microprocessor");
155 machineName = " Toyota ME16 processor ";
147 break;
156 break;
148 case EM_STARCORE :
157 case EM_ST100:
149 strcpy(MachineName,"Motorola Start*Core processor");
158 machineName = " STMicroelectronic ST100 processor ";
150 break;
159 break;
151 case EM_ME16 :
160 case EM_TINYJ:
152 strcpy(MachineName,"Toyota ME16 processor");
161 machineName = " Advanced Logic Corp. Tinyj emb.fam";
162 break;
163 case EM_X86_64:
164 machineName = " AMD x86-64 architecture ";
153 break;
165 break;
154 case EM_ST100 :
166 case EM_PDSP:
155 strcpy(MachineName,"STMicroelectronic ST100 processor");
167 machineName = " Sony DSP Processor ";
156 break;
168 break;
157 case EM_TINYJ :
169 case EM_FX66:
158 strcpy(MachineName,"Advanced Logic Corp. Tinyj emb.fam");
170 machineName = " Siemens FX66 microcontroller ";
159 break;
171 break;
160 case EM_X86_64 :
172 case EM_ST9PLUS:
161 strcpy(MachineName,"AMD x86-64 architecture");
173 machineName = " STMicroelectronics ST9+ 8/16 mc ";
162 break;
174 break;
163 case EM_PDSP :
175 case EM_ST7:
164 strcpy(MachineName,"Sony DSP Processor");
176 machineName = " STmicroelectronics ST7 8 bit mc ";
165 break;
177 break;
166 case EM_FX66 :
178 case EM_68HC16:
167 strcpy(MachineName,"Siemens FX66 microcontroller");
179 machineName = " Motorola MC68HC16 microcontroller ";
168 break;
180 break;
169 case EM_ST9PLUS :
181 case EM_68HC11:
170 strcpy(MachineName,"STMicroelectronics ST9+ 8\/16 mc");
182 machineName = " Motorola MC68HC11 microcontroller ";
171 break;
183 break;
172 case EM_ST7 :
184 case EM_68HC08:
173 strcpy(MachineName,"STmicroelectronics ST7 8 bit mc");
185 machineName = " Motorola MC68HC08 microcontroller ";
174 break;
186 break;
175 case EM_68HC16 :
187 case EM_68HC05:
176 strcpy(MachineName,"Motorola MC68HC16 microcontroller");
188 machineName = " Motorola MC68HC05 microcontroller ";
177 break;
189 break;
178 case EM_68HC11 :
190 case EM_SVX:
179 strcpy(MachineName,"Motorola MC68HC11 microcontroller");
191 machineName = " Silicon Graphics SVx ";
192 break;
193 case EM_ST19:
194 machineName = " STMicroelectronics ST19 8 bit mc ";
180 break;
195 break;
181 case EM_68HC08 :
196 case EM_VAX:
182 strcpy(MachineName,"Motorola MC68HC08 microcontroller");
197 machineName = " Digital VAX ";
183 break;
198 break;
184 case EM_68HC05 :
199 case EM_CRIS:
185 strcpy(MachineName,"Motorola MC68HC05 microcontroller");
200 machineName = " Axis Communications 32-bit embedded processor ";
186 break;
201 break;
187 case EM_SVX :
202 case EM_JAVELIN:
188 strcpy(MachineName,"Silicon Graphics SVx");
203 machineName = " Infineon Technologies 32-bit embedded processor ";
189 break;
204 break;
190 case EM_ST19 :
205 case EM_FIREPATH:
191 strcpy(MachineName,"STMicroelectronics ST19 8 bit mc");
206 machineName = " Element 14 64-bit DSP Processor ";
192 break;
207 break;
193 case EM_VAX :
208 case EM_ZSP:
194 strcpy(MachineName,"Digital VAX");
209 machineName = " LSI Logic 16-bit DSP Processor ";
195 break;
210 break;
196 case EM_CRIS :
211 case EM_MMIX:
197 strcpy(MachineName,"Axis Communications 32-bit embedded processor");
212 machineName = " Donald Knuth's educational 64-bit processor ";
198 break;
213 break;
199 case EM_JAVELIN :
214 case EM_HUANY:
200 strcpy(MachineName,"Infineon Technologies 32-bit embedded processor");
215 machineName = " Harvard University machine-independent object files ";
201 break;
216 break;
202 case EM_FIREPATH :
217 case EM_PRISM:
203 strcpy(MachineName,"Element 14 64-bit DSP Processor");
218 machineName = " SiTera Prism ";
204 break;
219 break;
205 case EM_ZSP :
220 case EM_AVR:
206 strcpy(MachineName,"LSI Logic 16-bit DSP Processor");
221 machineName = " Atmel AVR 8-bit microcontroller ";
222 break;
223 case EM_FR30:
224 machineName = " Fujitsu FR30 ";
207 break;
225 break;
208 case EM_MMIX :
226 case EM_D10V:
209 strcpy(MachineName,"Donald Knuth's educational 64-bit processor");
227 machineName = " Mitsubishi D10V ";
210 break;
228 break;
211 case EM_HUANY :
229 case EM_D30V:
212 strcpy(MachineName,"Harvard University machine-independent object files");
230 machineName = " Mitsubishi D30V ";
213 break;
231 break;
214 case EM_PRISM :
232 case EM_V850:
215 strcpy(MachineName,"SiTera Prism");
233 machineName = " NEC v850 ";
216 break;
234 break;
217 case EM_AVR :
235 case EM_M32R:
218 strcpy(MachineName,"Atmel AVR 8-bit microcontroller");
236 machineName = " Mitsubishi M32R ";
219 break;
237 break;
220 case EM_FR30 :
238 case EM_MN10300:
221 strcpy(MachineName,"Fujitsu FR30");
239 machineName = " Matsushita MN10300 ";
222 break;
240 break;
223 case EM_D10V :
241 case EM_MN10200:
224 strcpy(MachineName,"Mitsubishi D10V");
242 machineName = " Matsushita MN10200 ";
225 break;
243 break;
226 case EM_D30V :
244 case EM_PJ:
227 strcpy(MachineName,"Mitsubishi D30V");
245 machineName = " picoJava ";
228 break;
246 break;
229 case EM_V850 :
247 case EM_OPENRISC:
230 strcpy(MachineName,"NEC v850");
248 machineName = " OpenRISC 32-bit embedded processor ";
231 break;
249 break;
232 case EM_M32R :
250 case EM_ARC_A5:
233 strcpy(MachineName,"Mitsubishi M32R");
251 machineName = " ARC Cores Tangent-A5 ";
234 break;
252 break;
235 case EM_MN10300 :
253 case EM_XTENSA:
236 strcpy(MachineName,"Matsushita MN10300");
254 machineName = " Tensilica Xtensa Architecture ";
237 break;
255 break;
238 case EM_MN10200 :
256 case EM_AARCH64:
239 strcpy(MachineName,"Matsushita MN10200");
257 machineName = " ARM AARCH64 ";
240 break;
258 break;
241 case EM_PJ :
259 case EM_TILEPRO:
242 strcpy(MachineName,"picoJava");
260 machineName = " Tilera TILEPro ";
243 break;
261 break;
244 case EM_OPENRISC :
262 case EM_MICROBLAZE:
245 strcpy(MachineName,"OpenRISC 32-bit embedded processor");
263 machineName = " Xilinx MicroBlaze ";
246 break;
264 break;
247 case EM_ARC_A5 :
265 case EM_TILEGX:
248 strcpy(MachineName,"ARC Cores Tangent-A5");
266 machineName = " Tilera TILE-Gx ";
249 break;
267 break;
250 case EM_XTENSA :
268 case EM_NUM:
251 strcpy(MachineName,"Tensilica Xtensa Architecture");
269 machineName = "";
252 break;
270 break;
253 default:
271 default:
254 strcpy(MachineName,"Unknow Machine");
272 machineName ="Unknow Machine";
255 break;
273 break;
256 }
274 }
257
275 return machineName;
258 }
276 }
259
277
260
278
@@ -318,14 +336,11 bool elfparser::iself()
318
336
319 QString elfparser::getArchitecture()
337 QString elfparser::getArchitecture()
320 {
338 {
321 QString arch("");
322 char archName[256]="";
323 if(this->e!=NULL)
339 if(this->e!=NULL)
324 {
340 {
325 elfresolveMachine(this->ehdr.e_machine,archName);
341 return elfresolveMachine(this->ehdr.e_machine);
326 arch = archName;
327 }
342 }
328 return arch;
343 return "";
329 }
344 }
330
345
331
346
General Comments 0
You need to be logged in to leave comments. Login now