C++ Исходник Unhook ntdll for ud scyllahide bypass

Забаненный
Статус
Оффлайн
Регистрация
4 Апр 2023
Сообщения
107
Реакции[?]
8
Поинты[?]
6K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Я хотел использовать Scyllahide и CheckRemoteDebuggerPresent, и некоторые другие вещи теперь это сдесь.
Также это можно использовать, чтобы просто анхукнуть любую dll , которую вы хотите.

biba:
#include <iostream>
#include <Windows.h>
#include <winternl.h>
#include <psapi.h>
 
void unhookModule(const char* modulePath) {
    HANDLE process = GetCurrentProcess();
    MODULEINFO moduleInfo = {};
    HMODULE moduleHandle = GetModuleHandleA(modulePath);
 
    if (moduleHandle == NULL) {
        std::cerr << "Failed to get handle for module: " << modulePath << std::endl;
        return;
    }
 
    GetModuleInformation(process, moduleHandle, &moduleInfo, sizeof(moduleInfo));
    LPVOID moduleBase = moduleInfo.lpBaseOfDll;
 
    HANDLE moduleFile = CreateFileA(modulePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    if (moduleFile == INVALID_HANDLE_VALUE) {
        std::cerr << "Failed to open file for module: " << modulePath << std::endl;
        CloseHandle(process);
        return;
    }
 
    HANDLE moduleMapping = CreateFileMapping(moduleFile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL);
    if (moduleMapping == NULL) {
        std::cerr << "Failed to create file mapping for module: " << modulePath << std::endl;
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }
 
    LPVOID mappingAddress = MapViewOfFile(moduleMapping, FILE_MAP_READ, 0, 0, 0);
    if (mappingAddress == NULL) {
        std::cerr << "Failed to map view of file for module: " << modulePath << std::endl;
        CloseHandle(moduleMapping);
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }
 
    PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)moduleBase;
    PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)moduleBase + dosHeader->e_lfanew);
 
    for (WORD i = 0; i < ntHeader->FileHeader.NumberOfSections; i++) {
        PIMAGE_SECTION_HEADER sectionHeader = (PIMAGE_SECTION_HEADER)((DWORD_PTR)IMAGE_FIRST_SECTION(ntHeader) + ((DWORD_PTR)IMAGE_SIZEOF_SECTION_HEADER * i));
        
        if (!strcmp((char*)sectionHeader->Name, ".text")) {
            DWORD oldProtection = 0;
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, PAGE_EXECUTE_READWRITE, &oldProtection);
            memcpy((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), (LPVOID)((DWORD_PTR)mappingAddress + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize);
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, oldProtection, &oldProtection);
        }
    }
    
    CloseHandle(process);
    CloseHandle(moduleFile);
    CloseHandle(moduleMapping);
    FreeLibrary(moduleHandle);
}
 
int main() {
    const char* modulePath = "C:\\Windows\\System32\\ntdll.dll";
    unhookModule(modulePath);
    return 0;
}
 
Участник
Статус
Оффлайн
Регистрация
19 Апр 2020
Сообщения
1,165
Реакции[?]
313
Поинты[?]
151K
Последнее редактирование:
эксперт в майнкрафт апи
Read Only
Статус
Оффлайн
Регистрация
25 Янв 2023
Сообщения
684
Реакции[?]
286
Поинты[?]
21K
Я хотел использовать Scyllahide и CheckRemoteDebuggerPresent, и некоторые другие вещи теперь это сдесь.
Также это можно использовать, чтобы просто анхукнуть любую dll , которую вы хотите.

biba:
#include <iostream>
#include <Windows.h>
#include <winternl.h>
#include <psapi.h>

void unhookModule(const char* modulePath) {
    HANDLE process = GetCurrentProcess();
    MODULEINFO moduleInfo = {};
    HMODULE moduleHandle = GetModuleHandleA(modulePath);

    if (moduleHandle == NULL) {
        std::cerr << "Failed to get handle for module: " << modulePath << std::endl;
        return;
    }

    GetModuleInformation(process, moduleHandle, &moduleInfo, sizeof(moduleInfo));
    LPVOID moduleBase = moduleInfo.lpBaseOfDll;

    HANDLE moduleFile = CreateFileA(modulePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    if (moduleFile == INVALID_HANDLE_VALUE) {
        std::cerr << "Failed to open file for module: " << modulePath << std::endl;
        CloseHandle(process);
        return;
    }

    HANDLE moduleMapping = CreateFileMapping(moduleFile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL);
    if (moduleMapping == NULL) {
        std::cerr << "Failed to create file mapping for module: " << modulePath << std::endl;
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }

    LPVOID mappingAddress = MapViewOfFile(moduleMapping, FILE_MAP_READ, 0, 0, 0);
    if (mappingAddress == NULL) {
        std::cerr << "Failed to map view of file for module: " << modulePath << std::endl;
        CloseHandle(moduleMapping);
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }

    PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)moduleBase;
    PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)moduleBase + dosHeader->e_lfanew);

    for (WORD i = 0; i < ntHeader->FileHeader.NumberOfSections; i++) {
        PIMAGE_SECTION_HEADER sectionHeader = (PIMAGE_SECTION_HEADER)((DWORD_PTR)IMAGE_FIRST_SECTION(ntHeader) + ((DWORD_PTR)IMAGE_SIZEOF_SECTION_HEADER * i));
      
        if (!strcmp((char*)sectionHeader->Name, ".text")) {
            DWORD oldProtection = 0;
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, PAGE_EXECUTE_READWRITE, &oldProtection);
            memcpy((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), (LPVOID)((DWORD_PTR)mappingAddress + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize);
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, oldProtection, &oldProtection);
        }
    }
  
    CloseHandle(process);
    CloseHandle(moduleFile);
    CloseHandle(moduleMapping);
    FreeLibrary(moduleHandle);
}

