Update r2 and use R_PERM flags

This commit is contained in:
Florian Märkl 2018-09-22 18:00:21 +02:00
parent 6fe3681871
commit 5c52991cd8
4 changed files with 7 additions and 7 deletions

@ -1 +1 @@
Subproject commit 126b4088937fcfbc32e73b54aa42943ae96a561f
Subproject commit 28bdc63a7d41c748e946551bae70f74df98c1e0f

View File

@ -26,9 +26,9 @@ void AnalTask::runTask()
log(tr("Loading Binary...\n"));
openFailed = false;
int perms = R_IO_READ | R_IO_EXEC;
int perms = R_PERM_RX;
if (options.writeEnabled)
perms |= R_IO_WRITE;
perms |= R_PERM_W;
// Demangle (must be before file Core()->loadFile)
Core()->setConfig("bin.demangle", options.demangle);

View File

@ -289,7 +289,7 @@ bool CutterCore::loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int
r_core_cmd0 (core_, "s entry0");
}
if (perms & R_IO_WRITE) {
if (perms & R_PERM_W) {
r_core_cmd0 (core_, "omfg+w");
}
@ -302,8 +302,8 @@ bool CutterCore::tryFile(QString path, bool rw)
{
CORE_LOCK();
RCoreFile *cf;
int flags = R_IO_READ;
if (rw) flags |= R_IO_WRITE;
int flags = R_PERM_R;
if (rw) flags = R_PERM_RW;
cf = r_core_file_open(this->core_, path.toUtf8().constData(), flags, 0LL);
if (!cf) {
return false;

View File

@ -427,7 +427,7 @@ public:
void setCurrentBits(int bits, RVA offset = RVA_INVALID);
/* File related methods */
bool loadFile(QString path, ut64 baddr = 0LL, ut64 mapaddr = 0LL, int perms = R_IO_READ,
bool loadFile(QString path, ut64 baddr = 0LL, ut64 mapaddr = 0LL, int perms = R_PERM_R,
int va = 0, bool loadbin = false, const QString &forceBinPlugin = nullptr);
bool tryFile(QString path, bool rw);
void openFile(QString path, RVA mapaddr);