Permalink
Browse files

First code commit

First commit with the app code
  • Loading branch information...
Hugo Teso
Hugo Teso committed Mar 29, 2017
1 parent 53c6108 commit ca821e10647ba55c1cbabb5de8b4fc631fd6a065
Showing with 61,582 additions and 0 deletions.
  1. BIN Screenshots/Screenshot.png
  2. +136 −0 src/Iaito.pro
  3. +18 −0 src/analthread.cpp
  4. +21 −0 src/analthread.h
  5. +183 −0 src/createnewdialog.cpp
  6. +33 −0 src/createnewdialog.h
  7. +458 −0 src/createnewdialog.ui
  8. +27 −0 src/dialogs/aboutdialog.cpp
  9. +25 −0 src/dialogs/aboutdialog.h
  10. +99 −0 src/dialogs/aboutdialog.ui
  11. +29 −0 src/dialogs/commentsdialog.cpp
  12. +29 −0 src/dialogs/commentsdialog.h
  13. +109 −0 src/dialogs/commentsdialog.ui
  14. +36 −0 src/dialogs/renamedialog.cpp
  15. +30 −0 src/dialogs/renamedialog.h
  16. +112 −0 src/dialogs/renamedialog.ui
  17. +132 −0 src/dialogs/xrefsdialog.cpp
  18. +46 −0 src/dialogs/xrefsdialog.h
  19. +198 −0 src/dialogs/xrefsdialog.ui
  20. BIN src/fonts/Anonymous Pro.ttf
  21. BIN src/fonts/Inconsolata-Regular.ttf
  22. +31 −0 src/helpers.cpp
  23. +24 −0 src/helpers.h
  24. +49 −0 src/hexascii_highlighter.cpp
  25. +40 −0 src/hexascii_highlighter.h
  26. +76 −0 src/hexhighlighter.cpp
  27. +40 −0 src/hexhighlighter.h
  28. +75 −0 src/highlighter.cpp
  29. +44 −0 src/highlighter.h
  30. +12,269 −0 src/html/Chart.js
  31. +45 −0 src/html/bar.html
  32. +71 −0 src/html/fcn_graph.html
  33. +65 −0 src/html/fcn_radar.html
  34. +43 −0 src/html/graph.html
  35. +35 −0 src/html/graph/index.html
  36. +176 −0 src/html/graph/lib/css/disasm.css
  37. +9 −0 src/html/graph/lib/css/joint.min.css
  38. +262 −0 src/html/graph/lib/css/main.css
  39. +49 −0 src/html/graph/lib/js/bokken.js
  40. +1,087 −0 src/html/graph/lib/js/disasm.js
  41. +593 −0 src/html/graph/lib/js/disasm_panel.js
  42. +14 −0 src/html/graph/lib/js/joint.js
  43. +9 −0 src/html/graph/lib/js/joint.layout.DirectedGraph.js
  44. +9,555 −0 src/html/graph/lib/js/jquery-1.9.0.js
  45. +14,879 −0 src/html/graph/lib/js/jquery-ui-latest.js
  46. +187 −0 src/html/graph/lib/js/jquery.scrollTo-latest.js
  47. +597 −0 src/html/graph/lib/js/r2_bokken.js
  48. +252 −0 src/html/graph/lib/js/r2ui.js
  49. +109 −0 src/html/radar.html
  50. +86 −0 src/html/stats.html
  51. +13 −0 src/html/utils.js
  52. +1,302 −0 src/html/viz.js
  53. BIN src/img/Enso copy.icns
  54. BIN src/img/Enso.icns
  55. +16 −0 src/img/Enso.svg
  56. BIN src/img/Logo simple white.xcf
  57. BIN src/img/Logo simple.xcf
  58. BIN src/img/Logo.png
  59. BIN src/img/Logo.xcf
  60. BIN src/img/icons/arrow_left.png
  61. BIN src/img/icons/arrow_right.png
  62. BIN src/img/icons/clear_light.png
  63. BIN src/img/icons/cloud.png
  64. BIN src/img/icons/cloud_white.png
  65. BIN src/img/icons/cog.png
  66. BIN src/img/icons/cog_light.png
  67. BIN src/img/icons/cog_white.png
  68. BIN src/img/icons/disas_light.png
  69. BIN src/img/icons/disas_white.png
  70. BIN src/img/icons/down.png
  71. BIN src/img/icons/down_white.png
  72. BIN src/img/icons/edit_light.png
  73. BIN src/img/icons/equalizer.png
  74. BIN src/img/icons/eye.png
  75. BIN src/img/icons/eye_white.png
  76. BIN src/img/icons/graph_light.png
  77. BIN src/img/icons/graph_white.png
  78. BIN src/img/icons/help.png
  79. BIN src/img/icons/hexdump_light.png
  80. BIN src/img/icons/hexdump_white.png
  81. BIN src/img/icons/left.png
  82. BIN src/img/icons/load_light.png
  83. BIN src/img/icons/lock.png
  84. BIN src/img/icons/lock_white.png
  85. BIN src/img/icons/new_light.png
  86. BIN src/img/icons/play.png
  87. BIN src/img/icons/plus.png
  88. BIN src/img/icons/polar.png
  89. BIN src/img/icons/polar_white.png
  90. BIN src/img/icons/radar.png
  91. BIN src/img/icons/radar_white.png
  92. BIN src/img/icons/redo.png
  93. BIN src/img/icons/right.png
  94. BIN src/img/icons/run_light.png
  95. BIN src/img/icons/save_light.png
  96. BIN src/img/icons/spin.png
  97. BIN src/img/icons/spin_grey.png
  98. BIN src/img/icons/spin_white.png
  99. BIN src/img/icons/tabs.png
  100. BIN src/img/icons/tabs_white.png
  101. BIN src/img/icons/target.png
  102. BIN src/img/icons/themes.png
  103. BIN src/img/icons/themes_white.png
  104. BIN src/img/icons/transfer.png
  105. BIN src/img/icons/transfer_white.png
  106. BIN src/img/icons/trash_light.png
  107. BIN src/img/icons/undo.png
  108. BIN src/img/icons/unlock.png
  109. BIN src/img/icons/unlock_white.png
  110. BIN src/img/icons/up.png
  111. BIN src/img/icons/up_white.png
  112. BIN src/img/logo-small-white.png
  113. BIN src/img/logo-small.png
  114. BIN src/img/logo2.png
  115. +64 −0 src/img/r2.svg
  116. +13 −0 src/main.cpp
  117. +1,109 −0 src/mainwindow.cpp
  118. +218 −0 src/mainwindow.h
  119. +1,096 −0 src/mainwindow.ui
  120. +43 −0 src/mdhighlighter.cpp
  121. +40 −0 src/mdhighlighter.h
  122. +195 −0 src/newfiledialog.cpp
  123. +43 −0 src/newfiledialog.h
  124. +283 −0 src/newfiledialog.ui
  125. +262 −0 src/optionsdialog.cpp
  126. +50 −0 src/optionsdialog.h
  127. +932 −0 src/optionsdialog.ui
  128. +685 −0 src/qrcore.cpp
  129. +90 −0 src/qrcore.h
  130. +13 −0 src/qrdisasm.cpp
  131. +74 −0 src/qrdisasm.h
  132. +90 −0 src/resources.qrc
  133. +14 −0 src/webserverthread.cpp
  134. +21 −0 src/webserverthread.h
  135. +27 −0 src/widgets/banned.h
  136. +110 −0 src/widgets/codegraphic.cpp
  137. +29 −0 src/widgets/codegraphic.h
  138. +137 −0 src/widgets/commentswidget.cpp
  139. +49 −0 src/widgets/commentswidget.h
  140. +376 −0 src/widgets/commentswidget.ui
  141. +160 −0 src/widgets/dashboard.cpp
  142. +28 −0 src/widgets/dashboard.h
  143. +1,197 −0 src/widgets/dashboard.ui
  144. +34 −0 src/widgets/flagswidget.cpp
  145. +36 −0 src/widgets/flagswidget.h
  146. +150 −0 src/widgets/flagswidget.ui
  147. +380 −0 src/widgets/functionswidget.cpp
  148. +52 −0 src/widgets/functionswidget.h
  149. +285 −0 src/widgets/functionswidget.ui
  150. +83 −0 src/widgets/importswidget.cpp
  151. +41 −0 src/widgets/importswidget.h
  152. +99 −0 src/widgets/importswidget.ui
  153. +1,673 −0 src/widgets/memwidget/memorywidget.cpp
  154. +167 −0 src/widgets/memwidget/memorywidget.h
  155. +3,055 −0 src/widgets/memwidget/memorywidget.ui
  156. +320 −0 src/widgets/notepad.cpp
  157. +71 −0 src/widgets/notepad.h
  158. +774 −0 src/widgets/notepad.ui
  159. +145 −0 src/widgets/omnibar.cpp
  160. +37 −0 src/widgets/omnibar.h
  161. +559 −0 src/widgets/pieview.cpp
  162. +104 −0 src/widgets/pieview.h
  163. +30 −0 src/widgets/relocswidget.cpp
  164. +32 −0 src/widgets/relocswidget.h
  165. +91 −0 src/widgets/relocswidget.ui
  166. +104 −0 src/widgets/sdbdock.cpp
  167. +36 −0 src/widgets/sdbdock.h
  168. +159 −0 src/widgets/sdbdock.ui
  169. +116 −0 src/widgets/sectionswidget.cpp
  170. +45 −0 src/widgets/sectionswidget.h
  171. +111 −0 src/widgets/sidebar.cpp
  172. +49 −0 src/widgets/sidebar.h
  173. +1,148 −0 src/widgets/sidebar.ui
  174. +32 −0 src/widgets/stringswidget.cpp
  175. +32 −0 src/widgets/stringswidget.h
  176. +95 −0 src/widgets/stringswidget.ui
  177. +39 −0 src/widgets/symbolswidget.cpp
  178. +33 −0 src/widgets/symbolswidget.h
  179. +94 −0 src/widgets/symbolswidget.ui