int main() {
    const char* modulePath = "C:\\Windows\\System32\\ntdll.dll";
    unhookModule(modulePath);
    return 0;
}
круто бро выебал сциллу в жопу :imp:
 
Последнее редактирование:
ппоршень
Пользователь
Статус
Оффлайн
Регистрация
15 Фев 2020
Сообщения
285
Реакции[?]
47
Поинты[?]
32K
Я хотел использовать Scyllahide и CheckRemoteDebuggerPresent, и некоторые другие вещи теперь это сдесь.
Также это можно использовать, чтобы просто анхукнуть любую dll , которую вы хотите.

biba:
#include <iostream>
#include <Windows.h>
#include <winternl.h>
#include <psapi.h>

void unhookModule(const char* modulePath) {
    HANDLE process = GetCurrentProcess();
    MODULEINFO moduleInfo = {};
    HMODULE moduleHandle = GetModuleHandleA(modulePath);

    if (moduleHandle == NULL) {
        std::cerr << "Failed to get handle for module: " << modulePath << std::endl;
        return;
    }

    GetModuleInformation(process, moduleHandle, &moduleInfo, sizeof(moduleInfo));
    LPVOID moduleBase = moduleInfo.lpBaseOfDll;

    HANDLE moduleFile = CreateFileA(modulePath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
    if (moduleFile == INVALID_HANDLE_VALUE) {
        std::cerr << "Failed to open file for module: " << modulePath << std::endl;
        CloseHandle(process);
        return;
    }

    HANDLE moduleMapping = CreateFileMapping(moduleFile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, NULL);
    if (moduleMapping == NULL) {
        std::cerr << "Failed to create file mapping for module: " << modulePath << std::endl;
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }

    LPVOID mappingAddress = MapViewOfFile(moduleMapping, FILE_MAP_READ, 0, 0, 0);
    if (mappingAddress == NULL) {
        std::cerr << "Failed to map view of file for module: " << modulePath << std::endl;
        CloseHandle(moduleMapping);
        CloseHandle(moduleFile);
        CloseHandle(process);
        return;
    }

    PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)moduleBase;
    PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)((DWORD_PTR)moduleBase + dosHeader->e_lfanew);

    for (WORD i = 0; i < ntHeader->FileHeader.NumberOfSections; i++) {
        PIMAGE_SECTION_HEADER sectionHeader = (PIMAGE_SECTION_HEADER)((DWORD_PTR)IMAGE_FIRST_SECTION(ntHeader) + ((DWORD_PTR)IMAGE_SIZEOF_SECTION_HEADER * i));
       
        if (!strcmp((char*)sectionHeader->Name, ".text")) {
            DWORD oldProtection = 0;
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, PAGE_EXECUTE_READWRITE, &oldProtection);
            memcpy((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), (LPVOID)((DWORD_PTR)mappingAddress + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize);
            VirtualProtect((LPVOID)((DWORD_PTR)moduleBase + (DWORD_PTR)sectionHeader->VirtualAddress), sectionHeader->Misc.VirtualSize, oldProtection, &oldProtection);
        }
    }
   
    CloseHandle(process);
    CloseHandle(moduleFile);
    CloseHandle(moduleMapping);
    FreeLibrary(moduleHandle);
}

int main() {
    const char* modulePath = "C:\\Windows\\System32\\ntdll.dll";
    unhookModule(modulePath);
    return 0;
}
ну пиздец
 
profitprogrammer
Участник
Статус
Оффлайн
Регистрация
13 Дек 2020
Сообщения
883
Реакции[?]
179
Поинты[?]
59K
Дружище, если ты думаешь что пиздя темы ты будешь супер крутым, то ты ошибаешься
 
Сверху Снизу