02/15/2014
https://www.facebook.com/luzxs
My prebuild for IDA: https://anonfiles.com/file/84b6ed79703b94e5e360aa06350fb651
Notes: Replace Qt*.dll from your IDA Dir with Qt*.dll in this settup, because it difference version
If you've ever wanted to use IDA's native GUIs, you'll need PySide. Unfortunately PySide is annoying to compile, and the only available binaries are for Python 2.6. This should work for any version.
Notes: Replace Qt*.dll from your IDA Dir with Qt*.dll in this settup, because it difference version
If you've ever wanted to use IDA's native GUIs, you'll need PySide. Unfortunately PySide is annoying to compile, and the only available binaries are for Python 2.6. This should work for any version.
Note:
The python module installer executable at the end of this guide did not work
for me. The compiled pyd and dll files, however were completely usable from
within IDA.
Prequisites
·
Python
2.7
§
Run
and install, I’ll be using C:\Python27
·
Perl
5.18
·
Visual
Studio 2010
·
Visual
Studio 2010 Service Pack 1
·
Windows SDK v7.0 is required
when building against Python 2.6, 2.7 or 3.2
·
Qt
4.8.5 Source Code (Qt libraries 4.8.5 for Windows (VS 2010, 235 MB))
§
Run
and install this in your computer, I’ll be using C:\Qt\4.8.5
- setuptools python module
- https://pypi.python.org/pypi/setuptools
- Get it
at https://bitbucket.org/pypa/setuptools/get/default.tar.gz#egg=setuptools-dev
- Extract
and run setup.py install
- cmake
- http://www.cmake.org/cmake/resources/software.html
- Get it
at http://www.cmake.org/files/v2.8/cmake-2.8.12.1-win32-x86.exe
- Run and
install, I used C:\Cmake 2.8
- git for windows
- gnuwin32
- http://sourceforge.net/projects/getgnuwin32/files/
- Download
and install it (will be usefull !)
·
After setup these tool, you need to add some key
in the Environment Variables
o
Right Click Computer > Properties >
Advanced > Environment Variables…
§
INCLUDE=C:\Program Files\Microsoft Visual Studio
10.0\VC\include;C:\Program Files\Microsoft
SDKs\Windows\v7.0A\Include;C:\Qt\4.8.5\include
§
LIB=C:\Python27\Lib;C:\Qt\4.8.5\lib
§
PYTHONHOME=C:\Python27
§
QMAKESPEC=win32-msvc2010
§
QTDIR=C:\Qt\4.8.5
§
QT_NAMESPACE=QT
§
PATH=%PATH%;%QTDIR%\bin;C:\Python27;C:\Python27\Scripts;C:\Qt\4.8.5\qmake
Compiling QT 4
It is necessary to build the Qt environment, because IDA is
shipped with a custom version of Qt which wraps its classes inside the QT
namespace (we’ll see later why that is so).
Download the latest version of jom from http://qt-project.org/wiki/jom It
will accelerate the build process by using all available cores at build time,
more on this further down. Extract jom files to
C:\Qt\jom
Start Visual Studio 2010
Command Prompt as an administrator.
On Win7 this can be done by right-clicking Start > Programs > Microsoft Visual Studio 2010 > Visual
Studio Tools > Visual Studio Command
Prompt (2010) and choosing "Run
as Administrator" from the popup menu.
On Win8 you can reach the shortcut by typing "Visual
Studio" to get a list of app and shortcuts known to the system, it should
list this particular shortcut to. Right-click it and choose to run as
administrator from the bottom ribbon.
Run the following commands in it (every line is a different
command. Type it, then press Enter):
>>
cd c:\Qt\4.8.5
To compile both debug and release versions type or copy/paste:
C:\Qt\4.8.5>configure
-debug-and-release -platform win32-msvc2010 -no-qt3support -qtnamespace QT
I chose to only compile the release version like so:
C:\Qt\4.8.5>configure
-release -opensource -platform win32-msvc2010 –no-qt3support –qtnamespace QT
Note:
1. Don't
get irritated by the -platform flag reading "win32-msvc2010". It
simply means that the MS Visual Studio compiler will be used and does not
specify the architecture (x64 or x32, which was in fact already chosen by
starting the Visual Studio x64 command prompt above). In other words: "-platform" is always
"win32-msvc2010" for us in the context of this example, even for
win64 builds.
2. If you customize the configure line, make sure you leave in
the
-qtnamespace QT
! Otherwise your binaries will be unusable from within IDA.
This will take a few minutes, depending on your hardware. When
it's done it should report back by printing:
"Qt is now configured
for building. Just run nmake.To reconfigure, run nmake confclean and configure."
Build
Qt using jom
Jom is an nmake replacement for Qt compilation on multi-core CPUs.
Its parameter -j N allows to setup the number of parallel processes for
compilation. Larger is better, where N is the number of CPU cores you want to
utilize for Qt compilation. The number of physical CPU cores is a good choice
for N, e.g. 4 on a typical quad-core CPU.
Usually compilation takes about 10 hours on a single core, with
jom and an SSD drive it took only a bit more than 1 hour on my machine (Windows
8, 64bits)
Still in the same command prompt, enter and execute the following:
C:\Qt\4.8.5>..\jom\jom.exe
-j 4
You might want to use a different number in the end if you have a
system with more or less physical CPU cores.
This stage took around 2 hours on my PC
Example build may be fail, but it’s OK
Compiling PySide (We’ll use C:\ as Root Directory)
·
Get the packaging code
o
cd /d c:\
- git clone
git://gitorious.org/pyside/packaging.git
- Change directory to packaging/setuptools/
o
cd
/d c:\packaging\setuptools
·
Edit
build.py to comment out the Tools repository
# Modules
modules = {
'dev': [
["Apiextractor",
"master", "https://github.com/PySide/Apiextractor.git"],
["Generatorrunner",
"master",
"https://github.com/PySide/Generatorrunner.git"],
["Shiboken",
"master", "https://github.com/PySide/Shiboken.git"],
["PySide",
"master", "https://github.com/PySide/PySide.git"],
#["Tools",
"master", "https://github.com/PySide/Tools.git"],
],
'stable': [
["Apiextractor",
"0.10.8", "https://github.com/PySide/Apiextractor.git"],
["Generatorrunner",
"0.6.14",
"https://github.com/PySide/Generatorrunner.git"],
["Shiboken",
"1.0.9", "https://github.com/PySide/Shiboken.git"],
["PySide",
"1.0.8", "https://github.com/PySide/PySide.git"],
#["Tools",
"0.2.13", "https://github.com/PySide/Tools.git"],
],
}
|
·
Open
the Visual Studio 2010 Comand Prompt
·
Add
the directory of qmake to your path
- set
path=%path%;C:\Qt\4.8.5\qmake
·
Change
Directory to C:\packaging\setuptools\modules
o
cd /d c:\packaging\setuptools\modules
§ I use build.py –d to download all the
repositories, but It get error, so I manual download package from it repo
§ In Command Prompts
·
git clone
https://github.com/PySide/Apiextractor.git && git clone
https://github.com/PySide/Generatorrunner.git && git clone https://github.com/PySide/Shiboken.git
&& git clone https://github.com/PySide/PySide.git
·
! Notes :
All command is in oneline and you must install gnuwin32 to this command to run,
or you can type one command each line (ex: git
clone https://github.com/PySide/Apiextractor.git)
·
Change directory into each of
the repositories and run the following commands to checkout repo:
o
Apiextractor
§ cd /d \packaging\setuptools\modules\Apiextractor
§ git checkout 0.10.8
o
Generatorrunner
§ cd /d \packaging\setuptools\modules\Generatorrunner
§ git checkout 0.6.14
o
Shiboken
§ cd /d \packaging\setuptools\modules\Shiboken
§ git checkout 1.0.9
o
PySide
§ cd /d \packaging\setuptools\modules\PySide
§ git checkout 1.0.8
·
Download this patch and apply it using git
o
Copy pyside.diff to C:\packaging\setuptools\
§ cd /d c:\packaging\setuptools
§ git apply
--ignore-whitespace pyside.diff
Notes : If this task fail, you can manual apply
to source by open pyside.diff and read instruction
+++ : File need to edit
@@ 8, 9 … Line to edit
-
delete
line
+ add line
- Patch the calls to deallocData in Siboken so they pass in two arguments
(second argument should be True)
- c:\packaging\setuptools\modules\Shiboken\libshiboken\basewrapper.cpp
extern "C" {
void deallocData(SbkObject* self, bool cleanup);
static void SbkObjectTypeDealloc(PyObject* pyObj);
|
void DtorCallerVisitor::done() {
Shiboken::Object::deallocData(m_pyObj, true);
std::list<std::pair<void*,
SbkObjectType*> >::const_iterator it = m_ptrs.begin();
|
c:\packaging\setuptools\modules\Shiboken\libshiboken\basewrapper_p.h
* Destroy internal data
**/
void deallocData(SbkObject* self);
void deallocData(SbkObject* self, bool cleanup);
} // namespace Objectging
|
c:\packaging\setuptools\modules\Shiboken\CmakeLists.txt
C:\packaging\setuptools\modules\shiboken\generator\cppgenerator.cppset(shiboken_VERSION "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}.${shiboken_MICRO_VERSION}")IF (NOT $ENV{QT_NAMESPACE} STREQUAL "")add_definitions(-DQT_NAMESPACE=$ENV{QT_NAMESPACE})ENDIF (NOT $ENV{QT_NAMESPACE} STREQUAL "")option(BUILD_TESTS "Build tests." TRUE)
Bug : error C2661: 'QFileWrapper::open' : no overloaded function takes 3 arguments http://comments.gmane.org/gmane.comp.lib.qt.pyside/2995With QT > 4.8.0
Locate :
--------
&& (func->name() != "qt_metacall"))
overloads.append(func);
---------
and replace with:
……………
&& (func->name() != "qt_metacall")) {
if (func->toString().contains("open")) {
if (func->isVirtual())
overloads.append(func);
}
else
overloads.append(func);
}
………….
|
·
Open up another Visual Studio 2010 Command Prompt
Open up another Visual Studio 2010 Command Prompt
·
Add
cmake/qmake/git/qt to your PATH and set the Qt namespace
·
set path=%path%;C:\CMake 2.8\bin
·
set path=%path%;C:\Qt\4.8.5\qmake
·
set path=%path%;C:\Git\bin
·
set path=%path%;C:\Qt\4.8.5\bin
·
set QT_NAMESPACE=QT
|
·
Start the build process
o Build.py
o This takes around an hour on my PC
Notes :
If you get error while linking with
generatorrunner.exe, please copy QtCore4.dll, QtGui4.dll, QtXml4.dll from
C:\Qt\4.8.5\bin to C:\packaging\setuptools\install-py2.7-qt4.8.5\bin, this
error cause by generatorrunner.exe can’t get it dependency library.
·
Your
new PySide installer should be available in packaging\setuptools\dist
No comments:
Post a Comment