我正在尝试将C ++ .dll注入到进程中,因此我可以从Apache服务器检索信息以在进程内使用它。 问题是当我调用curl_easy_init()时,.dll无法注入。 这是我的代码:
#include "includes.h"
extern HollowAim* hollow;
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
void offsets::curlServer() {
CURL* curl;
CURLcode res;
char* readBuffer = NULL;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://carinae-studios.cf/csgo/cpp/offsets.php");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
//curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
res = curl_easy_perform(curl);
if (res != CURLE_OK) {
hollow->settings.showOffWarn = true;
hollow->settings.showOffWarnText = curl_easy_strerror(res);
}
else
{
hollow->settings.showOffWarn = false;
offsets::setOffsets(readBuffer);
}
curl_easy_cleanup(curl);
}
void offsets::setOffsets(char* res) {
hollow->settings.showOffWarn = true;
hollow->settings.showOffWarnText = res;
}
我不知道是什么原因造成的。我非常确定它是curl_easy_init(),因为如果我注释从curl = curl_easy ...到curlServer函数末尾的所有内容,.dll都会成功注入。进样器没有调试消息。