mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-30 08:45:25 +00:00
Remove some unused members from CutterCore
This commit is contained in:
parent
aad3797159
commit
fa6902d41c
@ -372,10 +372,6 @@ void MainWindow::finalizeOpen()
|
||||
"\n" + core->cmd("ie") + "\n" + core->cmd("iM") + "\n");
|
||||
}
|
||||
|
||||
//Get binary beginning/end addresses
|
||||
this->core->binStart = this->core->cmd("?v $M");
|
||||
this->core->binEnd = this->core->cmd("?v $M+$s");
|
||||
|
||||
addOutput(tr(" > Finished, happy reversing :)"));
|
||||
// Add fortune message
|
||||
addOutput("\n" + core->cmd("fo"));
|
||||
|
@ -74,41 +74,6 @@ CutterCore *CutterCore::getInstance()
|
||||
return uniqueInstance;
|
||||
}
|
||||
|
||||
|
||||
int CutterCore::getCycloComplex(ut64 addr)
|
||||
{
|
||||
CORE_LOCK();
|
||||
QString ret = "";
|
||||
RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0);
|
||||
if (fcn)
|
||||
{
|
||||
ret = cmd("afcc @ " + QString(fcn->name));
|
||||
return ret.toInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
int CutterCore::getFcnSize(ut64 addr)
|
||||
{
|
||||
CORE_LOCK();
|
||||
QString ret = "";
|
||||
QString tmp_ret = "";
|
||||
RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0);
|
||||
if (fcn)
|
||||
{
|
||||
tmp_ret = cmd("afi~size[1] " + QString(fcn->name));
|
||||
ret = tmp_ret.split("\n")[0];
|
||||
return ret.toInt() / 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
QList<QString> CutterCore::sdbList(QString path)
|
||||
{
|
||||
CORE_LOCK();
|
||||
@ -474,44 +439,6 @@ ut64 CutterCore::math(const QString &expr)
|
||||
return r_num_math(this->core_ ? this->core_->num : NULL, expr.toUtf8().constData());
|
||||
}
|
||||
|
||||
int CutterCore::fcnCyclomaticComplexity(ut64 addr)
|
||||
{
|
||||
CORE_LOCK();
|
||||
RAnalFunction *fcn = r_anal_get_fcn_at(core_->anal, addr, addr);
|
||||
if (fcn)
|
||||
return r_anal_fcn_cc(fcn);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CutterCore::fcnBasicBlockCount(ut64 addr)
|
||||
{
|
||||
CORE_LOCK();
|
||||
//RAnalFunction *fcn = r_anal_get_fcn_at (core_->anal, addr, addr);
|
||||
RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0);
|
||||
if (fcn)
|
||||
{
|
||||
return r_list_length(fcn->bbs);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CutterCore::fcnEndBbs(RVA addr)
|
||||
{
|
||||
CORE_LOCK();
|
||||
RAnalFunction *fcn = r_anal_get_fcn_in(core_->anal, addr, 0);
|
||||
if (fcn)
|
||||
{
|
||||
QString tmp = this->cmd("afi @ " + QString::number(addr) + " ~end-bbs").split("\n")[0];
|
||||
if (tmp.contains(":"))
|
||||
{
|
||||
QString endbbs = tmp.split(": ")[1];
|
||||
return endbbs.toInt();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString CutterCore::itoa(ut64 num, int rdx)
|
||||
{
|
||||
return QString::number(num, rdx);
|
||||
|
@ -199,11 +199,7 @@ public:
|
||||
|
||||
/* Getters */
|
||||
RVA getOffset() const { return core_->offset; }
|
||||
int getCycloComplex(ut64 addr);
|
||||
int getFcnSize(ut64 addr);
|
||||
int fcnCyclomaticComplexity(ut64 addr);
|
||||
int fcnBasicBlockCount(ut64 addr);
|
||||
int fcnEndBbs(RVA addr);
|
||||
|
||||
static QString sanitizeStringForCommand(QString s);
|
||||
QString cmd(const QString &str);
|
||||
QString cmdRaw(const QString &str);
|
||||
@ -282,8 +278,7 @@ public:
|
||||
QString getFileInfo();
|
||||
QStringList getStats();
|
||||
QString getSimpleGraph(QString function);
|
||||
QString binStart;
|
||||
QString binEnd;
|
||||
|
||||
void getOpcodes();
|
||||
QList<QString> opcodes;
|
||||
QList<QString> regs;
|
||||
|
Loading…
Reference in New Issue
Block a user