Вопрос Почему крашит Loader cs2

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
14 Май 2025
Сообщения
445
Реакции
4
я вожу логин и пароль и дальша краш и все

Вот код кому не сложно почините код и пофиксите



я убрал сылку для скачавания не крякнуль:
Expand Collapse Copy
#include <windows.h>
#include <wininet.h>
#include <string>
#include <iostream>
#include <thread>
#include <atomic>
#include <fstream>
#include <vector>
#include <tlhelp32.h>
#include <random>

#pragma comment(lib, "wininet.lib")

// Генерация случайной строки
std::string GenerateRandomString(size_t length) {
    static const char charset[] =
        "abcdefghijklmnopqrstuvwxyz"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "0123456789";
    static std::mt19937 rng(static_cast<unsigned int>(GetTickCount64()));
    static std::uniform_int_distribution<> dist(0, sizeof(charset) - 2);

    std::string result;
    result.reserve(length);
    for (size_t i = 0; i < length; i++) {
        result += charset[dist(rng)];
    }
    return result;
}

// Получить путь временного файла DLL
std::string GetTempFilePath() {
    char tempPath[MAX_PATH] = {0};
    if (!GetTempPathA(MAX_PATH, tempPath)) return "";

    std::string folder = std::string(tempPath) + GenerateRandomString(8);
    if (!CreateDirectoryA(folder.c_str(), NULL) && GetLastError() != ERROR_ALREADY_EXISTS) {
        return "";
    }

    return folder + "\\" + GenerateRandomString(8) + ".dll";
}

