MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / Inspire

Function Inspire

examples/background_task/src/backgroundtask.cpp:50–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void Inspire(BinaryView *bv)
51{
52 inspireBackgroundTask = new BackgroundTask("Getting inspired!", true);
53 std::thread inspireThread([]() {
54 LogInfo("Getting inspired!");
55 BNDownloadInstanceOutputCallbacks outputCallbacks;
56 memset(&outputCallbacks, 0, sizeof(outputCallbacks));
57 outputCallbacks.writeCallback = InspireWriteCallback;
58 outputCallbacks.progressCallback = InspireProgressCallback;
59
60 auto downloadProvider = DownloadProvider::GetByName("CoreDownloadProvider");
61 auto downloadInstance = downloadProvider->CreateNewInstance();
62 inspireBackgroundTask->SetProgressText("Waiting for inspiration...");
63 if (downloadInstance->PerformRequest("https://type.fit/api/quotes", &outputCallbacks))
64 LogError("Inspiration failed!");
65
66 inspireBackgroundTask->Finish();
67 });
68 inspireThread.detach();
69}
70
71extern "C" {
72 BN_DECLARE_CORE_ABI_VERSION

Callers

nothing calls this directly

Calls 4

SetProgressTextMethod · 0.80
PerformRequestMethod · 0.80
FinishMethod · 0.80
CreateNewInstanceMethod · 0.45

Tested by

no test coverage detected