mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Update r2 and use R_PERM flags
This commit is contained in:
parent
6fe3681871
commit
5c52991cd8
2
radare2
2
radare2
@ -1 +1 @@
|
||||
Subproject commit 126b4088937fcfbc32e73b54aa42943ae96a561f
|
||||
Subproject commit 28bdc63a7d41c748e946551bae70f74df98c1e0f
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user