// HTTP POST с JSON
bool HttpPostJson(const std::string& url, const std::string& jsonData, std::string& response) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    URL_COMPONENTSA components = { sizeof(components) };
    char host[256] = {0};
    char path[512] = {0};
    components.lpszHostName = host;
    components.dwHostNameLength = sizeof(host);
    components.lpszUrlPath = path;
    components.dwUrlPathLength = sizeof(path);

    if (!InternetCrackUrlA(url.c_str(), 0, 0, &components)) {
        InternetCloseHandle(hInternet);
        return false;
    }

    HINTERNET hConnect = InternetConnectA(hInternet, host, components.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
    if (!hConnect) {
        InternetCloseHandle(hInternet);
        return false;
    }

    const char* acceptTypes[] = { "application/json", NULL };
    DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD;
    if (components.nScheme == INTERNET_SCHEME_HTTPS) {
        flags |= INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID;
    }

    HINTERNET hRequest = HttpOpenRequestA(hConnect, "POST", path, NULL, NULL, acceptTypes, flags, 0);
    if (!hRequest) {
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    std::string headers = "Content-Type: application/json\r\nAccept: application/json\r\n";

    BOOL sent = HttpSendRequestA(hRequest, headers.c_str(), (DWORD)headers.size(),
                                (LPVOID)jsonData.c_str(), (DWORD)jsonData.size());

    if (!sent) {
        InternetCloseHandle(hRequest);
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    char buffer[4096];
    DWORD bytesRead = 0;
    response.clear();

    while (InternetReadFile(hRequest, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        response.append(buffer, bytesRead);
    }

    InternetCloseHandle(hRequest);
    InternetCloseHandle(hConnect);
    InternetCloseHandle(hInternet);

    return true;
}

// Простая проверка наличия ключа true в JSON (упрощённо)
bool JsonBoolValue(const std::string& json, const std::string& key) {
    std::string patternTrue = "\"" + key + "\":true";
    std::string patternFalse = "\"" + key + "\":false";

    if (json.find(patternTrue) != std::string::npos) return true;
    if (json.find(patternFalse) != std::string::npos) return false;

    return false;
}

// Поиск PID процесса по имени
DWORD FindProcessId(const std::wstring& processName) {
    PROCESSENTRY32W entry;
    entry.dwSize = sizeof(PROCESSENTRY32W);

    HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    if (snapshot == INVALID_HANDLE_VALUE) return 0;

    if (!Process32FirstW(snapshot, &entry)) {
        CloseHandle(snapshot);
        return 0;
    }

    do {
        if (_wcsicmp(entry.szExeFile, processName.c_str()) == 0) {
            CloseHandle(snapshot);
            return entry.th32ProcessID;
        }
    } while (Process32NextW(snapshot, &entry));

    CloseHandle(snapshot);
    return 0;
}

// Инжекция DLL
bool InjectDll(DWORD pid, const std::string& dllPath) {
    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
    if (!hProcess) return false;

    void* remoteMem = VirtualAllocEx(hProcess, NULL, dllPath.size() + 1, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    if (!remoteMem) {
        CloseHandle(hProcess);
        return false;
    }

    if (!WriteProcessMemory(hProcess, remoteMem, dllPath.c_str(), dllPath.size() + 1, NULL)) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0,
                                        (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"),
                                        remoteMem, 0, NULL);

    if (!hThread) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    WaitForSingleObject(hThread, INFINITE);

    VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
    CloseHandle(hThread);
    CloseHandle(hProcess);

    return true;
}

// Скачивание DLL из URL
bool DownloadDll(const std::string& url, const std::string& savePath) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    HINTERNET hFile = InternetOpenUrlA(hInternet, url.c_str(), NULL, 0, INTERNET_FLAG_RELOAD, 0);
    if (!hFile) {
        InternetCloseHandle(hInternet);
        return false;
    }

    std::vector<char> data;
    char buffer[4096];
    DWORD bytesRead = 0;

    while (InternetReadFile(hFile, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        data.insert(data.end(), buffer, buffer + bytesRead);
    }

    InternetCloseHandle(hFile);
    InternetCloseHandle(hInternet);

    std::ofstream outFile(savePath, std::ios::binary);
    if (!outFile) return false;

    outFile.write(data.data(), data.size());
    return true;
}

// Анимация загрузки
void ShowLoading(const std::string& msg, std::atomic<bool>& running) {
    const char spinner[] = {'|', '/', '-', '\\'};
    size_t idx = 0;
    while (running) {
        std::cout << "\r" << msg << " " << spinner[idx++ % 4] << std::flush;
        std::this_thread::sleep_for(std::chrono::milliseconds(150));
    }
    std::cout << "\r" << std::string(msg.size() + 2, ' ') << "\r";
}

int main() {
    std::string username, password;

    std::cout << "Enter username: ";
    std::getline(std::cin, username);
    std::cout << "Enter password: ";
    std::getline(std::cin, password);

    if (username.empty() || password.empty()) {
        std::cerr << "Username or password cannot be empty.\n";
        return 1;
    }

    const std::string apiUrl = "https://shadowpulse.wuaze.com/check_login.php?api=login";
    std::string jsonPayload = "{\"username\":\"" + username + "\",\"password\":\"" + password + "\"}";

    std::string response;
    std::atomic<bool> loading(true);
    std::thread loaderThread(ShowLoading, "Checking credentials...", std::ref(loading));

    bool success = HttpPostJson(apiUrl, jsonPayload, response);

    loading = false;
    loaderThread.join();

    if (!success) {
        std::cerr << "Failed to connect to server.\n";
        return 1;
    }

    if (!JsonBoolValue(response, "success")) {
        std::cerr << "Login failed or subscription invalid.\n";
        return 1;
    }

    std::cout << "Login successful! Downloading DLL...\n";

    std::string dllUrl = "https://shadowpulse.wuaze.com/xyikrenrdsfsdkfksdksdkfsdfksdfk.dll"; // Поставь актуальный URL
    std::string dllPath = GetTempFilePath();
    if (dllPath.empty()) {
        std::cerr << "Failed to create temp file path.\n";
        return 1;
    }

    loading = true;
    std::thread downloadThread(ShowLoading, "Downloading DLL...", std::ref(loading));

    if (!DownloadDll(dllUrl, dllPath)) {
        loading = false;
        downloadThread.join();
        std::cerr << "Failed to download DLL.\n";
        return 1;
    }

    loading = false;
    downloadThread.join();

    std::cout << "DLL saved to: " << dllPath << "\n";

    DWORD pid = FindProcessId(L"cs2.exe");
    if (!pid) {
        std::cerr << "Process cs2.exe not found.\n";
        return 1;
    }

    std::cout << "Injecting DLL into cs2.exe (PID " << pid << ")...\n";

    if (!InjectDll(pid, dllPath)) {
        std::cerr << "DLL injection failed.\n";
        return 1;
    }

    std::cout << "DLL injected successfully!\n";

    // Удалить DLL если нужно:
    // DeleteFileA(dllPath.c_str());

    return 0;
}
скажете почему не рабоет или скините фулл код фикса
 
Возвращайся в кубы обратно. ты плюсы не осилил
 
1749432097790.png

понял не?
 
нажать кнопку запустить с отладчиком ведь так сложно
 
я вожу логин и пароль и дальша краш и все

Вот код кому не сложно почините код и пофиксите



я убрал сылку для скачавания не крякнуль:
Expand Collapse Copy
#include <windows.h>
#include <wininet.h>
#include <string>
#include <iostream>
#include <thread>
#include <atomic>
#include <fstream>
#include <vector>
#include <tlhelp32.h>
#include <random>

#pragma comment(lib, "wininet.lib")

// Генерация случайной строки
std::string GenerateRandomString(size_t length) {
    static const char charset[] =
        "abcdefghijklmnopqrstuvwxyz"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "0123456789";
    static std::mt19937 rng(static_cast<unsigned int>(GetTickCount64()));
    static std::uniform_int_distribution<> dist(0, sizeof(charset) - 2);

    std::string result;
    result.reserve(length);
    for (size_t i = 0; i < length; i++) {
        result += charset[dist(rng)];
    }
    return result;
}

// Получить путь временного файла DLL
std::string GetTempFilePath() {
    char tempPath[MAX_PATH] = {0};
    if (!GetTempPathA(MAX_PATH, tempPath)) return "";

    std::string folder = std::string(tempPath) + GenerateRandomString(8);
    if (!CreateDirectoryA(folder.c_str(), NULL) && GetLastError() != ERROR_ALREADY_EXISTS) {
        return "";
    }

    return folder + "\\" + GenerateRandomString(8) + ".dll";
}

// HTTP POST с JSON
bool HttpPostJson(const std::string& url, const std::string& jsonData, std::string& response) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    URL_COMPONENTSA components = { sizeof(components) };
    char host[256] = {0};
    char path[512] = {0};
    components.lpszHostName = host;
    components.dwHostNameLength = sizeof(host);
    components.lpszUrlPath = path;
    components.dwUrlPathLength = sizeof(path);

    if (!InternetCrackUrlA(url.c_str(), 0, 0, &components)) {
        InternetCloseHandle(hInternet);
        return false;
    }

    HINTERNET hConnect = InternetConnectA(hInternet, host, components.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
    if (!hConnect) {
        InternetCloseHandle(hInternet);
        return false;
    }

    const char* acceptTypes[] = { "application/json", NULL };
    DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD;
    if (components.nScheme == INTERNET_SCHEME_HTTPS) {
        flags |= INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID;
    }

    HINTERNET hRequest = HttpOpenRequestA(hConnect, "POST", path, NULL, NULL, acceptTypes, flags, 0);
    if (!hRequest) {
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    std::string headers = "Content-Type: application/json\r\nAccept: application/json\r\n";

    BOOL sent = HttpSendRequestA(hRequest, headers.c_str(), (DWORD)headers.size(),
                                (LPVOID)jsonData.c_str(), (DWORD)jsonData.size());

    if (!sent) {
        InternetCloseHandle(hRequest);
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    char buffer[4096];
    DWORD bytesRead = 0;
    response.clear();

    while (InternetReadFile(hRequest, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        response.append(buffer, bytesRead);
    }

    InternetCloseHandle(hRequest);
    InternetCloseHandle(hConnect);
    InternetCloseHandle(hInternet);

    return true;
}

// Простая проверка наличия ключа true в JSON (упрощённо)
bool JsonBoolValue(const std::string& json, const std::string& key) {
    std::string patternTrue = "\"" + key + "\":true";
    std::string patternFalse = "\"" + key + "\":false";

    if (json.find(patternTrue) != std::string::npos) return true;
    if (json.find(patternFalse) != std::string::npos) return false;

    return false;
}

// Поиск PID процесса по имени
DWORD FindProcessId(const std::wstring& processName) {
    PROCESSENTRY32W entry;
    entry.dwSize = sizeof(PROCESSENTRY32W);

    HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    if (snapshot == INVALID_HANDLE_VALUE) return 0;

    if (!Process32FirstW(snapshot, &entry)) {
        CloseHandle(snapshot);
        return 0;
    }

    do {
        if (_wcsicmp(entry.szExeFile, processName.c_str()) == 0) {
            CloseHandle(snapshot);
            return entry.th32ProcessID;
        }
    } while (Process32NextW(snapshot, &entry));

    CloseHandle(snapshot);
    return 0;
}

// Инжекция DLL
bool InjectDll(DWORD pid, const std::string& dllPath) {
    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
    if (!hProcess) return false;

    void* remoteMem = VirtualAllocEx(hProcess, NULL, dllPath.size() + 1, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    if (!remoteMem) {
        CloseHandle(hProcess);
        return false;
    }

    if (!WriteProcessMemory(hProcess, remoteMem, dllPath.c_str(), dllPath.size() + 1, NULL)) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0,
                                        (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"),
                                        remoteMem, 0, NULL);

    if (!hThread) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    WaitForSingleObject(hThread, INFINITE);

    VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
    CloseHandle(hThread);
    CloseHandle(hProcess);

    return true;
}

// Скачивание DLL из URL
bool DownloadDll(const std::string& url, const std::string& savePath) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    HINTERNET hFile = InternetOpenUrlA(hInternet, url.c_str(), NULL, 0, INTERNET_FLAG_RELOAD, 0);
    if (!hFile) {
        InternetCloseHandle(hInternet);
        return false;
    }

    std::vector<char> data;
    char buffer[4096];
    DWORD bytesRead = 0;

    while (InternetReadFile(hFile, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        data.insert(data.end(), buffer, buffer + bytesRead);
    }

    InternetCloseHandle(hFile);
    InternetCloseHandle(hInternet);

    std::ofstream outFile(savePath, std::ios::binary);
    if (!outFile) return false;

    outFile.write(data.data(), data.size());
    return true;
}

// Анимация загрузки
void ShowLoading(const std::string& msg, std::atomic<bool>& running) {
    const char spinner[] = {'|', '/', '-', '\\'};
    size_t idx = 0;
    while (running) {
        std::cout << "\r" << msg << " " << spinner[idx++ % 4] << std::flush;
        std::this_thread::sleep_for(std::chrono::milliseconds(150));
    }
    std::cout << "\r" << std::string(msg.size() + 2, ' ') << "\r";
}

int main() {
    std::string username, password;

    std::cout << "Enter username: ";
    std::getline(std::cin, username);
    std::cout << "Enter password: ";
    std::getline(std::cin, password);

    if (username.empty() || password.empty()) {
        std::cerr << "Username or password cannot be empty.\n";
        return 1;
    }

    const std::string apiUrl = "https://shadowpulse.wuaze.com/check_login.php?api=login";
    std::string jsonPayload = "{\"username\":\"" + username + "\",\"password\":\"" + password + "\"}";

    std::string response;
    std::atomic<bool> loading(true);
    std::thread loaderThread(ShowLoading, "Checking credentials...", std::ref(loading));

    bool success = HttpPostJson(apiUrl, jsonPayload, response);

    loading = false;
    loaderThread.join();

    if (!success) {
        std::cerr << "Failed to connect to server.\n";
        return 1;
    }

    if (!JsonBoolValue(response, "success")) {
        std::cerr << "Login failed or subscription invalid.\n";
        return 1;
    }

    std::cout << "Login successful! Downloading DLL...\n";

    std::string dllUrl = "https://shadowpulse.wuaze.com/xyikrenrdsfsdkfksdksdkfsdfksdfk.dll"; // Поставь актуальный URL
    std::string dllPath = GetTempFilePath();
    if (dllPath.empty()) {
        std::cerr << "Failed to create temp file path.\n";
        return 1;
    }

    loading = true;
    std::thread downloadThread(ShowLoading, "Downloading DLL...", std::ref(loading));

    if (!DownloadDll(dllUrl, dllPath)) {
        loading = false;
        downloadThread.join();
        std::cerr << "Failed to download DLL.\n";
        return 1;
    }

    loading = false;
    downloadThread.join();

    std::cout << "DLL saved to: " << dllPath << "\n";

    DWORD pid = FindProcessId(L"cs2.exe");
    if (!pid) {
        std::cerr << "Process cs2.exe not found.\n";
        return 1;
    }

    std::cout << "Injecting DLL into cs2.exe (PID " << pid << ")...\n";

    if (!InjectDll(pid, dllPath)) {
        std::cerr << "DLL injection failed.\n";
        return 1;
    }

    std::cout << "DLL injected successfully!\n";

    // Удалить DLL если нужно:
    // DeleteFileA(dllPath.c_str());

    return 0;
}
скажете почему не рабоет или скините фулл код фикса
код чата гпт будет работать по твоему?
да ты фто)
 
 
я вожу логин и пароль и дальша краш и все

Вот код кому не сложно почините код и пофиксите



я убрал сылку для скачавания не крякнуль:
Expand Collapse Copy
#include <windows.h>
#include <wininet.h>
#include <string>
#include <iostream>
#include <thread>
#include <atomic>
#include <fstream>
#include <vector>
#include <tlhelp32.h>
#include <random>

#pragma comment(lib, "wininet.lib")

// Генерация случайной строки
std::string GenerateRandomString(size_t length) {
    static const char charset[] =
        "abcdefghijklmnopqrstuvwxyz"
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        "0123456789";
    static std::mt19937 rng(static_cast<unsigned int>(GetTickCount64()));
    static std::uniform_int_distribution<> dist(0, sizeof(charset) - 2);

    std::string result;
    result.reserve(length);
    for (size_t i = 0; i < length; i++) {
        result += charset[dist(rng)];
    }
    return result;
}

// Получить путь временного файла DLL
std::string GetTempFilePath() {
    char tempPath[MAX_PATH] = {0};
    if (!GetTempPathA(MAX_PATH, tempPath)) return "";

    std::string folder = std::string(tempPath) + GenerateRandomString(8);
    if (!CreateDirectoryA(folder.c_str(), NULL) && GetLastError() != ERROR_ALREADY_EXISTS) {
        return "";
    }

    return folder + "\\" + GenerateRandomString(8) + ".dll";
}

// HTTP POST с JSON
bool HttpPostJson(const std::string& url, const std::string& jsonData, std::string& response) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    URL_COMPONENTSA components = { sizeof(components) };
    char host[256] = {0};
    char path[512] = {0};
    components.lpszHostName = host;
    components.dwHostNameLength = sizeof(host);
    components.lpszUrlPath = path;
    components.dwUrlPathLength = sizeof(path);

    if (!InternetCrackUrlA(url.c_str(), 0, 0, &components)) {
        InternetCloseHandle(hInternet);
        return false;
    }

    HINTERNET hConnect = InternetConnectA(hInternet, host, components.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
    if (!hConnect) {
        InternetCloseHandle(hInternet);
        return false;
    }

    const char* acceptTypes[] = { "application/json", NULL };
    DWORD flags = INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD;
    if (components.nScheme == INTERNET_SCHEME_HTTPS) {
        flags |= INTERNET_FLAG_SECURE | INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID;
    }

    HINTERNET hRequest = HttpOpenRequestA(hConnect, "POST", path, NULL, NULL, acceptTypes, flags, 0);
    if (!hRequest) {
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    std::string headers = "Content-Type: application/json\r\nAccept: application/json\r\n";

    BOOL sent = HttpSendRequestA(hRequest, headers.c_str(), (DWORD)headers.size(),
                                (LPVOID)jsonData.c_str(), (DWORD)jsonData.size());

    if (!sent) {
        InternetCloseHandle(hRequest);
        InternetCloseHandle(hConnect);
        InternetCloseHandle(hInternet);
        return false;
    }

    char buffer[4096];
    DWORD bytesRead = 0;
    response.clear();

    while (InternetReadFile(hRequest, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        response.append(buffer, bytesRead);
    }

    InternetCloseHandle(hRequest);
    InternetCloseHandle(hConnect);
    InternetCloseHandle(hInternet);

    return true;
}

// Простая проверка наличия ключа true в JSON (упрощённо)
bool JsonBoolValue(const std::string& json, const std::string& key) {
    std::string patternTrue = "\"" + key + "\":true";
    std::string patternFalse = "\"" + key + "\":false";

    if (json.find(patternTrue) != std::string::npos) return true;
    if (json.find(patternFalse) != std::string::npos) return false;

    return false;
}

// Поиск PID процесса по имени
DWORD FindProcessId(const std::wstring& processName) {
    PROCESSENTRY32W entry;
    entry.dwSize = sizeof(PROCESSENTRY32W);

    HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    if (snapshot == INVALID_HANDLE_VALUE) return 0;

    if (!Process32FirstW(snapshot, &entry)) {
        CloseHandle(snapshot);
        return 0;
    }

    do {
        if (_wcsicmp(entry.szExeFile, processName.c_str()) == 0) {
            CloseHandle(snapshot);
            return entry.th32ProcessID;
        }
    } while (Process32NextW(snapshot, &entry));

    CloseHandle(snapshot);
    return 0;
}

// Инжекция DLL
bool InjectDll(DWORD pid, const std::string& dllPath) {
    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
    if (!hProcess) return false;

    void* remoteMem = VirtualAllocEx(hProcess, NULL, dllPath.size() + 1, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
    if (!remoteMem) {
        CloseHandle(hProcess);
        return false;
    }

    if (!WriteProcessMemory(hProcess, remoteMem, dllPath.c_str(), dllPath.size() + 1, NULL)) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    HANDLE hThread = CreateRemoteThread(hProcess, NULL, 0,
                                        (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA"),
                                        remoteMem, 0, NULL);

    if (!hThread) {
        VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
        CloseHandle(hProcess);
        return false;
    }

    WaitForSingleObject(hThread, INFINITE);

    VirtualFreeEx(hProcess, remoteMem, 0, MEM_RELEASE);
    CloseHandle(hThread);
    CloseHandle(hProcess);

    return true;
}

// Скачивание DLL из URL
bool DownloadDll(const std::string& url, const std::string& savePath) {
    HINTERNET hInternet = InternetOpenA("LoaderConsole", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
    if (!hInternet) return false;

    HINTERNET hFile = InternetOpenUrlA(hInternet, url.c_str(), NULL, 0, INTERNET_FLAG_RELOAD, 0);
    if (!hFile) {
        InternetCloseHandle(hInternet);
        return false;
    }

    std::vector<char> data;
    char buffer[4096];
    DWORD bytesRead = 0;

    while (InternetReadFile(hFile, buffer, sizeof(buffer), &bytesRead) && bytesRead > 0) {
        data.insert(data.end(), buffer, buffer + bytesRead);
    }

    InternetCloseHandle(hFile);
    InternetCloseHandle(hInternet);

    std::ofstream outFile(savePath, std::ios::binary);
    if (!outFile) return false;

    outFile.write(data.data(), data.size());
    return true;
}

// Анимация загрузки
void ShowLoading(const std::string& msg, std::atomic<bool>& running) {
    const char spinner[] = {'|', '/', '-', '\\'};
    size_t idx = 0;
    while (running) {
        std::cout << "\r" << msg << " " << spinner[idx++ % 4] << std::flush;
        std::this_thread::sleep_for(std::chrono::milliseconds(150));
    }
    std::cout << "\r" << std::string(msg.size() + 2, ' ') << "\r";
}

int main() {
    std::string username, password;

    std::cout << "Enter username: ";
    std::getline(std::cin, username);
    std::cout << "Enter password: ";
    std::getline(std::cin, password);

    if (username.empty() || password.empty()) {
        std::cerr << "Username or password cannot be empty.\n";
        return 1;
    }

    const std::string apiUrl = "https://shadowpulse.wuaze.com/check_login.php?api=login";
    std::string jsonPayload = "{\"username\":\"" + username + "\",\"password\":\"" + password + "\"}";

    std::string response;
    std::atomic<bool> loading(true);
    std::thread loaderThread(ShowLoading, "Checking credentials...", std::ref(loading));

    bool success = HttpPostJson(apiUrl, jsonPayload, response);

    loading = false;
    loaderThread.join();

    if (!success) {
        std::cerr << "Failed to connect to server.\n";
        return 1;
    }

    if (!JsonBoolValue(response, "success")) {
        std::cerr << "Login failed or subscription invalid.\n";
        return 1;
    }

    std::cout << "Login successful! Downloading DLL...\n";

    std::string dllUrl = "https://shadowpulse.wuaze.com/xyikrenrdsfsdkfksdksdkfsdfksdfk.dll"; // Поставь актуальный URL
    std::string dllPath = GetTempFilePath();
    if (dllPath.empty()) {
        std::cerr << "Failed to create temp file path.\n";
        return 1;
    }

    loading = true;
    std::thread downloadThread(ShowLoading, "Downloading DLL...", std::ref(loading));

    if (!DownloadDll(dllUrl, dllPath)) {
        loading = false;
        downloadThread.join();
        std::cerr << "Failed to download DLL.\n";
        return 1;
    }

    loading = false;
    downloadThread.join();

    std::cout << "DLL saved to: " << dllPath << "\n";

    DWORD pid = FindProcessId(L"cs2.exe");
    if (!pid) {
        std::cerr << "Process cs2.exe not found.\n";
        return 1;
    }

    std::cout << "Injecting DLL into cs2.exe (PID " << pid << ")...\n";

    if (!InjectDll(pid, dllPath)) {
        std::cerr << "DLL injection failed.\n";
        return 1;
    }

    std::cout << "DLL injected successfully!\n";

    // Удалить DLL если нужно:
    // DeleteFileA(dllPath.c_str());

    return 0;
}
скажете почему не рабоет или скините фулл код фикса
Я ебу почему твоя хуйня не работает, может ты ебанат засунул в ссылку инвалид адрес?
xd не ник просто такой я вы майнкрафт кодил 1 год назад
Я, вы, мы. Кто ты нахуй
 
Работает, если тот кто использует нейронку понимает что он делает. А не бездумно копирует код в надежде что тот заработает. Нейронка оптимизирует большое количество задачь
 
Назад
Сверху Снизу