View
Binary file not shown.
View
@@ -0,0 +1,136 @@
#-------------------------------------------------
#
# Project created by QtCreator 2014-02-27T11:31:27
#
#-------------------------------------------------
ICON = img/Enso.icns
# No idea what this does exactly
TEMPLATE = app
# The application version
VERSION = 1.0-dev
# Define the preprocessor macro to get the application version in our application.
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
QT += core gui webkit webkitwidgets
QT_CONFIG -= no-pkg-config
macx {
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc+
EXTSO=dylib
} else {
win32 {
EXTSO=dll
} else {
EXTSO=so
}
}
CONFIG += c++11
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Iaito
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
newfiledialog.cpp \
optionsdialog.cpp \
highlighter.cpp \
qrcore.cpp \
createnewdialog.cpp \
hexascii_highlighter.cpp \
webserverthread.cpp \
widgets/pieview.cpp \
widgets/sectionswidget.cpp \
widgets/codegraphic.cpp \
widgets/notepad.cpp \
mdhighlighter.cpp \
widgets/functionswidget.cpp \
dialogs/renamedialog.cpp \
dialogs/aboutdialog.cpp \
widgets/importswidget.cpp \
widgets/symbolswidget.cpp \
widgets/relocswidget.cpp \
widgets/commentswidget.cpp \
widgets/stringswidget.cpp \
widgets/flagswidget.cpp \
widgets/memwidget/memorywidget.cpp \
qrdisasm.cpp \
widgets/sdbdock.cpp \
analthread.cpp \
dialogs/commentsdialog.cpp \
widgets/sidebar.cpp \
helpers.cpp \
widgets/omnibar.cpp \
widgets/dashboard.cpp \
dialogs/xrefsdialog.cpp \
hexhighlighter.cpp
HEADERS += mainwindow.h \
newfiledialog.h \
optionsdialog.h \
highlighter.h \
qrcore.h \
createnewdialog.h \
hexascii_highlighter.h \
webserverthread.h \
widgets/pieview.h \
widgets/sectionswidget.h \
widgets/codegraphic.h \
widgets/notepad.h \
mdhighlighter.h \
widgets/functionswidget.h \
dialogs/renamedialog.h \
dialogs/aboutdialog.h \
widgets/importswidget.h \
widgets/symbolswidget.h \
widgets/relocswidget.h \
widgets/commentswidget.h \
widgets/stringswidget.h \
widgets/flagswidget.h \
widgets/memwidget/memorywidget.h \
qrdisasm.h \
widgets/sdbdock.h \
analthread.h \
dialogs/commentsdialog.h \
widgets/sidebar.h \
helpers.h \
widgets/omnibar.h \
widgets/dashboard.h \
dialogs/xrefsdialog.h \
widgets/banned.h \
hexhighlighter.h
FORMS += mainwindow.ui \
newfiledialog.ui \
optionsdialog.ui \
createnewdialog.ui \
widgets/notepad.ui \
widgets/functionswidget.ui \
dialogs/aboutdialog.ui \
dialogs/renamedialog.ui \
widgets/importswidget.ui \
widgets/symbolswidget.ui \
widgets/relocswidget.ui \
widgets/commentswidget.ui \
widgets/stringswidget.ui \
widgets/flagswidget.ui \
widgets/memwidget/memorywidget.ui \
widgets/sdbdock.ui \
dialogs/commentsdialog.ui \
widgets/sidebar.ui \
widgets/dashboard.ui \
dialogs/xrefsdialog.ui
RESOURCES += \
resources.qrc
#INCLUDEPATH += /usr/local/radare2/osx/include/libr
INCLUDEPATH += /usr/local/include/libr
#LIBS += -L/usr/local/radare2/osx/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto
LIBS += -L/usr/local/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto
View
@@ -0,0 +1,18 @@
#include "analthread.h"
#include <QDebug>
#include "mainwindow.h"
AnalThread::AnalThread(MainWindow *main, QWidget *parent) :
QThread(parent)
{
// Radare core found in:
this->main = main;
//this->level = 2;
}
// run() will be called when a thread starts
void AnalThread::run()
{
//qDebug() << "Anal level: " << this->level;
this->main->core->analyze(this->level);
}
View
@@ -0,0 +1,21 @@
#ifndef ANALTHREAD_H
#define ANALTHREAD_H
#include <QThread>
class MainWindow;
class AnalThread : public QThread
{
Q_OBJECT
public:
explicit AnalThread(MainWindow *main, QWidget *parent = 0);
void run();
int level;
private:
MainWindow *main;
};
#endif // ANALTHREAD_H
View
@@ -0,0 +1,183 @@
#include "createnewdialog.h"
#include "ui_createnewdialog.h"
#include <QMessageBox>
#include "newfiledialog.h"
#include "r_util.h"
createNewDialog::createNewDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::createNewDialog)
{
ui->setupUi(this);
w = new MainWindow(this);
w->core = new QRCore ();
}
createNewDialog::~createNewDialog()
{
delete ui;
}
void createNewDialog::on_pushButton_2_clicked()
{
// Close dialog and open OptionsDialog
close();
NewFileDialog* n = new NewFileDialog(this);
n->show();
}
void createNewDialog::on_pushButton_3_clicked()
{
close();
}
void createNewDialog::on_exampleButton_clicked()
{
QString type = ui->comboType->currentText();
QString str;
if (type == "Assembler") {
str = "; Sample program code\nmov eax, 1\nint 0x80";
} else if (type == "Text") {
str = "Hello World";
} else if (type == "Rapatch") {
str = "; Sample rapatch script\n"
"0x0 \"Hello World\n"
"0x10 909090";
} else if (type == "C Code") {
str = "int main() {\n"
" write (1, \"Hello World\", 12);\n"
" exit (0);\n"
"}";
} else if (type == "Radare2 script") {
str = "w Hello\ns+5\nw World";
} else if (type == "Hexpairs") {
str = "48656c6c6f20576f726c6400";
} else fprintf (stderr, "Unknown combo value selected");
if (str.length()>0)
ui->plainTextEdit->setPlainText(str);
// }
}
void createNewDialog::on_buttonCreate_clicked()
{
QString type = ui->comboType->currentText();
QString str;
bool created = false;
QString arch = ui->comboArch->currentText();
int bits = atoi (ui->comboBits->currentText().toStdString().c_str());
int fsize = r_num_math (NULL, ui->entrySize->text().toStdString().c_str());
QString format = ui->comboFormat->currentText();
if (type == "Assembler") {
const char *asmcode = ui->plainTextEdit->toPlainText().toStdString().c_str();
RAsmCode *code = r_asm_massemble (w->core->core->assembler, asmcode);
if (code && code->len>0) {
char file[32];
snprintf (file, sizeof(file)-1, "malloc://%d", code->len);
if (w->core->loadFile(file,0,0,1,0,0,false)) {
created = true;
r_core_write_at(w->core->core,0, code->buf, code->len);
} else {
__alert ("Failed to create file");
}
} else {
__alert ("Invalid assembler code");
}
r_asm_code_free (code);
} else if (type == "Rapatch") {
if (fsize>0) {
char file[32];
created = true;
snprintf (file, sizeof(file)-1, "malloc://%d", fsize);
if (w->core->loadFile(file,0,0,1,0,0,false)) {
const char *rapatch = ui->plainTextEdit->toPlainText().toStdString().c_str();
r_core_patch (w->core->core, rapatch);
r_core_seek(w->core->core, 0, 1);
created = true;
} else {
__alert ("failed to open file");
}
} else {
__alert ("Invalid file size");
}
} else if (type == "C Code") {
__alert("C Code: TODO");
// ragg2-cc -x
} else if (type == "Radare2 script") {
if (fsize>0) {
char file[32];
created = true;
snprintf (file, sizeof(file)-1, "malloc://%d", fsize);
if (w->core->loadFile(file,0,0,1,0,0,false)) {
created = true;
QString str = ui->plainTextEdit->toPlainText().toStdString().c_str();
QList <QString> lines = str.split("\n");
foreach (QString str, lines) {
w->core->cmd(str);
}
} else {
__alert ("failed to open file");
}
} else {
__alert ("Invalid file size");
}
} else if (type == "Text") {
char file[32];
const char *hexpairs = ui->plainTextEdit->toPlainText().toStdString().c_str();
int sz = strlen (hexpairs);
if (sz>0) {
snprintf (file, sizeof(file)-1, "malloc://%d", sz);
if (w->core->loadFile(file,0,0,1,0,0,false)) {
created = true;
r_core_write_at(w->core->core,0, (const ut8*)hexpairs, sz);
} else {
__alert ("failed to open file");
}
} else {
__alert ("Empty string?");
}
} else if (type == "Hexpairs") {
char file[32];
int sz;
const char *hexpairs = ui->plainTextEdit->toPlainText().toStdString().c_str();
ut8 *buf = (ut8*)malloc (strlen (hexpairs));
sz = r_hex_str2bin (hexpairs, buf);
if (sz>0) {
snprintf (file, sizeof(file)-1, "malloc://%d", sz);
if (w->core->loadFile(file,0,0,1,0,0,false)) {
created = true;
r_core_write_at(w->core->core,0, buf, sz);
} else {
__alert ("failed to open file");
}
} else {
__alert ("Invalid hexpair string");
}
free (buf);
} else {
__alert ("Unknown combo value selected");
return;
}
if (format != "Raw") {
__alert ("TODO: non-raw fileformat is not yet supported");
created = false;
delete w->core;
}
if (created) {
// Close dialog and open OptionsDialog
close();
w->core->seek(0);
w->updateFrames();
w->setFilename("-");
w->add_output("Finished, check its contents");
w->showMaximized();
} else {
__alert ("No file created.");
}
}
View
@@ -0,0 +1,33 @@
#ifndef CREATENEWDIALOG_H
#define CREATENEWDIALOG_H
#include <QDialog>
#include "mainwindow.h"
namespace Ui {
class createNewDialog;
}
class createNewDialog : public QDialog
{
Q_OBJECT
public:
explicit createNewDialog(QWidget *parent = 0);
~createNewDialog();
private slots:
void on_pushButton_2_clicked();
void on_pushButton_3_clicked();
void on_exampleButton_clicked();
void on_buttonCreate_clicked();
private:
Ui::createNewDialog *ui;
MainWindow* w;
};
#endif // CREATENEWDIALOG_H
Oops, something went wrong.

0 comments on commit ca821e1

Please sign in to comment.