Files
VaiTon 5aafd7a4f3 Create a custom fake simple plugin for testing (#60)
Using a real plugin means:
1. we need to be online during testing
2. if the plugin has a different version from rizin
   on the machine often it won't event compile

This commit introduces a fake plugin in the
simpleplugin directory. During testing, an HTTP
server is spawned. The .tar.gz is created and
served on-the-fly to every test that asks for it.
2025-06-14 16:50:19 +08:00

45 lines
1.1 KiB
C

// SPDX-FileCopyrightText: 2018-2023 Giovanni Dante Grazioli <[email protected]>
// SPDX-FileCopyrightText: 2025 Eyad Issa <[email protected]>
// SPDX-License-Identifier: LGPL-3.0-or-later
#include <rz_analysis.h>
#include <rz_cmd.h>
#include <rz_cons.h>
#include <rz_core.h>
#include <rz_lib.h>
#include <rz_types.h>
static bool rz_cmd_init(RzCore *core) {
// no-op plugin, does nothing
RZ_LOG_INFO("Initializing simple plugin\n");
return true;
}
static bool rz_cmd_fini(RzCore *core) {
// no-op plugin, does nothing
RZ_LOG_INFO("Finalizing simple plugin\n");
return true;
}
RzCorePlugin rz_core_plugin_example = {
.name = "simple-plugin",
.desc = "A simple no-op plugin for Rizin",
.license = "BSD-3-Clause",
.init = rz_cmd_init,
.fini = rz_cmd_fini,
};
#ifdef _MSC_VER
#define _RZ_API __declspec(dllexport)
#else
#define _RZ_API __attribute__((visibility("default")))
#endif
#ifndef CORELIB
_RZ_API RzLibStruct rizin_plugin = {
.type = RZ_LIB_TYPE_CORE,
.data = &rz_core_plugin_example,
.version = RZ_VERSION,
};
#endif