##// END OF EJS Templates
ElfFile classes WIP.
jeandet -
r37:b04e90691097 default
parent child
Show More
@@ -1,6 +1,11
1 #include <QObject>
2 #include <QWidget>
1 3 #include "qhexspinbox.h"
2 4 #include "memsizewdgt.h"
3 5 #include "qhexedit/qhexedit.h"
4 6 #include "SocExplorerPlot.h"
5 7 #include "tcp_terminal_client.h"
6 8 #include "elf/elfparser.h"
9 #include "elf/abstractexecfile.h"
10 #include "elf/elffile.h"
11 #include "elf/elffilewidget.h"
@@ -1,38 +1,37
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #include "abstractexecfile.h"
23 23
24 abstractExecFile::abstractExecFile(QObject *parent) :
25 QObject(parent)
24 abstractExecFile::abstractExecFile()
26 25 {
27 26 }
28 27
29 abstractExecFile::abstractExecFile(const QString &File, QObject *parent)
28 abstractExecFile::abstractExecFile(const QString &File)
30 29 {
31 30
32 31 }
33 32
34 33
35 34 codeFragment::codeFragment()
36 35 {
37 36
38 37 }
@@ -1,54 +1,50
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #ifndef ABSTRACTEXECFILE_H
23 23 #define ABSTRACTEXECFILE_H
24 24
25 25 #include <QObject>
26 26
27 27 class codeFragment
28 28 {
29 29 public:
30 30 codeFragment();
31 31 char* data;
32 32 quint32 size;
33 33 quint32 address;
34 34 };
35 35
36 class abstractExecFile : public QObject
36 class abstractExecFile
37 37 {
38 Q_OBJECT
39 38 public:
40 abstractExecFile(QObject *parent = 0);
41 abstractExecFile(const QString& File,QObject *parent = 0);
39 abstractExecFile();
40 abstractExecFile(const QString& File);
42 41 virtual bool openFile(const QString& File)=0;
43 42 virtual bool isopened()=0;
44 43 virtual int closeFile()=0;
45 44 virtual QList<codeFragment> getFragments()=0;
46 signals:
47
48 public slots:
49 45
50 46 protected:
51 47 QString p_fileName;
52 48 };
53 49
54 50 #endif // ABSTRACTEXECFILE_H
@@ -1,113 +1,114
1 1 SOCEXPLORER_ROOT = \"$${PWD}/../..\"
2 2 include($${PWD}/../../build_cfg/socexplorer.pri)
3 3 include($${PWD}/lppserial/lppserial.pri)
4 4
5 5 TEMPLATE = lib
6 6 TARGET = socexplorercommon$${DEBUG_EXT}
7 7
8 8 win32:CONFIG += dll
9 9 win32:CONFIG -= static
10 10
11 11 win32:INCLUDEPATH += $${PWD}/elf/libelfWin32/include
12 12 win32:INCLUDEPATH += $${PWD}/elf/libelfWin32/include/libelf
13 13 win32:DEFINES+=_ELF_WINDOWS_
14 14 DEFINES+=RS232_debug
15 15
16 16 win32:LIBS += $${PWD}/elf/libelfWin32/bin/libelf.a
17 17 unix:LIBS += -lelf
18 18
19 19 QMAKE_LFLAGS_RELEASE += --enable-auto-import
20 20 QMAKE_LFLAGS_DEBUG += --enable-auto-import
21 21
22 22 target.path = $$[QT_INSTALL_LIBS]
23 23 isEmpty(target.path) {
24 24 error(can\'t get QT_INSTALL_LIBS)
25 25 }
26 26
27 27 header.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common
28 28 header.files = \
29 29 memsizewdgt.h \
30 30 qhexspinbox.h \
31 31 qsvgicon.h \
32 32 qhexedit/qhexedit_p.h \
33 33 qhexedit/qhexedit.h \
34 34 qhexedit/xbytearray.h \
35 35 QCustomPlot/qcustomplot.h \
36 36 SocExplorerPlot.h \
37 37 tcp_terminal_client.h \
38 38 elf/elfinfowdgt.h \
39 39 elf/elfparser.h \
40 40 elf/elffile.h \
41 elf/elffilewidget.h \
41 42 qipdialogbox.h \
42 43 lppserial/src/RS232.h
43 44
44 45 win32{
45 46 elfheader.path = $$[QT_INSTALL_HEADERS]/SocExplorer/common/libelf
46 47 elfheader.files += \
47 48 elf/libelfWin32/include/libelf/byteswap.h \
48 49 elf/libelfWin32/include/libelf/errors.h \
49 50 elf/libelfWin32/include/libelf/gelf.h \
50 51 elf/libelfWin32/include/libelf/nlist.h \
51 52 elf/libelfWin32/include/libelf/sys_elf.h \
52 53 elf/libelfWin32/include/libelf/verneed.h \
53 54 elf/libelfWin32/include/libelf/elf_repl.h \
54 55 elf/libelfWin32/include/libelf/ext_types.h \
55 56 elf/libelfWin32/include/libelf/libelf.h \
56 57 elf/libelfWin32/include/libelf/private.h \
57 58 elf/libelfWin32/include/libelf/verdef.h
58 59 INSTALLS += elfheader
59 60 }
60 61
61 62
62 63 isEmpty(header.path) {
63 64 error(can\'t get QT_INSTALL_HEADERS)
64 65 }
65 66
66 67 INSTALLS += target header
67 68
68 69 INCLUDEPATH += QCustomPlot qhexedit
69 70
70 71 HEADERS += \
71 72 memsizewdgt.h \
72 73 qhexspinbox.h \
73 74 qsvgicon.h \
74 75 qhexedit/qhexedit_p.h \
75 76 qhexedit/qhexedit.h \
76 77 qhexedit/xbytearray.h \
77 78 qhexedit/commands.h \
78 79 QCustomPlot/qcustomplot.h \
79 80 tcp_terminal_client.h \
80 81 elf/elfinfowdgt.h \
81 82 elf/elfparser.h \
82 83 abstractexecfile.h \
83 84 elf/elffile.h \
84 85 qipdialogbox.h \
85 86 PySocExplorer.h \
86 87 SocExplorerPlot.h \
87 88 elf/elffilewidget.h
88 89
89 90
90 91 SOURCES += \
91 92 memsizewdgt.cpp \
92 93 qhexspinbox.cpp \
93 94 qsvgicon.cpp \
94 95 qhexedit/qhexedit_p.cpp \
95 96 qhexedit/qhexedit.cpp \
96 97 qhexedit/xbytearray.cpp \
97 98 qhexedit/commands.cpp \
98 99 QCustomPlot/qcustomplot.cpp \
99 100 tcp_terminal_client.cpp \
100 101 elf/elfinfowdgt.cpp \
101 102 elf/elfparser.cpp \
102 103 abstractexecfile.cpp \
103 104 elf/elffile.cpp \
104 105 qipdialogbox.cpp \
105 106 SocExplorerPlot.cpp \
106 107 elf/elffilewidget.cpp
107 108
108 109 FORMS += \
109 110 elf/elffilewidget.ui
110 111
111 112
112 113
113 114
@@ -1,101 +1,101
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author :
20 20 Alexis Jeandet
21 21 -- Mail :
22 22 alexis.jeandet@member.fsf.org
23 23 ----------------------------------------------------------------------------*/
24 24 #include "elffile.h"
25 25
26 ElfFile::ElfFile(QObject *parent) :
27 abstractExecFile(parent)
26 ElfFile::ElfFile(QObject *parent)
27 :QObject(parent),abstractExecFile(),elfparser()
28 28 {
29 29 }
30 30
31 31 ElfFile::ElfFile(const QString &File, QObject *parent)
32 :abstractExecFile(parent),elfparser()
32 :QObject(parent),abstractExecFile(),elfparser()
33 33 {
34 34 this->p_fileName = File;
35 35 setFilename(File);
36 36 }
37 37
38 38 bool ElfFile::openFile(const QString &File)
39 39 {
40 40 this->p_fileName = File;
41 41 return setFilename(File);
42 42 }
43 43
44 44 bool ElfFile::isopened()
45 45 {
46 46 return elfparser::isopened();
47 47 }
48 48
49 49 int ElfFile::closeFile()
50 50 {
51 51 return elfparser::closeFile();
52 52 }
53 53
54 54
55 55 QList<codeFragment> ElfFile::getFragments(QStringList fragmentList)
56 56 {
57 57 QList<codeFragment> fragments;
58 58 if (isopened())
59 59 {
60 60 for(int i =0;i<fragmentList.count();i++)
61 61 {
62 62 fragments.append(getFragment(fragmentList.at(i)));
63 63 }
64 64 }
65 65 return fragments;
66 66 }
67 67
68 68 QList<codeFragment> ElfFile::getFragments()
69 69 {
70 70 return getFragments(QStringList()<<".data"<<".text");
71 71 }
72 72
73 73 codeFragment ElfFile::getFragment(const QString &name)
74 74 {
75 75 codeFragment fragment;
76 76 for(int i=0;i<getSectioncount();i++)
77 77 {
78 78 if(getSectionName(i) == name)
79 79 {
80 80 fragment.data =NULL;
81 81 fragment.size = getSectionDatasz(i);
82 82 fragment.address = getSectionPaddr(i);
83 83 getSectionData(i,&fragment.data);
84 84 }
85 85 }
86 86
87 87 }
88 88
89 89
90 90
91 91
92 92
93 93
94 94
95 95
96 96
97 97
98 98
99 99
100 100
101 101
@@ -1,51 +1,51
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 2 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@member.fsf.org
21 21 ----------------------------------------------------------------------------*/
22 22 #include <abstractexecfile.h>
23 23 #include <elf.h>
24 24 #include "elfparser.h"
25 25 #include <QStringList>
26 26
27 27 #ifndef ELFFILE_H
28 28 #define ELFFILE_H
29 29
30 class ElfFile : public abstractExecFile, public elfparser
30 class ElfFile :public QObject, public abstractExecFile, public elfparser
31 31 {
32 32 Q_OBJECT
33 33 public:
34 34 ElfFile(QObject *parent = 0);
35 35 ElfFile(const QString& File,QObject *parent = 0);
36 36 bool openFile(const QString& File);
37 37 bool isopened();
38 38 int closeFile();
39 39 QList<codeFragment> getFragments();
40 40 QList<codeFragment> getFragments(QStringList fragmentList);
41 41 // elfparser parser;
42 42
43 43 signals:
44 44
45 45 public slots:
46 46 private:
47 47 codeFragment getFragment(const QString& name);
48 48
49 49 };
50 50
51 51 #endif // ELFFILE_H
@@ -1,26 +1,44
1 1 #include "elffilewidget.h"
2 2 #include "ui_elffilewidget.h"
3 3
4 4 elfFileWidget::elfFileWidget(QWidget *parent) :
5 5 QWidget(parent),
6 6 ui(new Ui::elfFileWidget)
7 7 {
8 8 ui->setupUi(this);
9 9 }
10 10
11 11 elfFileWidget::~elfFileWidget()
12 12 {
13 13 delete ui;
14 14 }
15 15
16 16 void elfFileWidget::updateElfFile(ElfFile *file)
17 17 {
18 18 this->p_elf = file;
19 19 if(p_elf->isopened() && p_elf->iself())
20 20 {
21 21 this->ui->classLabel->setText(p_elf->getClass());
22 22 this->ui->VersionLabel->setText(QString::number(p_elf->getVersion()));
23 23 this->ui->machineLabel->setText(p_elf->getArchitecture());
24 24 this->ui->endiannesLabel->setText(p_elf->getEndianness());
25 this->ui->abiLabel->setText(p_elf->getABI());
26 this->ui->entryPointLabel->setText("0x"+QString::number(p_elf->getEntryPointAddress(),16,8));
27 this->ui->sectionCountLabel->setText(QString::number(p_elf->getSectioncount()));
25 28 }
26 29 }
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@@ -1,737 +1,769
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 21 ----------------------------------------------------------------------------*/
22 22 #include "elfparser.h"
23 23 #include <sys/types.h>
24 24 #include <sys/stat.h>
25 25 #include <fcntl.h>
26 26 #include <unistd.h>
27 27
28 28 QString elfresolveMachine(Elf64_Half e_machine)
29 29 {
30 30 QString machineName;
31 31 //Update from with bash script don't write it by yourself!
32 32 switch(e_machine)
33 33 {
34 34 case EM_NONE:
35 35 machineName = " No machine ";
36 36 break;
37 37 case EM_M32:
38 38 machineName = " AT&T WE 32100 ";
39 39 break;
40 40 case EM_SPARC:
41 41 machineName = " SUN SPARC ";
42 42 break;
43 43 case EM_386:
44 44 machineName = " Intel 80386 ";
45 45 break;
46 46 case EM_68K:
47 47 machineName = " Motorola m68k family ";
48 48 break;
49 49 case EM_88K:
50 50 machineName = " Motorola m88k family ";
51 51 break;
52 52 case EM_860:
53 53 machineName = " Intel 80860 ";
54 54 break;
55 55 case EM_MIPS:
56 56 machineName = " MIPS R3000 big-endian ";
57 57 break;
58 58 case EM_S370:
59 59 machineName = " IBM System/370 ";
60 60 break;
61 61 case EM_MIPS_RS3_LE:
62 62 machineName = " MIPS R3000 little-endian ";
63 63 break;
64 64 case EM_PARISC:
65 65 machineName = " HPPA ";
66 66 break;
67 67 case EM_VPP500:
68 68 machineName = " Fujitsu VPP500 ";
69 69 break;
70 70 case EM_SPARC32PLUS:
71 71 machineName = " Sun's \"v8plus\" ";
72 72 break;
73 73 case EM_960:
74 74 machineName = " Intel 80960 ";
75 75 break;
76 76 case EM_PPC:
77 77 machineName = " PowerPC ";
78 78 break;
79 79 case EM_PPC64:
80 80 machineName = " PowerPC 64-bit ";
81 81 break;
82 82 case EM_S390:
83 83 machineName = " IBM S390 ";
84 84 break;
85 85 case EM_V800:
86 86 machineName = " NEC V800 series ";
87 87 break;
88 88 case EM_FR20:
89 89 machineName = " Fujitsu FR20 ";
90 90 break;
91 91 case EM_RH32:
92 92 machineName = " TRW RH-32 ";
93 93 break;
94 94 case EM_RCE:
95 95 machineName = " Motorola RCE ";
96 96 break;
97 97 case EM_ARM:
98 98 machineName = " ARM ";
99 99 break;
100 100 case EM_FAKE_ALPHA:
101 101 machineName = " Digital Alpha ";
102 102 break;
103 103 case EM_SH:
104 104 machineName = " Hitachi SH ";
105 105 break;
106 106 case EM_SPARCV9:
107 107 machineName = " SPARC v9 64-bit ";
108 108 break;
109 109 case EM_TRICORE:
110 110 machineName = " Siemens Tricore ";
111 111 break;
112 112 case EM_ARC:
113 113 machineName = " Argonaut RISC Core ";
114 114 break;
115 115 case EM_H8_300:
116 116 machineName = " Hitachi H8/300 ";
117 117 break;
118 118 case EM_H8_300H:
119 119 machineName = " Hitachi H8/300H ";
120 120 break;
121 121 case EM_H8S:
122 122 machineName = " Hitachi H8S ";
123 123 break;
124 124 case EM_H8_500:
125 125 machineName = " Hitachi H8/500 ";
126 126 break;
127 127 case EM_IA_64:
128 128 machineName = " Intel Merced ";
129 129 break;
130 130 case EM_MIPS_X:
131 131 machineName = " Stanford MIPS-X ";
132 132 break;
133 133 case EM_COLDFIRE:
134 134 machineName = " Motorola Coldfire ";
135 135 break;
136 136 case EM_68HC12:
137 137 machineName = " Motorola M68HC12 ";
138 138 break;
139 139 case EM_MMA:
140 140 machineName = " Fujitsu MMA Multimedia Accelerator";
141 141 break;
142 142 case EM_PCP:
143 143 machineName = " Siemens PCP ";
144 144 break;
145 145 case EM_NCPU:
146 146 machineName = " Sony nCPU embeeded RISC ";
147 147 break;
148 148 case EM_NDR1:
149 149 machineName = " Denso NDR1 microprocessor ";
150 150 break;
151 151 case EM_STARCORE:
152 152 machineName = " Motorola Start*Core processor ";
153 153 break;
154 154 case EM_ME16:
155 155 machineName = " Toyota ME16 processor ";
156 156 break;
157 157 case EM_ST100:
158 158 machineName = " STMicroelectronic ST100 processor ";
159 159 break;
160 160 case EM_TINYJ:
161 161 machineName = " Advanced Logic Corp. Tinyj emb.fam";
162 162 break;
163 163 case EM_X86_64:
164 164 machineName = " AMD x86-64 architecture ";
165 165 break;
166 166 case EM_PDSP:
167 167 machineName = " Sony DSP Processor ";
168 168 break;
169 169 case EM_FX66:
170 170 machineName = " Siemens FX66 microcontroller ";
171 171 break;
172 172 case EM_ST9PLUS:
173 173 machineName = " STMicroelectronics ST9+ 8/16 mc ";
174 174 break;
175 175 case EM_ST7:
176 176 machineName = " STmicroelectronics ST7 8 bit mc ";
177 177 break;
178 178 case EM_68HC16:
179 179 machineName = " Motorola MC68HC16 microcontroller ";
180 180 break;
181 181 case EM_68HC11:
182 182 machineName = " Motorola MC68HC11 microcontroller ";
183 183 break;
184 184 case EM_68HC08:
185 185 machineName = " Motorola MC68HC08 microcontroller ";
186 186 break;
187 187 case EM_68HC05:
188 188 machineName = " Motorola MC68HC05 microcontroller ";
189 189 break;
190 190 case EM_SVX:
191 191 machineName = " Silicon Graphics SVx ";
192 192 break;
193 193 case EM_ST19:
194 194 machineName = " STMicroelectronics ST19 8 bit mc ";
195 195 break;
196 196 case EM_VAX:
197 197 machineName = " Digital VAX ";
198 198 break;
199 199 case EM_CRIS:
200 200 machineName = " Axis Communications 32-bit embedded processor ";
201 201 break;
202 202 case EM_JAVELIN:
203 203 machineName = " Infineon Technologies 32-bit embedded processor ";
204 204 break;
205 205 case EM_FIREPATH:
206 206 machineName = " Element 14 64-bit DSP Processor ";
207 207 break;
208 208 case EM_ZSP:
209 209 machineName = " LSI Logic 16-bit DSP Processor ";
210 210 break;
211 211 case EM_MMIX:
212 212 machineName = " Donald Knuth's educational 64-bit processor ";
213 213 break;
214 214 case EM_HUANY:
215 215 machineName = " Harvard University machine-independent object files ";
216 216 break;
217 217 case EM_PRISM:
218 218 machineName = " SiTera Prism ";
219 219 break;
220 220 case EM_AVR:
221 221 machineName = " Atmel AVR 8-bit microcontroller ";
222 222 break;
223 223 case EM_FR30:
224 224 machineName = " Fujitsu FR30 ";
225 225 break;
226 226 case EM_D10V:
227 227 machineName = " Mitsubishi D10V ";
228 228 break;
229 229 case EM_D30V:
230 230 machineName = " Mitsubishi D30V ";
231 231 break;
232 232 case EM_V850:
233 233 machineName = " NEC v850 ";
234 234 break;
235 235 case EM_M32R:
236 236 machineName = " Mitsubishi M32R ";
237 237 break;
238 238 case EM_MN10300:
239 239 machineName = " Matsushita MN10300 ";
240 240 break;
241 241 case EM_MN10200:
242 242 machineName = " Matsushita MN10200 ";
243 243 break;
244 244 case EM_PJ:
245 245 machineName = " picoJava ";
246 246 break;
247 247 case EM_OPENRISC:
248 248 machineName = " OpenRISC 32-bit embedded processor ";
249 249 break;
250 250 case EM_ARC_A5:
251 251 machineName = " ARC Cores Tangent-A5 ";
252 252 break;
253 253 case EM_XTENSA:
254 254 machineName = " Tensilica Xtensa Architecture ";
255 255 break;
256 256 case EM_AARCH64:
257 257 machineName = " ARM AARCH64 ";
258 258 break;
259 259 case EM_TILEPRO:
260 260 machineName = " Tilera TILEPro ";
261 261 break;
262 262 case EM_MICROBLAZE:
263 263 machineName = " Xilinx MicroBlaze ";
264 264 break;
265 265 case EM_TILEGX:
266 266 machineName = " Tilera TILE-Gx ";
267 267 break;
268 268 case EM_NUM:
269 269 machineName = "";
270 270 break;
271 271 default:
272 272 machineName ="Unknow Machine";
273 273 break;
274 274 }
275 275 return machineName;
276 276 }
277 277
278 278
279 279 elfparser::elfparser()
280 280 {
281 281 this->opened = false;
282 282 this->type_elf = false;
283 283 this->elfFile = NULL;
284 284 this->e = NULL;
285 285 }
286 286
287 287
288 288 int elfparser::setFilename(const QString &name)
289 289 {
290 290 this->closeFile();
291 291 if(elf_version(EV_CURRENT)==EV_NONE)return 0;
292 292 #ifdef _ELF_WINDOWS_
293 293 this->elfFile = open(name.toStdString().c_str(),O_RDONLY|O_BINARY ,0);
294 294 #else
295 295 this->elfFile = open(name.toStdString().c_str(),O_RDONLY ,0);
296 296 #endif
297 297 if(this->elfFile==NULL)return 0;
298 298 this->e = elf_begin(this->elfFile,ELF_C_READ,NULL);
299 299 if(this->e==NULL)return 0;
300 300 this->ek = elf_kind(this->e);
301 301 gelf_getehdr (this->e, &this->ehdr );
302 302 elf_getshdrstrndx (this->e, &this->shstrndx);
303 303 this->updateSegments();
304 304 this->updateSections();
305 305 return 1;
306 306 }
307 307
308 308
309 309 int elfparser::closeFile()
310 310 {
311 311 if(this->elfFile!=NULL)
312 312 {
313 313 if(this->e!=NULL)
314 314 {
315 315 elf_end(this->e);
316 316 this->e = NULL;
317 317 }
318 318 close(this->elfFile);
319 319 this->elfFile = NULL;
320 320 }
321 321 return 0;
322 322 }
323 323
324 324 QString elfparser::getClass()
325 325 {
326 326 if(this->e!=NULL)
327 327 {
328 328 int eclass = gelf_getclass(this->e);
329 329 if(eclass==ELFCLASS32)return "ELF32";
330 330 if(eclass==ELFCLASS64)return "ELF64";
331 331 }
332 332 return "none";
333 333 }
334 334
335 335
336 336 bool elfparser::isopened()
337 337 {
338 338 return this->opened;
339 339 }
340 340
341 341
342 342 bool elfparser::iself()
343 343 {
344 344 return this->type_elf;
345 345 }
346 346
347 347
348 348 QString elfparser::getArchitecture()
349 349 {
350 350 if(this->e!=NULL)
351 351 {
352 352 return elfresolveMachine(this->ehdr.e_machine);
353 353 }
354 354 return "";
355 355 }
356 356
357 357
358 358 QString elfparser::getType()
359 359 {
360 360 QString kind("");
361 361 if(this->e!=NULL)
362 362 {
363 363 switch(this->ek)
364 364 {
365 365 case ELF_K_AR:
366 366 kind = "Archive";
367 367 break;
368 368 case ELF_K_ELF:
369 369 kind = "Elf";
370 370 break;
371 371 case ELF_K_COFF:
372 372 kind = "COFF";
373 373 break;
374 374 case ELF_K_NUM:
375 375 kind = "NUM";
376 376 break;
377 377 case ELF_K_NONE:
378 378 kind = "Data";
379 379 break;
380 380 default:
381 381 kind = "Unknow";
382 382 break;
383 383 }
384 384 }
385 385 return kind;
386 386 }
387 387
388 388 QString elfparser::getEndianness()
389 389 {
390 390 if(this->e!=NULL)
391 391 {
392 392 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2LSB)return "2's complement, little endian";
393 393 if(this->ehdr.e_ident[EI_DATA]==ELFDATA2MSB)return "2's complement, big endian";
394 394 }
395 395 return "none";
396 396 }
397 397
398 QString elfparser::getABI()
399 {
400 if(this->e!=NULL)
401 {
402 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_NONE)return "UNIX System V ABI";
403 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_SYSV)return "Alias";
404 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_HPUX)return "HP-UX";
405 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_NETBSD)return "NetBSD";
406 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_GNU)return "Object uses GNU ELF extensions";
407 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_LINUX)return "Compatibility alias";
408 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_SOLARIS)return "Sun Solaris";
409 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_AIX)return "IBM AIX";
410 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_IRIX)return "SGI Irix";
411 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_FREEBSD)return "FreeBSD";
412 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_TRU64)return "Compaq TRU64 UNIX";
413 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_MODESTO)return " Novell Modesto";
414 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_OPENBSD)return "OpenBSD";
415 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_ARM_AEABI)return "ARM EABI";
416 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_ARM)return "ARM";
417 if(this->ehdr.e_ident[EI_OSABI]==ELFOSABI_STANDALONE)return "Standalone (embedded) application";
418 }
419 return "none";
420 }
421
398 422
399 423 int32_t elfparser::getVersion()
400 424 {
401 425 if(this->e!=NULL)
402 426 {
403 427 return this->ehdr.e_version;
404 428 }
405 429 }
406 430
431 int64_t elfparser::getEntryPointAddress()
432 {
433 if(this->e!=NULL)
434 {
435 return this->ehdr.e_entry;
436 }
437 }
438
407 439
408 440 int elfparser::getSectioncount()
409 441 {
410 442 return (int)this->SectionCount;
411 443 }
412 444
413 445
414 446 int elfparser::getSegmentcount()
415 447 {
416 448 return (int)this->SegmentCount;
417 449 }
418 450
419 451
420 452 QString elfparser::getSegmentType(int index)
421 453 {
422 454 QString type("");
423 455 if(this->e!=NULL)
424 456 {
425 457 if(index < this->Segments.count())
426 458 {
427 459 switch(this->Segments.at(index)->p_type)
428 460 {
429 461 case PT_NULL:
430 462 type = "Program header table entry unused";
431 463 break;
432 464 case PT_LOAD:
433 465 type = "Loadable program segment";
434 466 break;
435 467 case PT_DYNAMIC :
436 468 type = "Dynamic linking information";
437 469 break;
438 470 case PT_INTERP:
439 471 type ="Program interpreter";
440 472 break;
441 473 case PT_NOTE:
442 474 type = "Auxiliary information";
443 475 break;
444 476 case PT_SHLIB:
445 477 type = "Reserved";
446 478 break;
447 479 case PT_PHDR:
448 480 type = "Entry for header table itself";
449 481 break;
450 482 case PT_TLS:
451 483 type = "Thread-local storage segment";
452 484 break;
453 485 case PT_NUM:
454 486 type = "Number of defined types";
455 487 break;
456 488 case PT_LOOS:
457 489 type = "Start of OS-specific";
458 490 break;
459 491 case PT_SUNWSTACK:
460 492 type = "Stack segment";
461 493 break;
462 494 case PT_LOPROC:
463 495 type = "Start of processor-specific";
464 496 break;
465 497 case PT_HIPROC:
466 498 type = "End of processor-specific";
467 499 break;
468 500 default:
469 501 type = "Unknow Section Type";
470 502 break;
471 503 }
472 504 }
473 505 }
474 506
475 507 return type;
476 508 }
477 509
478 510
479 511 int64_t elfparser::getSegmentOffset(int index)
480 512 {
481 513 int64_t Offset;
482 514 if(this->e!=NULL)
483 515 {
484 516 if(index < this->Segments.count())
485 517 {
486 518 Offset = (int64_t)this->Segments.at(index)->p_offset;
487 519 }
488 520 }
489 521 return Offset;
490 522 }
491 523
492 524
493 525 int64_t elfparser::getSegmentVaddr(int index)
494 526 {
495 527 int64_t Vaddr = 0;
496 528 if(this->e!=NULL)
497 529 {
498 530 if(index < this->Segments.count())
499 531 {
500 532 Vaddr = (int64_t)this->Segments.at(index)->p_vaddr;
501 533 }
502 534 }
503 535 return Vaddr;
504 536 }
505 537
506 538
507 539 int64_t elfparser::getSegmentPaddr(int index)
508 540 {
509 541 int64_t Paddr=0;
510 542 if(this->e!=NULL)
511 543 {
512 544 if(index < this->Segments.count())
513 545 {
514 546 Paddr = (int64_t)this->Segments.at(index)->p_paddr;
515 547 }
516 548 }
517 549 return Paddr;
518 550 }
519 551
520 552 int64_t elfparser::getSectionPaddr(int index)
521 553 {
522 554 int64_t Paddr=0;
523 555 if(this->e!=NULL)
524 556 {
525 557 if(index < this->sections.count())
526 558 {
527 559 Paddr = (int64_t)this->sections.at(index)->section_header->sh_addr;
528 560 }
529 561 }
530 562 return Paddr;
531 563 }
532 564
533 565
534 566 int64_t elfparser::getSegmentFilesz(int index)
535 567 {
536 568 int64_t FileSz=0;
537 569 if(this->e!=NULL)
538 570 {
539 571 if(index < this->Segments.count())
540 572 {
541 573 FileSz = (int64_t)this->Segments.at(index)->p_filesz;
542 574 }
543 575 }
544 576 return FileSz;
545 577 }
546 578
547 579 int64_t elfparser::getSectionDatasz(int index)
548 580 {
549 581 int64_t DataSz=0;
550 582 if(this->e!=NULL)
551 583 {
552 584 if(index < this->sections.count())
553 585 {
554 586 DataSz = (int64_t)this->sections.at(index)->data->d_size;
555 587 }
556 588 }
557 589 return DataSz;
558 590 }
559 591
560 592 bool elfparser::getSectionData(int index, char **buffer)
561 593 {
562 594 if(this->e!=NULL)
563 595 {
564 596 if(index < this->sections.count())
565 597 {
566 598 *buffer = (char *)this->sections.at(index)->data->d_buf;
567 599 return true;
568 600 }
569 601 }
570 602 return false;
571 603 }
572 604
573 605
574 606 int64_t elfparser::getSegmentMemsz(int index)
575 607 {
576 608 int64_t MemSz=0;
577 609 if(this->e!=NULL)
578 610 {
579 611 if(index < this->Segments.count())
580 612 {
581 613 MemSz = (int64_t)this->Segments.at(index)->p_memsz;
582 614 }
583 615 }
584 616 return MemSz;
585 617 }
586 618
587 619 int64_t elfparser::getSectionMemsz(int index)
588 620 {
589 621 int64_t MemSz=0;
590 622 if(this->e!=NULL)
591 623 {
592 624 if(index < this->sections.count())
593 625 {
594 626 MemSz = (int64_t)this->sections.at(index)->section_header->sh_size;
595 627 }
596 628 }
597 629 return MemSz;
598 630 }
599 631
600 632
601 633 QString elfparser::getSegmentFlags(int index)
602 634 {
603 635 QString flags("");
604 636 if(this->e!=NULL)
605 637 {
606 638 if(index < this->Segments.count())
607 639 {
608 640 if((this->Segments.at(index)->p_flags&PF_X) == PF_X)flags+="x";
609 641 if((this->Segments.at(index)->p_flags&PF_W) == PF_W)flags+="w";
610 642 if((this->Segments.at(index)->p_flags&PF_R) == PF_R)flags+="r";
611 643 if((this->Segments.at(index)->p_flags&PF_MASKOS) == PF_MASKOS)flags+=" OS-specific";
612 644 if((this->Segments.at(index)->p_flags&PF_MASKPROC) == PF_MASKPROC)flags+=" Processor-specific";
613 645 }
614 646 }
615 647 return flags;
616 648 }
617 649
618 650
619 651 QString elfparser::getSectionName(int index)
620 652 {
621 653 char* nameChr = elf_strptr(this->e , this->shstrndx , this->sections.at(index)->section_header->sh_name);
622 654 return QString(nameChr);
623 655 }
624 656
625 657
626 658 void elfparser::updateSections()
627 659 {
628 660 for(int i=0;i<this->sections.count();i++)
629 661 {
630 662 delete this->sections.at(i);
631 663 }
632 664 this->sections.clear();
633 665 this->scn = elf_nextscn (this->e , NULL );
634 666 this->SectionCount = 0;
635 667 while( this->scn != NULL )
636 668 {
637 669 GElf_Shdr* shdr = (GElf_Shdr*)malloc(sizeof(GElf_Shdr));
638 670 gelf_getshdr ( this->scn , shdr );
639 671 Elf_Data* data = elf_getdata(this->scn, NULL);
640 672 this->sections.append(new Elf_Section(data,shdr));
641 673 this->SectionCount+=1;
642 674 this->scn = elf_nextscn(e , scn);
643 675 }
644 676 }
645 677
646 678
647 679 void elfparser::updateSegments()
648 680 {
649 681 elf_getphdrnum (this->e , &this->SegmentCount);
650 682 for(int i=0;i<this->Segments.count();i++)
651 683 {
652 684 free(this->Segments.at(i));
653 685 }
654 686 this->Segments.clear();
655 687 for(int i=0;i<this->SegmentCount;i++)
656 688 {
657 689 GElf_Phdr* header=(GElf_Phdr*)malloc(sizeof(GElf_Phdr));
658 690 gelf_getphdr (this->e , i , header );
659 691 this->Segments.append(header);
660 692 }
661 693 }
662 694
663 695
664 696
665 697
666 698
667 699 QString elfparser::getSectionType(int index)
668 700 {
669 701 QString type("");
670 702 if(this->e!=NULL)
671 703 {
672 704 if(index < this->Segments.count())
673 705 {
674 706 switch(this->Segments.at(index)->p_type)
675 707 {
676 708 case SHT_NULL : type = "Section header table entry unused"; break;
677 709 case SHT_PROGBITS : type = "Program data"; break;
678 710 case SHT_SYMTAB : type = "Symbol table"; break;
679 711 case SHT_STRTAB : type = "String table"; break;
680 712 case SHT_RELA : type = "Relocation entries with addends"; break;
681 713 case SHT_HASH : type = "Symbol hash table"; break;
682 714 case SHT_DYNAMIC : type = "Dynamic linking information"; break;
683 715 case SHT_NOTE : type = "Notes"; break;
684 716 case SHT_NOBITS :type = "Program space with no data (bss)"; break;
685 717 case SHT_REL :type = "Relocation entries, no addends"; break;
686 718 case SHT_SHLIB : type = "Reserved"; break;
687 719 case SHT_DYNSYM : type = "Dynamic linker symbol table"; break;
688 720 case SHT_INIT_ARRAY : type = "Array of constructors"; break;
689 721 case SHT_FINI_ARRAY : type = "Array of destructors"; break;
690 722 case SHT_PREINIT_ARRAY : type = "Array of pre-constructors"; break;
691 723 case SHT_GROUP : type = "Section group"; break;
692 724 case SHT_SYMTAB_SHNDX : type = "Extended section indeces"; break;
693 725 case SHT_NUM : type = "Number of defined types. "; break;
694 726 case SHT_LOOS : type = "Start OS-specific. "; break;
695 727 case SHT_LOSUNW : type = "Sun-specific low bound. "; break;
696 728 case SHT_SUNW_COMDAT : type = " "; break;
697 729 case SHT_SUNW_syminfo : type = " "; break;
698 730 case SHT_GNU_verdef : type = "Version definition section. "; break;
699 731 case SHT_GNU_verneed : type = "Version needs section. "; break;
700 732 case SHT_GNU_versym : type = "Version symbol table. "; break;
701 733 case SHT_LOPROC : type = "Start of processor-specific"; break;
702 734 case SHT_HIPROC : type = "End of processor-specific"; break;
703 735 case SHT_HIUSER : type = "End of application-specific"; break;
704 736 }
705 737 }
706 738 }
707 739 return type;
708 740 }
709 741
710 742 bool elfparser::isElf(const QString &File)
711 743 {
712 744 int file =0;
713 745 #ifdef _ELF_WINDOWS_
714 746 file = open(File.toStdString().c_str(),O_RDONLY|O_BINARY ,0);
715 747 #else
716 748 file = open(File.toStdString().c_str(),O_RDONLY ,0);
717 749 #endif
718 750 char Magic[4];
719 751 if(file!=-1)
720 752 {
721 753 read(file,Magic,4);
722 754 close(file);
723 755 if(Magic[0]==0x7f && Magic[1]==0x45 && Magic[2]==0x4c && Magic[3]==0x46)
724 756 {
725 757 return true;
726 758 }
727 759 }
728 760 return false;
729 761 }
730 762
731 763
732 764
733 765
734 766
735 767
736 768
737 769
@@ -1,99 +1,101
1 1 /*------------------------------------------------------------------------------
2 2 -- This file is a part of the SocExplorer Software
3 3 -- Copyright (C) 2013, Plasma Physics Laboratory - CNRS
4 4 --
5 5 -- This program is free software; you can redistribute it and/or modify
6 6 -- it under the terms of the GNU General Public License as published by
7 7 -- the Free Software Foundation; either version 3 of the License, or
8 8 -- (at your option) any later version.
9 9 --
10 10 -- This program is distributed in the hope that it will be useful,
11 11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 13 -- GNU General Public License for more details.
14 14 --
15 15 -- You should have received a copy of the GNU General Public License
16 16 -- along with this program; if not, write to the Free Software
17 17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 18 -------------------------------------------------------------------------------*/
19 19 /*-- Author : Alexis Jeandet
20 20 -- Mail : alexis.jeandet@lpp.polytechnique.fr
21 21 ----------------------------------------------------------------------------*/
22 22 #ifndef ELFPARSER_H
23 23 #define ELFPARSER_H
24 24 #include <libelf.h>
25 25 #include <gelf.h>
26 26 #include <QString>
27 27 #include <stdio.h>
28 28 #include <QList>
29 29 #include <stdint.h>
30 30
31 31 class Elf_Section
32 32 {
33 33 public:
34 34 Elf_Section(){}
35 35 Elf_Section(Elf_Data* data,GElf_Shdr* section_header)
36 36 {
37 37 this->data = data;
38 38 this->section_header = section_header;
39 39 }
40 40 Elf_Data* data;
41 41 GElf_Shdr* section_header;
42 42 };
43 43
44 44 class elfparser
45 45 {
46 46 public:
47 47 elfparser();
48 48 bool iself();
49 49 bool isopened();
50 50 int setFilename(const QString& name);
51 51 int closeFile();
52 52 QString getClass();
53 53 QString getArchitecture();
54 54 QString getType();
55 55 QString getEndianness();
56 QString getABI();
56 57 int32_t getVersion();
58 int64_t getEntryPointAddress();
57 59 int getSectioncount();
58 60 int getSegmentcount();
59 61 QString getSegmentType(int index);
60 62 int64_t getSegmentOffset(int index);
61 63 int64_t getSegmentVaddr(int index);
62 64 int64_t getSegmentPaddr(int index);
63 65 int64_t getSectionPaddr(int index);
64 66 int64_t getSegmentFilesz(int index);
65 67 int64_t getSectionDatasz(int index);
66 68 bool getSectionData(int index, char **buffer);
67 69 int64_t getSegmentMemsz(int index);
68 70 int64_t getSectionMemsz(int index);
69 71 QString getSegmentFlags(int index);
70 72 QString getSectionName(int index);
71 73 QString getSectionType(int index);
72 74 static bool isElf(const QString& File);
73 75
74 76 private:
75 77 void updateSections();
76 78 void updateSegments();
77 79 int elfFile;
78 80 bool opened;
79 81 bool type_elf;
80 82 Elf* e;
81 83 Elf_Kind ek;
82 84 GElf_Ehdr ehdr;
83 85 Elf_Scn * scn;
84 86 Elf_Data * data;
85 87 size_t SectionCount,SegmentCount, shstrndx;
86 88 QList<GElf_Phdr*> Segments;
87 89 QList<Elf_Section*> sections;
88 90
89 91 };
90 92
91 93 #endif // ELFPARSER_H
92 94
93 95
94 96
95 97
96 98
97 99
98 100
99 101
@@ -1,524 +1,571
1 1 #include "PySocExplorer0.h"
2 2 #include <PythonQtConversion.h>
3 3 #include <PythonQtMethodInfo.h>
4 4 #include <PythonQtSignalReceiver.h>
5 5 #include <QVariant>
6 #include <elffile.h>
7
8 ElfFile* PythonQtWrapper_ElfFile::new_ElfFile(QObject* parent)
9 {
10 return new ElfFile(parent); }
11
12 ElfFile* PythonQtWrapper_ElfFile::new_ElfFile(const QString& File, QObject* parent)
13 {
14 return new ElfFile(File, parent); }
15
16 int PythonQtWrapper_ElfFile::closeFile(ElfFile* theWrappedObject)
17 {
18 return ( theWrappedObject->closeFile());
19 }
20
21 bool PythonQtWrapper_ElfFile::isopened(ElfFile* theWrappedObject)
22 {
23 return ( theWrappedObject->isopened());
24 }
25
26 bool PythonQtWrapper_ElfFile::openFile(ElfFile* theWrappedObject, const QString& File)
27 {
28 return ( theWrappedObject->openFile(File));
29 }
30
31
6 32
7 33 MemSizeWdgt* PythonQtWrapper_MemSizeWdgt::new_MemSizeWdgt(QWidget* parent)
8 34 {
9 35 return new MemSizeWdgt(parent); }
10 36
11 37 MemSizeWdgt* PythonQtWrapper_MemSizeWdgt::new_MemSizeWdgt(int defaultSize, QWidget* parent)
12 38 {
13 39 return new MemSizeWdgt(defaultSize, parent); }
14 40
15 41 int PythonQtWrapper_MemSizeWdgt::getsize(MemSizeWdgt* theWrappedObject)
16 42 {
17 43 return ( theWrappedObject->getsize());
18 44 }
19 45
20 46 void PythonQtWrapper_MemSizeWdgt::setMaximum(MemSizeWdgt* theWrappedObject, unsigned int max)
21 47 {
22 48 ( theWrappedObject->setMaximum(max));
23 49 }
24 50
25 51 void PythonQtWrapper_MemSizeWdgt::show(MemSizeWdgt* theWrappedObject)
26 52 {
27 53 ( theWrappedObject->show());
28 54 }
29 55
30 56 void PythonQtWrapper_MemSizeWdgt::updateSizeValue(MemSizeWdgt* theWrappedObject)
31 57 {
32 58 ( theWrappedObject->updateSizeValue());
33 59 }
34 60
35 61
36 62
37 63 PythonQtShell_QHexEdit::~PythonQtShell_QHexEdit() {
38 64 PythonQtPrivate* priv = PythonQt::priv();
39 65 if (priv) { priv->shellClassDeleted(this); }
40 66 }
41 67 QHexEdit* PythonQtWrapper_QHexEdit::new_QHexEdit(QWidget* parent)
42 68 {
43 69 return new PythonQtShell_QHexEdit(parent); }
44 70
45 71 QColor PythonQtWrapper_QHexEdit::addressAreaColor(QHexEdit* theWrappedObject)
46 72 {
47 73 return ( theWrappedObject->addressAreaColor());
48 74 }
49 75
50 76 int PythonQtWrapper_QHexEdit::addressOffset(QHexEdit* theWrappedObject)
51 77 {
52 78 return ( theWrappedObject->addressOffset());
53 79 }
54 80
55 81 int PythonQtWrapper_QHexEdit::cursorPosition(QHexEdit* theWrappedObject)
56 82 {
57 83 return ( theWrappedObject->cursorPosition());
58 84 }
59 85
60 86 QByteArray PythonQtWrapper_QHexEdit::data(QHexEdit* theWrappedObject)
61 87 {
62 88 return ( theWrappedObject->data());
63 89 }
64 90
65 91 const QFont* PythonQtWrapper_QHexEdit::font(QHexEdit* theWrappedObject) const
66 92 {
67 93 return &( theWrappedObject->font());
68 94 }
69 95
70 96 QColor PythonQtWrapper_QHexEdit::highlightingColor(QHexEdit* theWrappedObject)
71 97 {
72 98 return ( theWrappedObject->highlightingColor());
73 99 }
74 100
75 101 int PythonQtWrapper_QHexEdit::indexOf(QHexEdit* theWrappedObject, const QByteArray& ba, int from) const
76 102 {
77 103 return ( theWrappedObject->indexOf(ba, from));
78 104 }
79 105
80 106 void PythonQtWrapper_QHexEdit::insert(QHexEdit* theWrappedObject, int i, char ch)
81 107 {
82 108 ( theWrappedObject->insert(i, ch));
83 109 }
84 110
85 111 void PythonQtWrapper_QHexEdit::insert(QHexEdit* theWrappedObject, int i, const QByteArray& ba)
86 112 {
87 113 ( theWrappedObject->insert(i, ba));
88 114 }
89 115
90 116 bool PythonQtWrapper_QHexEdit::isReadOnly(QHexEdit* theWrappedObject)
91 117 {
92 118 return ( theWrappedObject->isReadOnly());
93 119 }
94 120
95 121 int PythonQtWrapper_QHexEdit::lastIndexOf(QHexEdit* theWrappedObject, const QByteArray& ba, int from) const
96 122 {
97 123 return ( theWrappedObject->lastIndexOf(ba, from));
98 124 }
99 125
100 126 bool PythonQtWrapper_QHexEdit::overwriteMode(QHexEdit* theWrappedObject)
101 127 {
102 128 return ( theWrappedObject->overwriteMode());
103 129 }
104 130
105 131 void PythonQtWrapper_QHexEdit::remove(QHexEdit* theWrappedObject, int pos, int len)
106 132 {
107 133 ( theWrappedObject->remove(pos, len));
108 134 }
109 135
110 136 void PythonQtWrapper_QHexEdit::replace(QHexEdit* theWrappedObject, int pos, int len, const QByteArray& after)
111 137 {
112 138 ( theWrappedObject->replace(pos, len, after));
113 139 }
114 140
115 141 QColor PythonQtWrapper_QHexEdit::selectionColor(QHexEdit* theWrappedObject)
116 142 {
117 143 return ( theWrappedObject->selectionColor());
118 144 }
119 145
120 146 QString PythonQtWrapper_QHexEdit::selectionToReadableString(QHexEdit* theWrappedObject)
121 147 {
122 148 return ( theWrappedObject->selectionToReadableString());
123 149 }
124 150
125 151 void PythonQtWrapper_QHexEdit::setAddressAreaColor(QHexEdit* theWrappedObject, const QColor& color)
126 152 {
127 153 ( theWrappedObject->setAddressAreaColor(color));
128 154 }
129 155
130 156 void PythonQtWrapper_QHexEdit::setAddressOffset(QHexEdit* theWrappedObject, int offset)
131 157 {
132 158 ( theWrappedObject->setAddressOffset(offset));
133 159 }
134 160
135 161 void PythonQtWrapper_QHexEdit::setCursorPosition(QHexEdit* theWrappedObject, int cusorPos)
136 162 {
137 163 ( theWrappedObject->setCursorPosition(cusorPos));
138 164 }
139 165
140 166 void PythonQtWrapper_QHexEdit::setData(QHexEdit* theWrappedObject, const QByteArray& data)
141 167 {
142 168 ( theWrappedObject->setData(data));
143 169 }
144 170
145 171 void PythonQtWrapper_QHexEdit::setFont(QHexEdit* theWrappedObject, const QFont& arg__1)
146 172 {
147 173 ( theWrappedObject->setFont(arg__1));
148 174 }
149 175
150 176 void PythonQtWrapper_QHexEdit::setHighlightingColor(QHexEdit* theWrappedObject, const QColor& color)
151 177 {
152 178 ( theWrappedObject->setHighlightingColor(color));
153 179 }
154 180
155 181 void PythonQtWrapper_QHexEdit::setOverwriteMode(QHexEdit* theWrappedObject, bool arg__1)
156 182 {
157 183 ( theWrappedObject->setOverwriteMode(arg__1));
158 184 }
159 185
160 186 void PythonQtWrapper_QHexEdit::setReadOnly(QHexEdit* theWrappedObject, bool arg__1)
161 187 {
162 188 ( theWrappedObject->setReadOnly(arg__1));
163 189 }
164 190
165 191 void PythonQtWrapper_QHexEdit::setSelectionColor(QHexEdit* theWrappedObject, const QColor& color)
166 192 {
167 193 ( theWrappedObject->setSelectionColor(color));
168 194 }
169 195
170 196 QString PythonQtWrapper_QHexEdit::toReadableString(QHexEdit* theWrappedObject)
171 197 {
172 198 return ( theWrappedObject->toReadableString());
173 199 }
174 200
175 201
176 202
177 203 QHexSpinBox* PythonQtWrapper_QHexSpinBox::new_QHexSpinBox(QWidget* parent)
178 204 {
179 205 return new QHexSpinBox(parent); }
180 206
181 207 void PythonQtWrapper_QHexSpinBox::show(QHexSpinBox* theWrappedObject)
182 208 {
183 209 ( theWrappedObject->show());
184 210 }
185 211
186 212 QString PythonQtWrapper_QHexSpinBox::textFromValue(QHexSpinBox* theWrappedObject, int value) const
187 213 {
188 214 return ( theWrappedObject->textFromValue(value));
189 215 }
190 216
191 217 QValidator::State PythonQtWrapper_QHexSpinBox::validate(QHexSpinBox* theWrappedObject, QString& input, int& pos) const
192 218 {
193 219 return ( theWrappedObject->validate(input, pos));
194 220 }
195 221
196 222 int PythonQtWrapper_QHexSpinBox::valueFromText(QHexSpinBox* theWrappedObject, const QString& text) const
197 223 {
198 224 return ( theWrappedObject->valueFromText(text));
199 225 }
200 226
201 227
202 228
203 229 PythonQtShell_SocExplorerPlot::~PythonQtShell_SocExplorerPlot() {
204 230 PythonQtPrivate* priv = PythonQt::priv();
205 231 if (priv) { priv->shellClassDeleted(this); }
206 232 }
207 233 SocExplorerPlot* PythonQtWrapper_SocExplorerPlot::new_SocExplorerPlot(QWidget* parent)
208 234 {
209 235 return new PythonQtShell_SocExplorerPlot(parent); }
210 236
211 237 int PythonQtWrapper_SocExplorerPlot::addGraph(SocExplorerPlot* theWrappedObject)
212 238 {
213 239 return ( theWrappedObject->addGraph());
214 240 }
215 241
216 242 void PythonQtWrapper_SocExplorerPlot::addGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QList<QVariant > x, QList<QVariant > y)
217 243 {
218 244 ( theWrappedObject->addGraphData(graphIndex, x, y));
219 245 }
220 246
221 247 void PythonQtWrapper_SocExplorerPlot::addGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QVariant x, QVariant y)
222 248 {
223 249 ( theWrappedObject->addGraphData(graphIndex, x, y));
224 250 }
225 251
226 252 QPen PythonQtWrapper_SocExplorerPlot::getGraphPen(SocExplorerPlot* theWrappedObject, int graphIndex)
227 253 {
228 254 return ( theWrappedObject->getGraphPen(graphIndex));
229 255 }
230 256
231 257 void PythonQtWrapper_SocExplorerPlot::rescaleAxis(SocExplorerPlot* theWrappedObject)
232 258 {
233 259 ( theWrappedObject->rescaleAxis());
234 260 }
235 261
236 262 void PythonQtWrapper_SocExplorerPlot::setAdaptativeSampling(SocExplorerPlot* theWrappedObject, int graphIndex, bool enable)
237 263 {
238 264 ( theWrappedObject->setAdaptativeSampling(graphIndex, enable));
239 265 }
240 266
241 267 void PythonQtWrapper_SocExplorerPlot::setGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QList<QVariant > x, QList<QVariant > y)
242 268 {
243 269 ( theWrappedObject->setGraphData(graphIndex, x, y));
244 270 }
245 271
246 272 void PythonQtWrapper_SocExplorerPlot::setGraphLineStyle(SocExplorerPlot* theWrappedObject, int graphIndex, QString lineStyle)
247 273 {
248 274 ( theWrappedObject->setGraphLineStyle(graphIndex, lineStyle));
249 275 }
250 276
251 277 void PythonQtWrapper_SocExplorerPlot::setGraphName(SocExplorerPlot* theWrappedObject, int graphIndex, QString name)
252 278 {
253 279 ( theWrappedObject->setGraphName(graphIndex, name));
254 280 }
255 281
256 282 void PythonQtWrapper_SocExplorerPlot::setGraphPen(SocExplorerPlot* theWrappedObject, int graphIndex, QPen pen)
257 283 {
258 284 ( theWrappedObject->setGraphPen(graphIndex, pen));
259 285 }
260 286
261 287 void PythonQtWrapper_SocExplorerPlot::setGraphScatterStyle(SocExplorerPlot* theWrappedObject, int graphIndex, QString scatterStyle)
262 288 {
263 289 ( theWrappedObject->setGraphScatterStyle(graphIndex, scatterStyle));
264 290 }
265 291
266 292 void PythonQtWrapper_SocExplorerPlot::setLegendFont(SocExplorerPlot* theWrappedObject, QFont font)
267 293 {
268 294 ( theWrappedObject->setLegendFont(font));
269 295 }
270 296
271 297 void PythonQtWrapper_SocExplorerPlot::setLegendSelectedFont(SocExplorerPlot* theWrappedObject, QFont font)
272 298 {
273 299 ( theWrappedObject->setLegendSelectedFont(font));
274 300 }
275 301
276 302 void PythonQtWrapper_SocExplorerPlot::setTitle(SocExplorerPlot* theWrappedObject, QString title)
277 303 {
278 304 ( theWrappedObject->setTitle(title));
279 305 }
280 306
281 307 void PythonQtWrapper_SocExplorerPlot::setXaxisLabel(SocExplorerPlot* theWrappedObject, QString label)
282 308 {
283 309 ( theWrappedObject->setXaxisLabel(label));
284 310 }
285 311
286 312 void PythonQtWrapper_SocExplorerPlot::setXaxisRange(SocExplorerPlot* theWrappedObject, double lower, double upper)
287 313 {
288 314 ( theWrappedObject->setXaxisRange(lower, upper));
289 315 }
290 316
291 317 void PythonQtWrapper_SocExplorerPlot::setYaxisLabel(SocExplorerPlot* theWrappedObject, QString label)
292 318 {
293 319 ( theWrappedObject->setYaxisLabel(label));
294 320 }
295 321
296 322 void PythonQtWrapper_SocExplorerPlot::setYaxisRange(SocExplorerPlot* theWrappedObject, double lower, double upper)
297 323 {
298 324 ( theWrappedObject->setYaxisRange(lower, upper));
299 325 }
300 326
301 327 void PythonQtWrapper_SocExplorerPlot::show(SocExplorerPlot* theWrappedObject)
302 328 {
303 329 ( theWrappedObject->show());
304 330 }
305 331
306 332
307 333
308 334 TCP_Terminal_Client* PythonQtWrapper_TCP_Terminal_Client::new_TCP_Terminal_Client(QObject* parent)
309 335 {
310 336 return new TCP_Terminal_Client(parent); }
311 337
312 338 void PythonQtWrapper_TCP_Terminal_Client::connectToServer(TCP_Terminal_Client* theWrappedObject)
313 339 {
314 340 ( theWrappedObject->connectToServer());
315 341 }
316 342
317 343 void PythonQtWrapper_TCP_Terminal_Client::connectToServer(TCP_Terminal_Client* theWrappedObject, const QString& IP, int port)
318 344 {
319 345 ( theWrappedObject->connectToServer(IP, port));
320 346 }
321 347
322 348 bool PythonQtWrapper_TCP_Terminal_Client::isConnected(TCP_Terminal_Client* theWrappedObject)
323 349 {
324 350 return ( theWrappedObject->isConnected());
325 351 }
326 352
327 353 void PythonQtWrapper_TCP_Terminal_Client::sendText(TCP_Terminal_Client* theWrappedObject, const QString& text)
328 354 {
329 355 ( theWrappedObject->sendText(text));
330 356 }
331 357
332 358 void PythonQtWrapper_TCP_Terminal_Client::startServer(TCP_Terminal_Client* theWrappedObject)
333 359 {
334 360 ( theWrappedObject->startServer());
335 361 }
336 362
337 363 void PythonQtWrapper_TCP_Terminal_Client::startServer(TCP_Terminal_Client* theWrappedObject, int port)
338 364 {
339 365 ( theWrappedObject->startServer(port));
340 366 }
341 367
342 368
343 369
344 370 XByteArray* PythonQtWrapper_XByteArray::new_XByteArray()
345 371 {
346 372 return new XByteArray(); }
347 373
348 374 int PythonQtWrapper_XByteArray::addressOffset(XByteArray* theWrappedObject)
349 375 {
350 376 return ( theWrappedObject->addressOffset());
351 377 }
352 378
353 379 int PythonQtWrapper_XByteArray::addressWidth(XByteArray* theWrappedObject)
354 380 {
355 381 return ( theWrappedObject->addressWidth());
356 382 }
357 383
358 384 QChar PythonQtWrapper_XByteArray::asciiChar(XByteArray* theWrappedObject, int index)
359 385 {
360 386 return ( theWrappedObject->asciiChar(index));
361 387 }
362 388
363 389 QByteArray* PythonQtWrapper_XByteArray::data(XByteArray* theWrappedObject)
364 390 {
365 391 return &( theWrappedObject->data());
366 392 }
367 393
368 394 bool PythonQtWrapper_XByteArray::dataChanged(XByteArray* theWrappedObject, int i)
369 395 {
370 396 return ( theWrappedObject->dataChanged(i));
371 397 }
372 398
373 399 QByteArray PythonQtWrapper_XByteArray::dataChanged(XByteArray* theWrappedObject, int i, int len)
374 400 {
375 401 return ( theWrappedObject->dataChanged(i, len));
376 402 }
377 403
378 404 QByteArray* PythonQtWrapper_XByteArray::insert(XByteArray* theWrappedObject, int i, char ch)
379 405 {
380 406 return &( theWrappedObject->insert(i, ch));
381 407 }
382 408
383 409 QByteArray* PythonQtWrapper_XByteArray::insert(XByteArray* theWrappedObject, int i, const QByteArray& ba)
384 410 {
385 411 return &( theWrappedObject->insert(i, ba));
386 412 }
387 413
388 414 int PythonQtWrapper_XByteArray::realAddressNumbers(XByteArray* theWrappedObject)
389 415 {
390 416 return ( theWrappedObject->realAddressNumbers());
391 417 }
392 418
393 419 QByteArray* PythonQtWrapper_XByteArray::remove(XByteArray* theWrappedObject, int pos, int len)
394 420 {
395 421 return &( theWrappedObject->remove(pos, len));
396 422 }
397 423
398 424 QByteArray* PythonQtWrapper_XByteArray::replace(XByteArray* theWrappedObject, int index, char ch)
399 425 {
400 426 return &( theWrappedObject->replace(index, ch));
401 427 }
402 428
403 429 QByteArray* PythonQtWrapper_XByteArray::replace(XByteArray* theWrappedObject, int index, const QByteArray& ba)
404 430 {
405 431 return &( theWrappedObject->replace(index, ba));
406 432 }
407 433
408 434 QByteArray* PythonQtWrapper_XByteArray::replace(XByteArray* theWrappedObject, int index, int length, const QByteArray& ba)
409 435 {
410 436 return &( theWrappedObject->replace(index, length, ba));
411 437 }
412 438
413 439 void PythonQtWrapper_XByteArray::setAddressOffset(XByteArray* theWrappedObject, int offset)
414 440 {
415 441 ( theWrappedObject->setAddressOffset(offset));
416 442 }
417 443
418 444 void PythonQtWrapper_XByteArray::setAddressWidth(XByteArray* theWrappedObject, int width)
419 445 {
420 446 ( theWrappedObject->setAddressWidth(width));
421 447 }
422 448
423 449 void PythonQtWrapper_XByteArray::setData(XByteArray* theWrappedObject, QByteArray data)
424 450 {
425 451 ( theWrappedObject->setData(data));
426 452 }
427 453
428 454 void PythonQtWrapper_XByteArray::setDataChanged(XByteArray* theWrappedObject, int i, bool state)
429 455 {
430 456 ( theWrappedObject->setDataChanged(i, state));
431 457 }
432 458
433 459 void PythonQtWrapper_XByteArray::setDataChanged(XByteArray* theWrappedObject, int i, const QByteArray& state)
434 460 {
435 461 ( theWrappedObject->setDataChanged(i, state));
436 462 }
437 463
438 464 int PythonQtWrapper_XByteArray::size(XByteArray* theWrappedObject)
439 465 {
440 466 return ( theWrappedObject->size());
441 467 }
442 468
443 469 QString PythonQtWrapper_XByteArray::toRedableString(XByteArray* theWrappedObject, int start, int end)
444 470 {
445 471 return ( theWrappedObject->toRedableString(start, end));
446 472 }
447 473
448 474
449 475
476 elfFileWidget* PythonQtWrapper_elfFileWidget::new_elfFileWidget(QWidget* parent)
477 {
478 return new elfFileWidget(parent); }
479
480
481
450 482 elfparser* PythonQtWrapper_elfparser::new_elfparser()
451 483 {
452 484 return new elfparser(); }
453 485
454 486 int PythonQtWrapper_elfparser::closeFile(elfparser* theWrappedObject)
455 487 {
456 488 return ( theWrappedObject->closeFile());
457 489 }
458 490
491 QString PythonQtWrapper_elfparser::getABI(elfparser* theWrappedObject)
492 {
493 return ( theWrappedObject->getABI());
494 }
495
459 496 QString PythonQtWrapper_elfparser::getArchitecture(elfparser* theWrappedObject)
460 497 {
461 498 return ( theWrappedObject->getArchitecture());
462 499 }
463 500
501 QString PythonQtWrapper_elfparser::getClass(elfparser* theWrappedObject)
502 {
503 return ( theWrappedObject->getClass());
504 }
505
506 QString PythonQtWrapper_elfparser::getEndianness(elfparser* theWrappedObject)
507 {
508 return ( theWrappedObject->getEndianness());
509 }
510
464 511 bool PythonQtWrapper_elfparser::getSectionData(elfparser* theWrappedObject, int index, char** buffer)
465 512 {
466 513 return ( theWrappedObject->getSectionData(index, buffer));
467 514 }
468 515
469 516 QString PythonQtWrapper_elfparser::getSectionName(elfparser* theWrappedObject, int index)
470 517 {
471 518 return ( theWrappedObject->getSectionName(index));
472 519 }
473 520
474 521 QString PythonQtWrapper_elfparser::getSectionType(elfparser* theWrappedObject, int index)
475 522 {
476 523 return ( theWrappedObject->getSectionType(index));
477 524 }
478 525
479 526 int PythonQtWrapper_elfparser::getSectioncount(elfparser* theWrappedObject)
480 527 {
481 528 return ( theWrappedObject->getSectioncount());
482 529 }
483 530
484 531 QString PythonQtWrapper_elfparser::getSegmentFlags(elfparser* theWrappedObject, int index)
485 532 {
486 533 return ( theWrappedObject->getSegmentFlags(index));
487 534 }
488 535
489 536 QString PythonQtWrapper_elfparser::getSegmentType(elfparser* theWrappedObject, int index)
490 537 {
491 538 return ( theWrappedObject->getSegmentType(index));
492 539 }
493 540
494 541 int PythonQtWrapper_elfparser::getSegmentcount(elfparser* theWrappedObject)
495 542 {
496 543 return ( theWrappedObject->getSegmentcount());
497 544 }
498 545
499 546 QString PythonQtWrapper_elfparser::getType(elfparser* theWrappedObject)
500 547 {
501 548 return ( theWrappedObject->getType());
502 549 }
503 550
504 551 bool PythonQtWrapper_elfparser::static_elfparser_isElf(const QString& File)
505 552 {
506 553 return (elfparser::isElf(File));
507 554 }
508 555
509 556 bool PythonQtWrapper_elfparser::iself(elfparser* theWrappedObject)
510 557 {
511 558 return ( theWrappedObject->iself());
512 559 }
513 560
514 561 bool PythonQtWrapper_elfparser::isopened(elfparser* theWrappedObject)
515 562 {
516 563 return ( theWrappedObject->isopened());
517 564 }
518 565
519 566 int PythonQtWrapper_elfparser::setFilename(elfparser* theWrappedObject, const QString& name)
520 567 {
521 568 return ( theWrappedObject->setFilename(name));
522 569 }
523 570
524 571
@@ -1,210 +1,243
1 1 #include <PythonQt.h>
2 2 #include <QObject>
3 3 #include <QVariant>
4 4 #include <SocExplorerPlot.h>
5 #include <elffile.h>
6 #include <elffilewidget.h>
5 7 #include <elfparser.h>
6 8 #include <memsizewdgt.h>
7 9 #include <qhexedit.h>
8 10 #include <qhexspinbox.h>
9 11 #include <tcp_terminal_client.h>
10 12 #include <xbytearray.h>
11 13
12 14
13 15
16 class PythonQtWrapper_ElfFile : public QObject
17 { Q_OBJECT
18 public:
19 public slots:
20 ElfFile* new_ElfFile(QObject* parent = 0);
21 ElfFile* new_ElfFile(const QString& File, QObject* parent = 0);
22 void delete_ElfFile(ElfFile* obj) { delete obj; }
23 int closeFile(ElfFile* theWrappedObject);
24 bool isopened(ElfFile* theWrappedObject);
25 bool openFile(ElfFile* theWrappedObject, const QString& File);
26 };
27
28
29
30
31
14 32 class PythonQtWrapper_MemSizeWdgt : public QObject
15 33 { Q_OBJECT
16 34 public:
17 35 public slots:
18 36 MemSizeWdgt* new_MemSizeWdgt(QWidget* parent = 0);
19 37 MemSizeWdgt* new_MemSizeWdgt(int defaultSize, QWidget* parent = 0);
20 38 void delete_MemSizeWdgt(MemSizeWdgt* obj) { delete obj; }
21 39 int getsize(MemSizeWdgt* theWrappedObject);
22 40 void setMaximum(MemSizeWdgt* theWrappedObject, unsigned int max);
23 41 void show(MemSizeWdgt* theWrappedObject);
24 42 void updateSizeValue(MemSizeWdgt* theWrappedObject);
25 43 };
26 44
27 45
28 46
29 47
30 48
31 49 class PythonQtShell_QHexEdit : public QHexEdit
32 50 {
33 51 public:
34 52 PythonQtShell_QHexEdit(QWidget* parent = 0):QHexEdit(parent),_wrapper(NULL) {};
35 53
36 54 ~PythonQtShell_QHexEdit();
37 55
38 56
39 57 PythonQtInstanceWrapper* _wrapper;
40 58 };
41 59
42 60 class PythonQtWrapper_QHexEdit : public QObject
43 61 { Q_OBJECT
44 62 public:
45 63 public slots:
46 64 QHexEdit* new_QHexEdit(QWidget* parent = 0);
47 65 void delete_QHexEdit(QHexEdit* obj) { delete obj; }
48 66 QColor addressAreaColor(QHexEdit* theWrappedObject);
49 67 int addressOffset(QHexEdit* theWrappedObject);
50 68 int cursorPosition(QHexEdit* theWrappedObject);
51 69 QByteArray data(QHexEdit* theWrappedObject);
52 70 const QFont* font(QHexEdit* theWrappedObject) const;
53 71 QColor highlightingColor(QHexEdit* theWrappedObject);
54 72 int indexOf(QHexEdit* theWrappedObject, const QByteArray& ba, int from = 0) const;
55 73 void insert(QHexEdit* theWrappedObject, int i, char ch);
56 74 void insert(QHexEdit* theWrappedObject, int i, const QByteArray& ba);
57 75 bool isReadOnly(QHexEdit* theWrappedObject);
58 76 int lastIndexOf(QHexEdit* theWrappedObject, const QByteArray& ba, int from = 0) const;
59 77 bool overwriteMode(QHexEdit* theWrappedObject);
60 78 void remove(QHexEdit* theWrappedObject, int pos, int len = 1);
61 79 void replace(QHexEdit* theWrappedObject, int pos, int len, const QByteArray& after);
62 80 QColor selectionColor(QHexEdit* theWrappedObject);
63 81 QString selectionToReadableString(QHexEdit* theWrappedObject);
64 82 void setAddressAreaColor(QHexEdit* theWrappedObject, const QColor& color);
65 83 void setAddressOffset(QHexEdit* theWrappedObject, int offset);
66 84 void setCursorPosition(QHexEdit* theWrappedObject, int cusorPos);
67 85 void setData(QHexEdit* theWrappedObject, const QByteArray& data);
68 86 void setFont(QHexEdit* theWrappedObject, const QFont& arg__1);
69 87 void setHighlightingColor(QHexEdit* theWrappedObject, const QColor& color);
70 88 void setOverwriteMode(QHexEdit* theWrappedObject, bool arg__1);
71 89 void setReadOnly(QHexEdit* theWrappedObject, bool arg__1);
72 90 void setSelectionColor(QHexEdit* theWrappedObject, const QColor& color);
73 91 QString toReadableString(QHexEdit* theWrappedObject);
74 92 };
75 93
76 94
77 95
78 96
79 97
80 98 class PythonQtWrapper_QHexSpinBox : public QObject
81 99 { Q_OBJECT
82 100 public:
83 101 public slots:
84 102 QHexSpinBox* new_QHexSpinBox(QWidget* parent = 0);
85 103 void delete_QHexSpinBox(QHexSpinBox* obj) { delete obj; }
86 104 void show(QHexSpinBox* theWrappedObject);
87 105 QString textFromValue(QHexSpinBox* theWrappedObject, int value) const;
88 106 QValidator::State validate(QHexSpinBox* theWrappedObject, QString& input, int& pos) const;
89 107 int valueFromText(QHexSpinBox* theWrappedObject, const QString& text) const;
90 108 };
91 109
92 110
93 111
94 112
95 113
96 114 class PythonQtShell_SocExplorerPlot : public SocExplorerPlot
97 115 {
98 116 public:
99 117 PythonQtShell_SocExplorerPlot(QWidget* parent = 0):SocExplorerPlot(parent),_wrapper(NULL) {};
100 118
101 119 ~PythonQtShell_SocExplorerPlot();
102 120
103 121
104 122 PythonQtInstanceWrapper* _wrapper;
105 123 };
106 124
107 125 class PythonQtWrapper_SocExplorerPlot : public QObject
108 126 { Q_OBJECT
109 127 public:
110 128 public slots:
111 129 SocExplorerPlot* new_SocExplorerPlot(QWidget* parent = 0);
112 130 void delete_SocExplorerPlot(SocExplorerPlot* obj) { delete obj; }
113 131 int addGraph(SocExplorerPlot* theWrappedObject);
114 132 void addGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QList<QVariant > x, QList<QVariant > y);
115 133 void addGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QVariant x, QVariant y);
116 134 QPen getGraphPen(SocExplorerPlot* theWrappedObject, int graphIndex);
117 135 void rescaleAxis(SocExplorerPlot* theWrappedObject);
118 136 void setAdaptativeSampling(SocExplorerPlot* theWrappedObject, int graphIndex, bool enable);
119 137 void setGraphData(SocExplorerPlot* theWrappedObject, int graphIndex, QList<QVariant > x, QList<QVariant > y);
120 138 void setGraphLineStyle(SocExplorerPlot* theWrappedObject, int graphIndex, QString lineStyle);
121 139 void setGraphName(SocExplorerPlot* theWrappedObject, int graphIndex, QString name);
122 140 void setGraphPen(SocExplorerPlot* theWrappedObject, int graphIndex, QPen pen);
123 141 void setGraphScatterStyle(SocExplorerPlot* theWrappedObject, int graphIndex, QString scatterStyle);
124 142 void setLegendFont(SocExplorerPlot* theWrappedObject, QFont font);
125 143 void setLegendSelectedFont(SocExplorerPlot* theWrappedObject, QFont font);
126 144 void setTitle(SocExplorerPlot* theWrappedObject, QString title);
127 145 void setXaxisLabel(SocExplorerPlot* theWrappedObject, QString label);
128 146 void setXaxisRange(SocExplorerPlot* theWrappedObject, double lower, double upper);
129 147 void setYaxisLabel(SocExplorerPlot* theWrappedObject, QString label);
130 148 void setYaxisRange(SocExplorerPlot* theWrappedObject, double lower, double upper);
131 149 void show(SocExplorerPlot* theWrappedObject);
132 150 };
133 151
134 152
135 153
136 154
137 155
138 156 class PythonQtWrapper_TCP_Terminal_Client : public QObject
139 157 { Q_OBJECT
140 158 public:
141 159 public slots:
142 160 TCP_Terminal_Client* new_TCP_Terminal_Client(QObject* parent = 0);
143 161 void delete_TCP_Terminal_Client(TCP_Terminal_Client* obj) { delete obj; }
144 162 void connectToServer(TCP_Terminal_Client* theWrappedObject);
145 163 void connectToServer(TCP_Terminal_Client* theWrappedObject, const QString& IP, int port);
146 164 bool isConnected(TCP_Terminal_Client* theWrappedObject);
147 165 void sendText(TCP_Terminal_Client* theWrappedObject, const QString& text);
148 166 void startServer(TCP_Terminal_Client* theWrappedObject);
149 167 void startServer(TCP_Terminal_Client* theWrappedObject, int port);
150 168 };
151 169
152 170
153 171
154 172
155 173
156 174 class PythonQtWrapper_XByteArray : public QObject
157 175 { Q_OBJECT
158 176 public:
159 177 public slots:
160 178 XByteArray* new_XByteArray();
161 179 void delete_XByteArray(XByteArray* obj) { delete obj; }
162 180 int addressOffset(XByteArray* theWrappedObject);
163 181 int addressWidth(XByteArray* theWrappedObject);
164 182 QChar asciiChar(XByteArray* theWrappedObject, int index);
165 183 QByteArray* data(XByteArray* theWrappedObject);
166 184 bool dataChanged(XByteArray* theWrappedObject, int i);
167 185 QByteArray dataChanged(XByteArray* theWrappedObject, int i, int len);
168 186 QByteArray* insert(XByteArray* theWrappedObject, int i, char ch);
169 187 QByteArray* insert(XByteArray* theWrappedObject, int i, const QByteArray& ba);
170 188 int realAddressNumbers(XByteArray* theWrappedObject);
171 189 QByteArray* remove(XByteArray* theWrappedObject, int pos, int len);
172 190 QByteArray* replace(XByteArray* theWrappedObject, int index, char ch);
173 191 QByteArray* replace(XByteArray* theWrappedObject, int index, const QByteArray& ba);
174 192 QByteArray* replace(XByteArray* theWrappedObject, int index, int length, const QByteArray& ba);
175 193 void setAddressOffset(XByteArray* theWrappedObject, int offset);
176 194 void setAddressWidth(XByteArray* theWrappedObject, int width);
177 195 void setData(XByteArray* theWrappedObject, QByteArray data);
178 196 void setDataChanged(XByteArray* theWrappedObject, int i, bool state);
179 197 void setDataChanged(XByteArray* theWrappedObject, int i, const QByteArray& state);
180 198 int size(XByteArray* theWrappedObject);
181 199 QString toRedableString(XByteArray* theWrappedObject, int start = 0, int end = -1);
182 200 };
183 201
184 202
185 203
186 204
187 205
206 class PythonQtWrapper_elfFileWidget : public QObject
207 { Q_OBJECT
208 public:
209 public slots:
210 elfFileWidget* new_elfFileWidget(QWidget* parent = 0);
211 void delete_elfFileWidget(elfFileWidget* obj) { delete obj; }
212 };
213
214
215
216
217
188 218 class PythonQtWrapper_elfparser : public QObject
189 219 { Q_OBJECT
190 220 public:
191 221 public slots:
192 222 elfparser* new_elfparser();
193 223 void delete_elfparser(elfparser* obj) { delete obj; }
194 224 int closeFile(elfparser* theWrappedObject);
225 QString getABI(elfparser* theWrappedObject);
195 226 QString getArchitecture(elfparser* theWrappedObject);
227 QString getClass(elfparser* theWrappedObject);
228 QString getEndianness(elfparser* theWrappedObject);
196 229 bool getSectionData(elfparser* theWrappedObject, int index, char** buffer);
197 230 QString getSectionName(elfparser* theWrappedObject, int index);
198 231 QString getSectionType(elfparser* theWrappedObject, int index);
199 232 int getSectioncount(elfparser* theWrappedObject);
200 233 QString getSegmentFlags(elfparser* theWrappedObject, int index);
201 234 QString getSegmentType(elfparser* theWrappedObject, int index);
202 235 int getSegmentcount(elfparser* theWrappedObject);
203 236 QString getType(elfparser* theWrappedObject);
204 237 bool static_elfparser_isElf(const QString& File);
205 238 bool iself(elfparser* theWrappedObject);
206 239 bool isopened(elfparser* theWrappedObject);
207 240 int setFilename(elfparser* theWrappedObject, const QString& name);
208 241 };
209 242
210 243
@@ -1,14 +1,16
1 1 #include <PythonQt.h>
2 2 #include "PySocExplorer0.h"
3 3
4 4
5 5 void PythonQt_init_PySocExplorer(PyObject* module) {
6 PythonQt::priv()->registerClass(&ElfFile::staticMetaObject, "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_ElfFile>, NULL, module, 0);
6 7 PythonQt::priv()->registerCPPClass("MemSizeWdgt", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_MemSizeWdgt>, NULL, module, 0);
7 8 PythonQt::priv()->registerCPPClass("QHexEdit", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_QHexEdit>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_QHexEdit>, module, 0);
8 9 PythonQt::priv()->registerCPPClass("QHexSpinBox", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_QHexSpinBox>, NULL, module, 0);
9 10 PythonQt::priv()->registerCPPClass("SocExplorerPlot", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_SocExplorerPlot>, PythonQtSetInstanceWrapperOnShell<PythonQtShell_SocExplorerPlot>, module, 0);
10 11 PythonQt::priv()->registerClass(&TCP_Terminal_Client::staticMetaObject, "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_TCP_Terminal_Client>, NULL, module, 0);
11 12 PythonQt::priv()->registerCPPClass("XByteArray", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_XByteArray>, NULL, module, 0);
13 PythonQt::priv()->registerCPPClass("elfFileWidget", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_elfFileWidget>, NULL, module, 0);
12 14 PythonQt::priv()->registerCPPClass("elfparser", "", "PySocExplorer", PythonQtCreateObject<PythonQtWrapper_elfparser>, NULL, module, 0);
13 15
14 16 }
@@ -1,30 +1,34
1 1 <typesystem package="PySocExplorer" default-superclass="com.trolltech.qt.QtJambiObject">
2 <load-typesystem name=":/trolltech/generator/typesystem_core.txt" generate="no" />
3 <load-typesystem name=":/trolltech/generator/typesystem_gui.txt" generate="no" />
2 <load-typesystem name=":/trolltech/generator/typesystem_core.txt" generate="yes" />
3 <load-typesystem name=":/trolltech/generator/typesystem_gui.txt" generate="yes" />
4 4 <load-typesystem name=":/trolltech/generator/typesystem_sql.txt" generate="no" />
5 5 <load-typesystem name=":/trolltech/generator/typesystem_opengl.txt" generate="no" />
6 6 <load-typesystem name=":/trolltech/generator/typesystem_svg.txt" generate="no" />
7 7 <load-typesystem name=":/trolltech/generator/typesystem_network.txt" generate="no" />
8 8 <load-typesystem name=":/trolltech/generator/typesystem_xml.txt" generate="no" />
9 9 <load-typesystem name=":/trolltech/generator/typesystem_xmlpatterns.txt" generate="no" />
10 10 <load-typesystem name=":/trolltech/generator/typesystem_webkit.txt" generate="no" />
11 11 <load-typesystem name=":/trolltech/generator/typesystem_phonon.txt" generate="no" />
12 12
13 <rejection class="abstractExecFile" />
13 14
14 15 <object-type name="QHexSpinBox" />
15 16 <object-type name="MemSizeWdgt" />
16 17 <object-type name="QHexEdit" />
17 18 <object-type name="XByteArray" />
18 19 <object-type name="SocExplorerPlot" />
19 20 <object-type name="TCP_Terminal_Client" />
20 <object-type name="elfparser" />
21 <object-type name="elfparser" />
22 <object-type name="abstractExecFile" />
23 <object-type name="ElfFile" />
24 <object-type name="elfFileWidget" />
21 25
22 26 </typesystem>
23 27
24 28
25 29
26 30
27 31
28 32
29 33
30 34
@@ -1,6 +1,6
1 1 #!/bin/bash
2 2
3 3 #export QTDIR=/usr/include
4 4 export QTDIR=/usr/include/qt5
5 5
6 pythonqt_generator --output-directory=pythonQtOut PySocExplorer.h pythonQtgeneratorCfg.txt
6 pythonqt_generator --dump-object-tree --output-directory=pythonQtOut PySocExplorer.h pythonQtgeneratorCfg.txt
General Comments 0
You need to be logged in to leave comments. Login now