Remove some unused members from CutterCore

This commit is contained in:
Florian Märkl 2017-12-21 00:22:59 +01:00
parent aad3797159
commit fa6902d41c
3 changed files with 2 additions and 84 deletions

View File

@ -372,10 +372,6 @@ void MainWindow::finalizeOpen()
"\n" + core->cmd("ie") + "\n" + core->cmd("iM") + "\n"); "\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 :)")); addOutput(tr(" > Finished, happy reversing :)"));
// Add fortune message // Add fortune message
addOutput("\n" + core->cmd("fo")); addOutput("\n" + core->cmd("fo"));

View File

@ -74,41 +74,6 @@ CutterCore *CutterCore::getInstance()
return uniqueInstance; 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) QList<QString> CutterCore::sdbList(QString path)
{ {
CORE_LOCK(); 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()); 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) QString CutterCore::itoa(ut64 num, int rdx)
{ {
return QString::number(num, rdx); return QString::number(num, rdx);

View File

@ -199,11 +199,7 @@ public:
/* Getters */ /* Getters */
RVA getOffset() const { return core_->offset; } 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); static QString sanitizeStringForCommand(QString s);
QString cmd(const QString &str); QString cmd(const QString &str);
QString cmdRaw(const QString &str); QString cmdRaw(const QString &str);
@ -282,8 +278,7 @@ public:
QString getFileInfo(); QString getFileInfo();
QStringList getStats(); QStringList getStats();
QString getSimpleGraph(QString function); QString getSimpleGraph(QString function);
QString binStart;
QString binEnd;
void getOpcodes(); void getOpcodes();
QList<QString> opcodes; QList<QString> opcodes;
QList<QString> regs; QList<QString> regs;