Skip to content

Commit

Permalink
Format All Files
Browse files Browse the repository at this point in the history
  • Loading branch information
ElykDeer committed Jan 28, 2022
1 parent 519c9db commit 6812c97
Show file tree
Hide file tree
Showing 224 changed files with 17,548 additions and 14,653 deletions.
7 changes: 4 additions & 3 deletions activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ using namespace BinaryNinja;
using namespace std;


Activity::Activity(const string& name, const std::function<void(Ref<AnalysisContext> analysisContext)>& action): m_action(action)
Activity::Activity(const string& name, const std::function<void(Ref<AnalysisContext> analysisContext)>& action) :
m_action(action)
{
//LogError("API-Side Activity Constructed!");
// LogError("API-Side Activity Constructed!");
m_object = BNCreateActivity(name.c_str(), this, Run);
}

Expand All @@ -20,7 +21,7 @@ Activity::Activity(BNActivity* activity)

Activity::~Activity()
{
//LogError("API-Side Activity Destructed!");
// LogError("API-Side Activity Destructed!");
}


Expand Down
189 changes: 101 additions & 88 deletions architecture.cpp

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions basicblock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ void BasicBlock::SetAutoBasicBlockHighlight(BNHighlightStandardColor color, uint
}


void BasicBlock::SetAutoBasicBlockHighlight(BNHighlightStandardColor color, BNHighlightStandardColor mixColor,
uint8_t mix, uint8_t alpha)
void BasicBlock::SetAutoBasicBlockHighlight(
BNHighlightStandardColor color, BNHighlightStandardColor mixColor, uint8_t mix, uint8_t alpha)
{
BNHighlightColor hc;
hc.style = MixedHighlightColor;
Expand Down Expand Up @@ -406,8 +406,8 @@ void BasicBlock::SetUserBasicBlockHighlight(BNHighlightStandardColor color, uint
}


void BasicBlock::SetUserBasicBlockHighlight(BNHighlightStandardColor color, BNHighlightStandardColor mixColor,
uint8_t mix, uint8_t alpha)
void BasicBlock::SetUserBasicBlockHighlight(
BNHighlightStandardColor color, BNHighlightStandardColor mixColor, uint8_t mix, uint8_t alpha)
{
BNHighlightColor hc;
hc.style = MixedHighlightColor;
Expand Down
34 changes: 16 additions & 18 deletions binaryninjaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ string BinaryNinja::GetPathRelativeToUserDirectory(const string& rel)


bool BinaryNinja::ExecuteWorkerProcess(const string& path, const vector<string>& args, const DataBuffer& input,
string& output, string& errors, bool stdoutIsText, bool stderrIsText)
string& output, string& errors, bool stdoutIsText, bool stderrIsText)
{
const char** argArray = new const char*[args.size() + 1];
for (size_t i = 0; i < args.size(); i++)
Expand All @@ -182,8 +182,8 @@ bool BinaryNinja::ExecuteWorkerProcess(const string& path, const vector<string>&

char* outputStr;
char* errorStr;
bool result = BNExecuteWorkerProcess(path.c_str(), argArray, input.GetBufferObject(), &outputStr, &errorStr,
stdoutIsText, stderrIsText);
bool result = BNExecuteWorkerProcess(
path.c_str(), argArray, input.GetBufferObject(), &outputStr, &errorStr, stdoutIsText, stderrIsText);

output = outputStr;
errors = errorStr;
Expand Down Expand Up @@ -301,9 +301,7 @@ void BinaryNinja::WorkerEnqueue(RefCountObject* owner, const function<void()>& a
context.owner = owner;
context.func = action;

WorkerEnqueue([=]() {
context.func();
});
WorkerEnqueue([=]() { context.func(); });
}


Expand All @@ -325,9 +323,7 @@ void BinaryNinja::WorkerPriorityEnqueue(RefCountObject* owner, const function<vo
context.owner = owner;
context.func = action;

WorkerPriorityEnqueue([=]() {
context.func();
});
WorkerPriorityEnqueue([=]() { context.func(); });
}


Expand All @@ -349,9 +345,7 @@ void BinaryNinja::WorkerInteractiveEnqueue(RefCountObject* owner, const function
context.owner = owner;
context.func = action;

WorkerInteractiveEnqueue([=]() {
context.func();
});
WorkerInteractiveEnqueue([=]() { context.func(); });
}


Expand Down Expand Up @@ -389,23 +383,27 @@ map<string, uint64_t> BinaryNinja::GetMemoryUsageInfo()
}


std::function<bool(size_t, size_t)>
BinaryNinja::SplitProgress(std::function<bool(size_t, size_t)> originalFn, size_t subpart, size_t subpartCount)
std::function<bool(size_t, size_t)> BinaryNinja::SplitProgress(
std::function<bool(size_t, size_t)> originalFn, size_t subpart, size_t subpartCount)
{
return SplitProgress(originalFn, subpart, std::vector<double>(subpartCount, 1.0 / (double)subpartCount));
}


std::function<bool(size_t, size_t)>
BinaryNinja::SplitProgress(std::function<bool(size_t, size_t)> originalFn, size_t subpart, std::vector<double> subpartWeights)
std::function<bool(size_t, size_t)> BinaryNinja::SplitProgress(
std::function<bool(size_t, size_t)> originalFn, size_t subpart, std::vector<double> subpartWeights)
{
if (!originalFn)
return [](size_t, size_t){ return true; };
return [](size_t, size_t) {
return true;
};

// Normalize weights
double weightSum = std::accumulate(subpartWeights.begin(), subpartWeights.end(), 0.0);
if (weightSum < 0.0001f)
return [](size_t, size_t){ return true; };
return [](size_t, size_t) {
return true;
};
// Keep a running count of weights for the start
std::vector<double> subpartStarts;
double start = 0.0;
Expand Down
Loading

0 comments on commit 6812c97

Please sign in to comment.