Skip to content

Commit

Permalink
Fix closing file in CutterCore::tryFile(), Fix radareorg#26
Browse files Browse the repository at this point in the history
  • Loading branch information
thestr4ng3r committed Nov 25, 2017
1 parent 05982b1 commit b013789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ MainWindow::MainWindow(QWidget *parent) :

MainWindow::~MainWindow()
{
//delete core;
}

void MainWindow::initUI()
Expand Down
6 changes: 2 additions & 4 deletions src/cutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,7 @@ bool CutterCore::loadFile(QString path, uint64_t loadaddr, uint64_t mapaddr, boo
RCoreFile *f;
if (va == 0 || va == 2)
r_config_set_i(core_->config, "io.va", va);
// NO ONE KNOWS WHY THIS IS FIXING A SEGFAULT. core_->file should have already a proper value. Pancake dixit
//core_->file = NULL;
// mapaddr = 0LL;

printf("FILE OPEN (%s)\n", path.toUtf8().constData());
f = r_core_file_open(core_, path.toUtf8().constData(), rw ? (R_IO_READ | R_IO_WRITE) : R_IO_READ, mapaddr);
if (!f)
Expand Down Expand Up @@ -459,7 +457,7 @@ bool CutterCore::tryFile(QString path, bool rw)
}
// if rbin works, tell entry0, and symbols (main, constructor, ..)

//r_core_file_close (this->core, cf);
r_core_file_close (this->core_, cf);

sdb_bool_set(DB, "try.is_writable", is_writable, 0);
sdb_set(DB, "try.filetype", "elf.i386", 0);
Expand Down

0 comments on commit b013789

Please sign in to comment.