mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Remove cutter win32 (#58)
* remove cutter_win32 * build without compile errors * temporary workaround for sdb problems (now compiles again at least) * totally not a hack to get sdb working seriously, don't do this but it works
This commit is contained in:
parent
ff080c1d3c
commit
e3e070d094
@ -14,45 +14,28 @@ branches:
|
|||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
environment:
|
environment:
|
||||||
PYTHON: 'C:\\Python36-x64'
|
PYTHON: 'C:\Python36-x64'
|
||||||
BDIR: build-cmake
|
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
|
||||||
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip
|
|
||||||
QTDIR: 'C:\Qt\5.9.1\msvc2015_64'
|
QTDIR: 'C:\Qt\5.9.1\msvc2015_64'
|
||||||
|
QT32PATH: 'C:\Qt\5.9.1\msvc2015'
|
||||||
install:
|
QT64PATH: 'C:\Qt\5.9.1\msvc2015_64'
|
||||||
- cmd: git submodule init && git submodule update
|
VSVARSALLPATH: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
|
||||||
- cmd: if defined BDIR ( %PYTHON%\python.exe -m pip install meson && COPY %PYTHON%\Scripts\meson.py radare2\meson.py )
|
|
||||||
- cmd: if defined NINJA_URL ( powershell -Command wget %NINJA_URL% -OutFile radare2\ninja.zip && unzip radare2\ninja.zip -d radare2\ )
|
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
# Build r2 and generate sln
|
- cmd: prepare_r2.bat
|
||||||
- cmd: cd radare2 && set "PATH=%PYTHON%;%PATH%" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && meson.bat --release --shared && sys\meson_install.bat --with-static dist && cd ..
|
|
||||||
# Build cutter
|
|
||||||
- cmd: set "PATH=%PATH%;%QTDIR%\bin;" && call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 && cd src && qmake -config release -tp vc cutter.pro && cd ..
|
|
||||||
|
|
||||||
# Build config
|
# Build config
|
||||||
build:
|
build_script:
|
||||||
project: src\cutter.vcxproj
|
- cmd: build.bat 32
|
||||||
|
- cmd: build.bat 64
|
||||||
after_build:
|
|
||||||
# Install r2
|
|
||||||
- cmd: move radare2\dist cutter
|
|
||||||
- cmd: cd cutter && dir
|
|
||||||
- cmd: for %%v in (*.dll) do echo %%v
|
|
||||||
- cmd: for %%v in (*.dll) do ren %%v lib%%v
|
|
||||||
- cmd: cd ..
|
|
||||||
# Install cutter
|
|
||||||
- cmd: windeployqt src\release\cutter.exe --dir cutter
|
|
||||||
- cmd: move src\release\cutter.exe cutter\
|
|
||||||
- cmd: set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PATH%" && zip -r cutter.zip cutter
|
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
test: off
|
test: off
|
||||||
|
|
||||||
# Artifacts
|
# Artifacts
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: cutter.zip
|
- path: build32\cutter32
|
||||||
name: Cutter
|
- path: build64\cutter64
|
||||||
|
|
||||||
#deploy:
|
#deploy:
|
||||||
# release: cutter-1.0-$(appveyor_build_version)
|
# release: cutter-1.0-$(appveyor_build_version)
|
||||||
|
12
.gitignore
vendored
12
.gitignore
vendored
@ -59,4 +59,16 @@ Win32/
|
|||||||
x64/
|
x64/
|
||||||
*.dir/
|
*.dir/
|
||||||
build*/
|
build*/
|
||||||
|
release/
|
||||||
|
debug/
|
||||||
*.orig
|
*.orig
|
||||||
|
/src/*.vcxproj
|
||||||
|
/src/*.vcxproj.filters
|
||||||
|
/src/cutter_resource.rc
|
||||||
|
|
||||||
|
#prepare_r2
|
||||||
|
meson.py
|
||||||
|
ninja.exe
|
||||||
|
/dist32/
|
||||||
|
/dist64/
|
||||||
|
*.pdb
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,6 +1,3 @@
|
|||||||
[submodule "radare2"]
|
[submodule "radare2"]
|
||||||
path = radare2
|
path = radare2
|
||||||
url = https://github.com/radare/radare2
|
url = https://github.com/radare/radare2
|
||||||
[submodule "cutter_win32"]
|
|
||||||
path = cutter_win32
|
|
||||||
url = https://github.com/radareorg/cutter_win32
|
|
||||||
|
43
build.bat
Normal file
43
build.bat
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
echo Setting path
|
||||||
|
if "%OLDPATH%"=="" set OLDPATH=%PATH%
|
||||||
|
if "%QT32PATH%"=="" set QT32PATH=C:\Qt\5.9.1\msvc2015
|
||||||
|
if "%QT64PATH%"=="" set QT64PATH=C:\Qt\5.9.1\msvc2015_64
|
||||||
|
if "%VSVARSALLPATH%"=="" set VSVARSALLPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
|
||||||
|
|
||||||
|
if "%1"=="32" (
|
||||||
|
set "PATH=%QT32PATH%\bin;%PATH%"
|
||||||
|
call "%VSVARSALLPATH%" x86
|
||||||
|
set MSBUILDPLATFORM=Win32
|
||||||
|
) else if "%1"=="64" (
|
||||||
|
set "PATH=%QT64PATH%\bin;%PATH%"
|
||||||
|
call "%VSVARSALLPATH%" x64
|
||||||
|
set MSBUILDPLATFORM=x64
|
||||||
|
) else (
|
||||||
|
echo Usage: build.bat 32/64
|
||||||
|
goto restorepath
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Preparing directory
|
||||||
|
rmdir /s /q build%1
|
||||||
|
mkdir build%1
|
||||||
|
cd build%1
|
||||||
|
|
||||||
|
echo Building cutter
|
||||||
|
qmake ..\src\cutter.pro -config release -tp vc
|
||||||
|
if not %ERRORLEVEL%==0 exit
|
||||||
|
msbuild /m cutter.vcxproj /p:Configuration=Release;Platform=%MSBUILDPLATFORM%
|
||||||
|
if not %ERRORLEVEL%==0 exit
|
||||||
|
|
||||||
|
echo Deploying cutter
|
||||||
|
mkdir cutter%1
|
||||||
|
move release\cutter.exe cutter%1\cutter.exe
|
||||||
|
xcopy /s ..\dist%1 cutter%1\
|
||||||
|
windeployqt cutter%1\cutter.exe
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
:restorepath
|
||||||
|
echo Restoring path
|
||||||
|
set PATH=%OLDPATH%
|
||||||
|
set OLDPATH=
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 5f8109de359fc3e65cc0382691d99c5a7852f26e
|
|
57
cutter_win32/include/r_addr_interval_msvc.h
Normal file
57
cutter_win32/include/r_addr_interval_msvc.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#ifndef R_ADDR_INTERVAL_H
|
||||||
|
#define R_ADDR_INTERVAL_H
|
||||||
|
|
||||||
|
#pragma message("r_addr_interval_msvc.h(4): warning C1337: hacky implementation of r_addr_interval, be wary!")
|
||||||
|
//MSVC (C++) implementation of radare2/include/libr/r_util/r_addr_interval.h
|
||||||
|
//DO NOT REMOVE THE WARNING BEFORE R2 IS FIXED!
|
||||||
|
|
||||||
|
#include <r_types.h>
|
||||||
|
|
||||||
|
// An interval in 64-bit address space which is aware of address space wraparound
|
||||||
|
// Precondition: 0 <= size < 2**64 and addr + size <= 2**64
|
||||||
|
typedef struct r_addr_interval_t {
|
||||||
|
// public:
|
||||||
|
ut64 addr;
|
||||||
|
ut64 size;
|
||||||
|
} RAddrInterval;
|
||||||
|
|
||||||
|
static inline ut64 r_itv_begin(RAddrInterval itv) {
|
||||||
|
return itv.addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns the right endpoint address (not included)
|
||||||
|
static inline ut64 r_itv_end(RAddrInterval itv) {
|
||||||
|
return itv.addr + itv.size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if itv contained addr
|
||||||
|
static inline bool r_itv_contain(RAddrInterval itv, ut64 addr) {
|
||||||
|
ut64 end = itv.addr + itv.size;
|
||||||
|
return itv.addr <= addr && (!end || addr < end);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if x is a subset of itv
|
||||||
|
static inline bool r_itv_include(RAddrInterval itv, RAddrInterval x) {
|
||||||
|
ut64 end = itv.addr + itv.size;
|
||||||
|
return itv.addr <= x.addr && (!end || (x.addr + x.size && x.addr + x.size <= end));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if itv and x overlap (implying they are non-empty)
|
||||||
|
static inline bool r_itv_overlap(RAddrInterval itv, RAddrInterval x) {
|
||||||
|
ut64 end = itv.addr + itv.size, end1 = x.addr + x.size;
|
||||||
|
return (!end1 || itv.addr < end1) && (!end || x.addr < end);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool r_itv_overlap2(RAddrInterval itv, ut64 addr, ut64 size) {
|
||||||
|
return r_itv_overlap (itv, RAddrInterval{addr, size});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Precondition: itv and x overlap
|
||||||
|
// Returns the intersection of itv and x
|
||||||
|
static inline RAddrInterval r_itv_intersect(RAddrInterval itv, RAddrInterval x) {
|
||||||
|
ut64 addr = R_MAX (itv.addr, x.addr),
|
||||||
|
end = R_MIN (itv.addr + itv.size - 1, x.addr + x.size - 1) + 1;
|
||||||
|
return RAddrInterval{addr, end - addr};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // R_ADDR_INTERVAL_H
|
0
cutter_win32/include/sys/time.h
Normal file
0
cutter_win32/include/sys/time.h
Normal file
10
cutter_win32/include/unistd.h
Normal file
10
cutter_win32/include/unistd.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//http://stackoverflow.com/a/826027/1806760
|
||||||
|
|
||||||
|
#ifndef UNISTD_H
|
||||||
|
#define UNISTD_H
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <io.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#endif
|
2
cutter_win32/radare2/include/.gitignore
vendored
Normal file
2
cutter_win32/radare2/include/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Relevant files will be placed here after running prepare_r2.bat
|
||||||
|
/libr/
|
2
cutter_win32/radare2/lib32/.gitignore
vendored
Normal file
2
cutter_win32/radare2/lib32/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Relevant files will be placed here after running prepare_r2.bat
|
||||||
|
/*.lib
|
2
cutter_win32/radare2/lib64/.gitignore
vendored
Normal file
2
cutter_win32/radare2/lib64/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Relevant files will be placed here after running prepare_r2.bat
|
||||||
|
/*.lib
|
54
prepare_r2.bat
Normal file
54
prepare_r2.bat
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
@echo off
|
||||||
|
|
||||||
|
if "%OLDPATH%"=="" set OLDPATH=%PATH%
|
||||||
|
if "%PYTHON%"=="" set PYTHON=C:\Python36-x64
|
||||||
|
if "%NINJA_URL%"=="" set NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
|
||||||
|
if "%VSVARSALLPATH%"=="" set VSVARSALLPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
|
||||||
|
|
||||||
|
set "PYTHONHOME=%PYTHON%"
|
||||||
|
set "PATH=%PYTHON%;%PATH%"
|
||||||
|
|
||||||
|
git submodule update --init
|
||||||
|
|
||||||
|
echo Downloading meson and ninja
|
||||||
|
python -m pip install meson && COPY %PYTHON%\Scripts\meson.py meson.py
|
||||||
|
if defined NINJA_URL ( powershell -Command wget %NINJA_URL% -OutFile ninja.zip && unzip -o ninja.zip -d .\ && del ninja.zip )
|
||||||
|
|
||||||
|
cd radare2
|
||||||
|
|
||||||
|
echo Building radare2 (x86)
|
||||||
|
git clean -xfd
|
||||||
|
copy ..\ninja.exe .\
|
||||||
|
copy ..\meson.py .\
|
||||||
|
rmdir /s /q ..\dist32
|
||||||
|
call "%VSVARSALLPATH%" x86
|
||||||
|
call meson.bat --release --shared
|
||||||
|
if not %ERRORLEVEL%==0 exit
|
||||||
|
call sys\meson_install.bat --with-static ..\dist32
|
||||||
|
copy /Y build\r_userconf.h ..\dist32\include\libr\
|
||||||
|
copy /Y build\r_version.h ..\dist32\include\libr\
|
||||||
|
copy /Y build\shlr\liblibr2sdb.a ..\dist32\r_sdb.lib
|
||||||
|
|
||||||
|
echo Building radare2 (x64)
|
||||||
|
git clean -xfd
|
||||||
|
copy ..\ninja.exe .\
|
||||||
|
copy ..\meson.py .\
|
||||||
|
rmdir /s /q ..\dist64
|
||||||
|
call "%VSVARSALLPATH%" x64
|
||||||
|
call meson.bat --release --shared
|
||||||
|
if not %ERRORLEVEL%==0 exit
|
||||||
|
call sys\meson_install.bat --with-static ..\dist64
|
||||||
|
copy /Y build\shlr\liblibr2sdb.a ..\dist64\r_sdb.lib
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
echo Copying relevant files in cutter_win32
|
||||||
|
xcopy /s /Y dist32\include\libr cutter_win32\radare2\include\libr\
|
||||||
|
copy /Y dist32\*.lib cutter_win32\radare2\lib32\
|
||||||
|
copy /Y dist64\*.lib cutter_win32\radare2\lib64\
|
||||||
|
|
||||||
|
del ninja.exe
|
||||||
|
del meson.py
|
||||||
|
|
||||||
|
set PATH=%OLDPATH%
|
||||||
|
set OLDPATH=
|
19
src/cutter.h
19
src/cutter.h
@ -1,18 +1,10 @@
|
|||||||
#ifndef CUTTER_H
|
#ifndef CUTTER_H
|
||||||
#define CUTTER_H
|
#define CUTTER_H
|
||||||
|
|
||||||
#include <QMap>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QJsonDocument>
|
|
||||||
|
|
||||||
|
|
||||||
// Workaround for compile errors on Windows
|
// Workaround for compile errors on Windows
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <r2hacks.h>
|
#include <r_addr_interval_msvc.h>
|
||||||
#endif
|
#endif //_WIN32
|
||||||
|
|
||||||
#include "r_core.h"
|
#include "r_core.h"
|
||||||
|
|
||||||
@ -22,6 +14,13 @@
|
|||||||
#undef max
|
#undef max
|
||||||
#endif //_WIN32
|
#endif //_WIN32
|
||||||
|
|
||||||
|
#include <QMap>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
|
||||||
#define HAVE_LATEST_LIBR2 false
|
#define HAVE_LATEST_LIBR2 false
|
||||||
|
|
||||||
#define CutterRListForeach(list, it, type, x) \
|
#define CutterRListForeach(list, it, type, x) \
|
||||||
|
@ -32,7 +32,8 @@ win32 {
|
|||||||
-lr_socket \
|
-lr_socket \
|
||||||
-lr_fs \
|
-lr_fs \
|
||||||
-lr_magic \
|
-lr_magic \
|
||||||
-lr_crypto
|
-lr_crypto \
|
||||||
|
-lr_sdb
|
||||||
} else {
|
} else {
|
||||||
USE_PKGCONFIG = 1
|
USE_PKGCONFIG = 1
|
||||||
R2_USER_PKGCONFIG = $$(HOME)/bin/prefix/radare2/lib/pkgconfig
|
R2_USER_PKGCONFIG = $$(HOME)/bin/prefix/radare2/lib/pkgconfig
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#include <QtGui>
|
|
||||||
|
|
||||||
#include "Highlighter.h"
|
#include "Highlighter.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
|
|
||||||
Highlighter::Highlighter(QTextDocument *parent) :
|
Highlighter::Highlighter(QTextDocument *parent) :
|
||||||
QSyntaxHighlighter(parent)
|
QSyntaxHighlighter(parent)
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef HIGHLIGHTER_H
|
#ifndef HIGHLIGHTER_H
|
||||||
#define HIGHLIGHTER_H
|
#define HIGHLIGHTER_H
|
||||||
|
|
||||||
#include <QSyntaxHighlighter>
|
|
||||||
|
|
||||||
#include "cutter.h"
|
#include "cutter.h"
|
||||||
|
|
||||||
|
#include <QSyntaxHighlighter>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QTextCharFormat>
|
#include <QTextCharFormat>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#ifndef DISASSEMBLYVIEW_H
|
#ifndef DISASSEMBLYVIEW_H
|
||||||
#define DISASSEMBLYVIEW_H
|
#define DISASSEMBLYVIEW_H
|
||||||
|
|
||||||
|
#include "cutter.h"
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include "cutter.h"
|
|
||||||
|
|
||||||
class DisassemblyWidget : public QDockWidget
|
class DisassemblyWidget : public QDockWidget
|
||||||
{
|
{
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef EXPORTSWIDGET_H
|
#ifndef EXPORTSWIDGET_H
|
||||||
#define EXPORTSWIDGET_H
|
#define EXPORTSWIDGET_H
|
||||||
|
|
||||||
|
#include "cutter.h"
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "cutter.h"
|
|
||||||
#include "DockWidget.h"
|
#include "DockWidget.h"
|
||||||
|
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "cutter.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -46,7 +47,6 @@
|
|||||||
#define M_PI 3.1415927
|
#define M_PI 3.1415927
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "cutter.h"
|
|
||||||
#include "PieView.h"
|
#include "PieView.h"
|
||||||
|
|
||||||
PieView::PieView(QWidget *parent)
|
PieView::PieView(QWidget *parent)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef PREVIEWWIDGET_H
|
#ifndef PREVIEWWIDGET_H
|
||||||
#define PREVIEWWIDGET_H
|
#define PREVIEWWIDGET_H
|
||||||
|
|
||||||
|
#include "cutter.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
@ -10,7 +11,6 @@
|
|||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "cutter.h"
|
|
||||||
#include "utils/Highlighter.h"
|
#include "utils/Highlighter.h"
|
||||||
#include "utils/HexAsciiHighlighter.h"
|
#include "utils/HexAsciiHighlighter.h"
|
||||||
#include "utils/HexHighlighter.h"
|
#include "utils/HexHighlighter.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user