Created
July 11, 2023 22:34
-
-
Save Podginator/8bb19abf009673abc8eb1cf9f19afe05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef void WebResponseInflater; | |
typedef void WebRequester; | |
static void (*makeQRequest_orig)(WebRequester*, QUrl const&, QString const&, QMap<QString, QString> const&, QByteArray const&, WebResponseInflater*, int, int, QNetworkRequest::CacheLoadControl); | |
extern "C" __attribute__((visibility("default"))) void _intercept_network(WebRequester *_this, QUrl const& url, QString const& param, QMap<QString, QString> const& headers, QByteArray const& output, WebResponseInflater* inflater, int param1, int param2, QNetworkRequest::CacheLoadControl cl) { | |
nh_log("... calling original implementation"); | |
makeQRequest_orig(_this, url, param, headers, output, inflater, param1, param2, cl); | |
} | |
static struct nh_info PocketInterceptor = (struct nh_info){ | |
.name = "PocketInterceptor", | |
.desc = "Intercepts Pocket Calls and redirects tehm to Omnivore", | |
.uninstall_flag = "/mnt/onboard/ns_uninstall", | |
}; | |
static struct nh_hook PocketIntereceptorHook[] = { | |
{.sym = "_ZN12WebRequester11makeRequestERK4QUrlRK7QStringRK4QMapIS3_S3_ERK10QByteArrayP19WebResponseInflateriiN15QNetworkRequest16CacheLoadControlE", .sym_new = "_intercept_network", .lib = "libnickel.so.1.0.0", .out = nh_symoutptr(makeQRequest_orig), .desc = "calls to metadata", .optional=true}, | |
{0}, | |
}; | |
NickelHook( | |
.init = nullptr, | |
.info = &PocketInterceptor, | |
.hook = PocketIntereceptorHook, | |
.dlsym = nullptr | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment