Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Вопрос Помогите с кодом я не много не понимаю

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
5 Ноя 2025
Сообщения
13
Реакции
0
Код:
Expand Collapse Copy
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import os
import time
import ctypes
import threading

def run_as_admin():
    try:
        if ctypes.windll.shell32.IsUserAnAdmin():
            return True
        script = os.path.abspath(sys.argv[0])
        ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, f'"{script}"', None, 1)
        return False
    except:
        return False

def main():
    import pymem
    import pymem.process
    import keyboard

    print("   INSERT  - Включить авто-армлет")

    try:
        pm = pymem.Pymem("dota2.exe")
    except:
        return

    client_module = pymem.process.module_from_name(pm.process_handle, "client.dll")
    if not client_module:
        print("client.dll не найден")
        return
    client_base = client_module.lpBaseOfDll
    static_offset = 0x06551150
    read_offsets = [0x8, 0x298, 0x58, 0x230, 0x8, 0x28]
    final_offset = 0x40
    MIN_HEALTH = 500
    CHECK_INTERVAL = 0.3
    COOLDOWN_BETWEEN_PRESSES = 0.8

    enabled = False
    lock = threading.Lock()

    def toggle_autoclick():
        nonlocal enabled
        with lock:
            enabled = not enabled
            status = "ВКЛЮЧЕН" if enabled else "ВЫКЛЮЧЕН"
            print(f"армлет {status}")

    keyboard.add_hotkey('insert', toggle_autoclick)


    last_press = 0

    try:
        while True:
            if not enabled:
                time.sleep(0.2)
                continue

            try:
                ptr = pm.read_longlong(client_base + static_offset)
                if ptr == 0:
                    raise Exception("0")

                for off in read_offsets:
                    ptr = pm.read_longlong(ptr + off)
                    if ptr == 0:
                        raise Exception(f"{hex(off)}")

                health = pm.read_int(ptr + final_offset)
                now = time.time()

                print(f"\r{health:>4}  [AUTO ARMLET: {'ON' if enabled else 'OFF'}]", end="")

                if health < MIN_HEALTH and (now - last_press) >= COOLDOWN_BETWEEN_PRESSES:
                    keyboard.press_and_release('n')
                    keyboard.press_and_release('n')
                    last_press = now

                time.sleep(CHECK_INTERVAL)

            except Exception as e:
                time.sleep(1)

    except KeyboardInterrupt:
        keyboard.unhook_all()
        pm.close_process()
        sys.exit(0)

if __name__ == "__main__":
    if not run_as_admin():
        sys.exit(0)

    try:
        import pymem, keyboard
    except ImportError:
        sys.exit(0)

    main()
я пробывал делать с оффсетами не получалось оно выдавало 1137 хп всегда вот код
Код:
Expand Collapse Copy
import pymem
import pymem.process

 
m_iHealth = 0x34C                            
dwEntityList = 0x6037970                    
dwGameEntitySystem = 0x66DE078               
dwGameEntitySystem_highestEntityIndex = 0x118  

def main():
    try:
        pm = pymem.Pymem("dota2.exe")
    except pymem.exception.ProcessNotFound:
        return


    client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll
    print(f"client.dll: {hex(client)}")
    game_entity_system = pm.read_longlong(client + dwGameEntitySystem)
    print(f"GameEntitySystem: {hex(game_entity_system)}")


    highest_idx = pm.read_int(game_entity_system + dwGameEntitySystem_highestEntityIndex)
    print(f"Наибольший индекс сущности: {highest_idx}")
    entity_list_base = pm.read_longlong(client + dwEntityList)
    print(f"Entity list base: {hex(entity_list_base)}")
    print("\n--- Сущности с HP > 0 ---")
    for i in range(highest_idx + 1):
        try:
            entity_ptr = pm.read_longlong(entity_list_base + i * 8)
            if entity_ptr == 0:
                continue
            health = pm.read_int(entity_ptr + m_iHealth)
            if health > 0:
                print(f"[{i}] Entity: {hex(entity_ptr)}  HP: {health}")
        except pymem.exception.MemoryReadError:
            pass

if __name__ == "__main__":
    main()
вот я сам доставал оффсеты и дампил и чужие брал все равно выдает кучу всего но не енити
 
Код:
Expand Collapse Copy
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import os
import time
import ctypes
import threading

def run_as_admin():
    try:
        if ctypes.windll.shell32.IsUserAnAdmin():
            return True
        script = os.path.abspath(sys.argv[0])
        ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, f'"{script}"', None, 1)
        return False
    except:
        return False

def main():
    import pymem
    import pymem.process
    import keyboard

    print("   INSERT  - Включить авто-армлет")

    try:
        pm = pymem.Pymem("dota2.exe")
    except:
        return

    client_module = pymem.process.module_from_name(pm.process_handle, "client.dll")
    if not client_module:
        print("client.dll не найден")
        return
    client_base = client_module.lpBaseOfDll
    static_offset = 0x06551150
    read_offsets = [0x8, 0x298, 0x58, 0x230, 0x8, 0x28]
    final_offset = 0x40
    MIN_HEALTH = 500
    CHECK_INTERVAL = 0.3
    COOLDOWN_BETWEEN_PRESSES = 0.8

    enabled = False
    lock = threading.Lock()

    def toggle_autoclick():
        nonlocal enabled
        with lock:
            enabled = not enabled
            status = "ВКЛЮЧЕН" if enabled else "ВЫКЛЮЧЕН"
            print(f"армлет {status}")

    keyboard.add_hotkey('insert', toggle_autoclick)


    last_press = 0

    try:
        while True:
            if not enabled:
                time.sleep(0.2)
                continue

            try:
                ptr = pm.read_longlong(client_base + static_offset)
                if ptr == 0:
                    raise Exception("0")

                for off in read_offsets:
                    ptr = pm.read_longlong(ptr + off)
                    if ptr == 0:
                        raise Exception(f"{hex(off)}")

                health = pm.read_int(ptr + final_offset)
                now = time.time()

                print(f"\r{health:>4}  [AUTO ARMLET: {'ON' if enabled else 'OFF'}]", end="")

                if health < MIN_HEALTH and (now - last_press) >= COOLDOWN_BETWEEN_PRESSES:
                    keyboard.press_and_release('n')
                    keyboard.press_and_release('n')
                    last_press = now

                time.sleep(CHECK_INTERVAL)

            except Exception as e:
                time.sleep(1)

    except KeyboardInterrupt:
        keyboard.unhook_all()
        pm.close_process()
        sys.exit(0)

if __name__ == "__main__":
    if not run_as_admin():
        sys.exit(0)

    try:
        import pymem, keyboard
    except ImportError:
        sys.exit(0)

    main()
я пробывал делать с оффсетами не получалось оно выдавало 1137 хп всегда вот код
Код:
Expand Collapse Copy
import pymem
import pymem.process

 
m_iHealth = 0x34C                           
dwEntityList = 0x6037970                   
dwGameEntitySystem = 0x66DE078              
dwGameEntitySystem_highestEntityIndex = 0x118 

def main():
    try:
        pm = pymem.Pymem("dota2.exe")
    except pymem.exception.ProcessNotFound:
        return


    client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll
    print(f"client.dll: {hex(client)}")
    game_entity_system = pm.read_longlong(client + dwGameEntitySystem)
    print(f"GameEntitySystem: {hex(game_entity_system)}")


    highest_idx = pm.read_int(game_entity_system + dwGameEntitySystem_highestEntityIndex)
    print(f"Наибольший индекс сущности: {highest_idx}")
    entity_list_base = pm.read_longlong(client + dwEntityList)
    print(f"Entity list base: {hex(entity_list_base)}")
    print("\n--- Сущности с HP > 0 ---")
    for i in range(highest_idx + 1):
        try:
            entity_ptr = pm.read_longlong(entity_list_base + i * 8)
            if entity_ptr == 0:
                continue
            health = pm.read_int(entity_ptr + m_iHealth)
            if health > 0:
                print(f"[{i}] Entity: {hex(entity_ptr)}  HP: {health}")
        except pymem.exception.MemoryReadError:
            pass

if __name__ == "__main__":
    main()
вот я сам доставал оффсеты и дампил и чужие брал все равно выдает кучу всего но не енити
entity_ptr = pm.read_longlong(entity_list_base + i * 8)

возьми адрес этого entity_ptr и кинь в ReClass и покажи что там лежит.
 
Код:
Expand Collapse Copy
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import os
import time
import ctypes
import threading

def run_as_admin():
    try:
        if ctypes.windll.shell32.IsUserAnAdmin():
            return True
        script = os.path.abspath(sys.argv[0])
        ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, f'"{script}"', None, 1)
        return False
    except:
        return False

def main():
    import pymem
    import pymem.process
    import keyboard

    print("   INSERT  - Включить авто-армлет")

    try:
        pm = pymem.Pymem("dota2.exe")
    except:
        return

    client_module = pymem.process.module_from_name(pm.process_handle, "client.dll")
    if not client_module:
        print("client.dll не найден")
        return
    client_base = client_module.lpBaseOfDll
    static_offset = 0x06551150
    read_offsets = [0x8, 0x298, 0x58, 0x230, 0x8, 0x28]
    final_offset = 0x40
    MIN_HEALTH = 500
    CHECK_INTERVAL = 0.3
    COOLDOWN_BETWEEN_PRESSES = 0.8

    enabled = False
    lock = threading.Lock()

    def toggle_autoclick():
        nonlocal enabled
        with lock:
            enabled = not enabled
            status = "ВКЛЮЧЕН" if enabled else "ВЫКЛЮЧЕН"
            print(f"армлет {status}")

    keyboard.add_hotkey('insert', toggle_autoclick)


    last_press = 0

    try:
        while True:
            if not enabled:
                time.sleep(0.2)
                continue

            try:
                ptr = pm.read_longlong(client_base + static_offset)
                if ptr == 0:
                    raise Exception("0")

                for off in read_offsets:
                    ptr = pm.read_longlong(ptr + off)
                    if ptr == 0:
                        raise Exception(f"{hex(off)}")

                health = pm.read_int(ptr + final_offset)
                now = time.time()

                print(f"\r{health:>4}  [AUTO ARMLET: {'ON' if enabled else 'OFF'}]", end="")

                if health < MIN_HEALTH and (now - last_press) >= COOLDOWN_BETWEEN_PRESSES:
                    keyboard.press_and_release('n')
                    keyboard.press_and_release('n')
                    last_press = now

                time.sleep(CHECK_INTERVAL)

            except Exception as e:
                time.sleep(1)

    except KeyboardInterrupt:
        keyboard.unhook_all()
        pm.close_process()
        sys.exit(0)

if __name__ == "__main__":
    if not run_as_admin():
        sys.exit(0)

    try:
        import pymem, keyboard
    except ImportError:
        sys.exit(0)

    main()
я пробывал делать с оффсетами не получалось оно выдавало 1137 хп всегда вот код
Код:
Expand Collapse Copy
import pymem
import pymem.process

 
m_iHealth = 0x34C                          
dwEntityList = 0x6037970                  
dwGameEntitySystem = 0x66DE078             
dwGameEntitySystem_highestEntityIndex = 0x118

def main():
    try:
        pm = pymem.Pymem("dota2.exe")
    except pymem.exception.ProcessNotFound:
        return


    client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll
    print(f"client.dll: {hex(client)}")
    game_entity_system = pm.read_longlong(client + dwGameEntitySystem)
    print(f"GameEntitySystem: {hex(game_entity_system)}")


    highest_idx = pm.read_int(game_entity_system + dwGameEntitySystem_highestEntityIndex)
    print(f"Наибольший индекс сущности: {highest_idx}")
    entity_list_base = pm.read_longlong(client + dwEntityList)
    print(f"Entity list base: {hex(entity_list_base)}")
    print("\n--- Сущности с HP > 0 ---")
    for i in range(highest_idx + 1):
        try:
            entity_ptr = pm.read_longlong(entity_list_base + i * 8)
            if entity_ptr == 0:
                continue
            health = pm.read_int(entity_ptr + m_iHealth)
            if health > 0:
                print(f"[{i}] Entity: {hex(entity_ptr)}  HP: {health}")
        except pymem.exception.MemoryReadError:
            pass

if __name__ == "__main__":
    main()
вот я сам доставал оффсеты и дампил и чужие брал все равно выдает кучу всего но не енити
Итерация i * 8 относится к самому списку листов, а не ко внутренностям листа.
Если пару минут посмотреть можно найти:
C++:
Expand Collapse Copy
class EListElement;

class EListElement {
    /* 00000000 */ char pad_0000[0x18];
public:
    /* 00000018 */ char* *m_pName;
    /* 00000020 */ char* *m_pGroup;
private:
    /* 00000028 */ char pad_0028[0x48];
}; //Size: 0x70 (112)

class EntitySys;

class EntitySys {
public:
    /* 00000000 */ int64_t vftable;
private:
    /* 00000008 */ char pad_0008[0x8];
public:
    /* 00000010 */ class EListElement(* *EntityList)[512];
private:
    /* 00000018 */ char pad_0018[0x50];
}; //Size: 0x68 (104)
Не факт, что правильно описал.

Да самих хпшек еще далеко
 
Последнее редактирование:
Код:
Expand Collapse Copy
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import os
import time
import ctypes
import threading

def run_as_admin():
    try:
        if ctypes.windll.shell32.IsUserAnAdmin():
            return True
        script = os.path.abspath(sys.argv[0])
        ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, f'"{script}"', None, 1)
        return False
    except:
        return False

def main():
    import pymem
    import pymem.process
    import keyboard

    print("   INSERT  - Включить авто-армлет")

    try:
        pm = pymem.Pymem("dota2.exe")
    except:
        return

    client_module = pymem.process.module_from_name(pm.process_handle, "client.dll")
    if not client_module:
        print("client.dll не найден")
        return
    client_base = client_module.lpBaseOfDll
    static_offset = 0x06551150
    read_offsets = [0x8, 0x298, 0x58, 0x230, 0x8, 0x28]
    final_offset = 0x40
    MIN_HEALTH = 500
    CHECK_INTERVAL = 0.3
    COOLDOWN_BETWEEN_PRESSES = 0.8

    enabled = False
    lock = threading.Lock()

    def toggle_autoclick():
        nonlocal enabled
        with lock:
            enabled = not enabled
            status = "ВКЛЮЧЕН" if enabled else "ВЫКЛЮЧЕН"
            print(f"армлет {status}")

    keyboard.add_hotkey('insert', toggle_autoclick)


    last_press = 0

    try:
        while True:
            if not enabled:
                time.sleep(0.2)
                continue

            try:
                ptr = pm.read_longlong(client_base + static_offset)
                if ptr == 0:
                    raise Exception("0")

                for off in read_offsets:
                    ptr = pm.read_longlong(ptr + off)
                    if ptr == 0:
                        raise Exception(f"{hex(off)}")

                health = pm.read_int(ptr + final_offset)
                now = time.time()

                print(f"\r{health:>4}  [AUTO ARMLET: {'ON' if enabled else 'OFF'}]", end="")

                if health < MIN_HEALTH and (now - last_press) >= COOLDOWN_BETWEEN_PRESSES:
                    keyboard.press_and_release('n')
                    keyboard.press_and_release('n')
                    last_press = now

                time.sleep(CHECK_INTERVAL)

            except Exception as e:
                time.sleep(1)

    except KeyboardInterrupt:
        keyboard.unhook_all()
        pm.close_process()
        sys.exit(0)

if __name__ == "__main__":
    if not run_as_admin():
        sys.exit(0)

    try:
        import pymem, keyboard
    except ImportError:
        sys.exit(0)

    main()
я пробывал делать с оффсетами не получалось оно выдавало 1137 хп всегда вот код
Код:
Expand Collapse Copy
import pymem
import pymem.process

 
m_iHealth = 0x34C                           
dwEntityList = 0x6037970                   
dwGameEntitySystem = 0x66DE078              
dwGameEntitySystem_highestEntityIndex = 0x118 

def main():
    try:
        pm = pymem.Pymem("dota2.exe")
    except pymem.exception.ProcessNotFound:
        return


    client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll
    print(f"client.dll: {hex(client)}")
    game_entity_system = pm.read_longlong(client + dwGameEntitySystem)
    print(f"GameEntitySystem: {hex(game_entity_system)}")


    highest_idx = pm.read_int(game_entity_system + dwGameEntitySystem_highestEntityIndex)
    print(f"Наибольший индекс сущности: {highest_idx}")
    entity_list_base = pm.read_longlong(client + dwEntityList)
    print(f"Entity list base: {hex(entity_list_base)}")
    print("\n--- Сущности с HP > 0 ---")
    for i in range(highest_idx + 1):
        try:
            entity_ptr = pm.read_longlong(entity_list_base + i * 8)
            if entity_ptr == 0:
                continue
            health = pm.read_int(entity_ptr + m_iHealth)
            if health > 0:
                print(f"[{i}] Entity: {hex(entity_ptr)}  HP: {health}")
        except pymem.exception.MemoryReadError:
            pass

if __name__ == "__main__":
    main()
вот я сам доставал оффсеты и дампил и чужие брал все равно выдает кучу всего но не енити
Можешь посмотреть мой очень старый код(1,5года~) и взять его для примера.
Как я помню он Получает кол-во игроков, кол-во героев, кол-во иллюзий и хп всех игроков, илюзий

Dotadll:
Expand Collapse Copy
#include "pch.h"
#include <Windows.h>
#include <Psapi.h>
#include <iostream>
#include <cstdint>
#include <set>
#include <thread>

using namespace std;
//Функция нажатия клавиши

void PressKey(WORD virtualKeyCode, DWORD dwDelayAfterPressMs) { // dwDelayAfterPressMs - небольшая задержка после нажатия
    INPUT inputs[2] = {};

    // Событие "клавиша нажата"
    inputs[0].type = INPUT_KEYBOARD;
    inputs[0].ki.wVk = virtualKeyCode;
    inputs[0].ki.dwFlags = 0; // 0 для KEYEVENTF_KEYDOWN

    // Событие "клавиша отпущена"
    inputs[1].type = INPUT_KEYBOARD;
    inputs[1].ki.wVk = virtualKeyCode;
    inputs[1].ki.dwFlags = KEYEVENTF_KEYUP;

    UINT uSent = SendInput(2, inputs, sizeof(INPUT));
    if (uSent != 2) {
        cout << "Failed to send input " << GetLastError() << endl;
    }
    if (dwDelayAfterPressMs > 0) {
        std::this_thread::sleep_for(std::chrono::milliseconds(dwDelayAfterPressMs));
    }
}

bool fuzzy_memcmp(const std::uint8_t* lhs, const std::uint8_t* rhs, std::size_t size, const char* masks) noexcept {
    constexpr auto wildcard = '?';
    const auto end = lhs + size;
    for (; lhs < end; ++lhs, ++rhs, ++masks) {
        if (*masks != wildcard && *lhs != *rhs)
            return false;
    }
    return true;
}

const std::uint8_t* sigscan_naive(const std::uint8_t* base, std::size_t input_size, const uint8_t* pattern,
    std::size_t pattern_size, const char* masks) noexcept {
    if (pattern_size && (input_size >= pattern_size) && base && pattern && masks) {
        const auto alignmentCount = (input_size - pattern_size) + 1;
        const auto end = base + alignmentCount;
        for (auto current = base; current < end; ++current) {
            if (fuzzy_memcmp(current, pattern, pattern_size, masks))
                return current;
        }
    }
    return nullptr;
}

BOOL IsPointer(uintptr_t address) {
    MEMORY_BASIC_INFORMATION mbi;
    if (VirtualQuery((LPCVOID)address, &mbi, sizeof(mbi))) {
        return (mbi.State == MEM_COMMIT && (mbi.Protect & PAGE_READWRITE || mbi.Protect & PAGE_READONLY));
    }
    return false;
}
// ==================================================
// КОНСТАНТЫ ДЛЯ ТИПОВ ПРИКАЗОВ
// ==================================================
const int DOTA_UNIT_ORDER_NONE = 0;
const int DOTA_UNIT_ORDER_MOVE_TO_POSITION = 1;
const int DOTA_UNIT_ORDER_MOVE_TO_TARGET = 2;
const int DOTA_UNIT_ORDER_ATTACK_MOVE = 3;
const int DOTA_UNIT_ORDER_ATTACK_TARGET = 4;
const int DOTA_UNIT_ORDER_CAST_POSITION = 5;
const int DOTA_UNIT_ORDER_CAST_TARGET = 6;
const int DOTA_UNIT_ORDER_CAST_TARGET_TREE = 7;
const int DOTA_UNIT_ORDER_CAST_NO_TARGET = 8;
const int DOTA_UNIT_ORDER_CAST_TOGGLE = 9;
const int DOTA_UNIT_ORDER_HOLD_POSITION = 10;
const int DOTA_UNIT_ORDER_TRAIN_ABILITY = 11;
const int DOTA_UNIT_ORDER_DROP_ITEM = 12;
const int DOTA_UNIT_ORDER_GIVE_ITEM = 13;
const int DOTA_UNIT_ORDER_PICKUP_ITEM = 14;
const int DOTA_UNIT_ORDER_PICKUP_RUNE = 15;
const int DOTA_UNIT_ORDER_PURCHASE_ITEM = 16;
const int DOTA_UNIT_ORDER_SELL_ITEM = 17;
const int DOTA_UNIT_ORDER_DISASSEMBLE_ITEM = 18;
const int DOTA_UNIT_ORDER_MOVE_ITEM = 19;
const int DOTA_UNIT_ORDER_CAST_TOGGLE_AUTO = 20;
const int DOTA_UNIT_ORDER_STOP = 21;
const int DOTA_UNIT_ORDER_TAUNT = 22;
const int DOTA_UNIT_ORDER_BUYBACK = 23;
const int DOTA_UNIT_ORDER_GLYPH = 24;
const int DOTA_UNIT_ORDER_EJECT_ITEM_FROM_STASH = 25;
const int DOTA_UNIT_ORDER_CAST_RUNE = 26;
const int DOTA_UNIT_ORDER_PING_ABILITY = 27;
const int DOTA_UNIT_ORDER_MOVE_TO_DIRECTION = 28;
const int DOTA_UNIT_ORDER_PATROL = 29;
const int DOTA_UNIT_ORDER_VECTOR_TARGET_POSITION = 30;
const int DOTA_UNIT_ORDER_RADAR = 31;
const int DOTA_UNIT_ORDER_SET_ITEM_COMBINE_LOCK = 32;
const int DOTA_UNIT_ORDER_CONTINUE = 33;
const int DOTA_UNIT_ORDER_VECTOR_TARGET_CANCELED = 34;
const int DOTA_UNIT_ORDER_CAST_RIVER_PAINT = 35;
const int DOTA_UNIT_ORDER_PREGAME_ADJUST_ITEM_ASSIGNMENT = 36;

// ==================================================
// КОНСТАНТЫ ДЛЯ ИСТОЧНИКОВ ПРИКАЗА
// ==================================================
const int DOTA_ORDER_ISSUER_SELECTED_UNITS = 0;
const int DOTA_ORDER_ISSUER_CURRENT_UNIT_ONLY = 1;
const int DOTA_ORDER_ISSUER_HERO_ONLY = 2;
const int DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY = 3;

DWORD WINAPI EntityScan(LPVOID lpParam) {
    HMODULE hModule = (HMODULE)lpParam;
    //main func
    AllocConsole();
    FILE* stream;
    freopen_s(&stream, "CONOUT$", "w", stdout);

    HMODULE client = GetModuleHandleA("client.dll");
    if (client == NULL) {
        cout << "client.dll not found" << endl;
        return FALSE;
    }
    HMODULE engine2 = GetModuleHandleA("engine2.dll");
    if (engine2 == NULL) {
        cout << "engine2.dll not found" << endl;
        return FALSE;
    }
    
    cout << "client 0x" << hex << client << endl;
    cout << "engine2 0x" << hex << engine2 << endl;

    MODULEINFO out_modinfo{};
    if (!K32GetModuleInformation(GetCurrentProcess(), client, &out_modinfo, sizeof(out_modinfo))) {
        cout << "K32GetModuleInformation failed: " << GetLastError() << endl;
        return FALSE;
    }

    const char masks[]{ "xxx????xx????xxx????xxx" };
    const auto entitysystem_xref = sigscan_naive((const std::uint8_t*)client, out_modinfo.SizeOfImage,
        (const std::uint8_t*)"\x48\x8d\x0d????\xff\x15????\x48\x8b\x0d????\x33\xd2\xe8",
        std::size(masks) - 1,
        masks);
    if (!entitysystem_xref) {
        cout << "entitysystem_xref not found!" << endl;
        return FALSE;
    }

    const auto mov_insn_ptr = entitysystem_xref + 0xD;
    const auto rel32 = *(std::int32_t*)(mov_insn_ptr + 0x3);
    const auto entity_system_ptr = (void**)(mov_insn_ptr + 0x7 + rel32);
    // EntityScan
    while (1) {
        system("cls");
        const auto entitysystem = *entity_system_ptr;
        if (!entitysystem) {
            cout << "entitysystem not created yet" << endl;
            continue;
        }
        cout << "entitysystem: 0x" << hex << entitysystem << endl;
        int heroCount = 0;
        std::set<uintptr_t> NPC;
        int index = 1;
        int illusion = 0;
        for (int i = 0; i < 64; i++) {
            uintptr_t entitylistAddress = uintptr_t(entitysystem) + 0x10 + (i * 0x8); // размер ентлиста
            void** entitylist = *(void***)(entitylistAddress);

            if (entitylist && IsPointer(uintptr_t(entitylist))) {
                for (int j = 0; j < 512; j++) {
                    uintptr_t entAddr = uintptr_t(entitylist) + (j * 0x78); // 0x78 размер сущности
                    void* entPtr = *(void**)entAddr;

                    if (IsPointer((uintptr_t)entPtr)) {
                        int index = i * 512 + j;
                        unsigned char isnpc = *(unsigned char*)(uintptr_t(entPtr) + 0x4f4); // isnpc
                        if (index >= 1 && index <= 64) {
                            bool islocal = *(bool*)(uintptr_t(entPtr) + 0x690); // Смотрим у каждого контроллера локальный ли он игрок? islocalhero = 0x690
                            if (islocal == 1 && islocal == TRUE) {
                                cout << "11111111111111111111111111111" << endl << endl;
                                cout << "Local player find at 0x" << entPtr << endl << endl;
                                uint32_t rawheroindex = *(uint32_t*)(uintptr_t(entPtr) + 0x80c);
                                uint32_t heroindex = rawheroindex & 0x7FFF;
                                uint32_t listindex = heroindex / 512;
                                uint32_t entindex = heroindex % 512;
                                uintptr_t chunkadr = uintptr_t(entitysystem) + 0x10 + (listindex * 0x8);
                                void** chunk_ptr = *reinterpret_cast<void***>(chunkadr);
                                uintptr_t localheroadr = uintptr_t(chunk_ptr) + (entindex * 0x78);
                                void* localheroptr = *reinterpret_cast<void**>(localheroadr);
                                cout << "Localhero found at 0x" << localheroptr << " him hp is: " << dec << *(int*)(uintptr_t(localheroptr) + 0x34c) << endl;
                                cout << "Adress vecabl 0x" << hex << uintptr_t(localheroptr) + 0xad8 << endl;
                                cout << "11111111111111111111111111111" << endl << endl;

                            }
                        }

                        if (isnpc == 3) {
                            if (NPC.insert(reinterpret_cast<uintptr_t>(entPtr)).second) {

                                uintptr_t unttypeadr = uintptr_t(entPtr) + 0xa44; // 0xa44 = isnpc(bool) npc == 3
                                uint32_t unttype = *(uint32_t*)(unttypeadr); //read

                                if ((unttype & 1) != 0) {
                                    heroCount++;
                                    bool isIllusion(*(uint32_t*)(uintptr_t(entPtr) + 0x1870) != 0xFFFFFFFF);
                                    if (isIllusion == TRUE) {
                                        illusion++;
                                        cout << "Illusion #" << dec << heroCount << " found at address: 0x" << hex << entPtr << "  him hp is: " << dec << *(int*)(uintptr_t(entPtr) + 0x34c) << endl; // hp = 0x34
                                    }
                                    else {
                                        heroCount++;
                                        cout << "Hero #" << dec << illusion << " found at address: 0x" << hex << entPtr << "  him hp is: " << dec << *(int*)(uintptr_t(entPtr) + 0x34c) <<  endl; // hp = 0x34c
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout << "Total players:: " << index << endl;
        cout << "Total heroes:: " << heroCount << endl;
        cout << "Total ilussions:: " << illusion << endl;

        std::this_thread::sleep_for(std::chrono::milliseconds(500));
    }
}


BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        HANDLE hThread = CreateThread(
            nullptr,         
            0,               
            EntityScan,       
            hModule,         
            0,               
            nullptr           
        );
        if (hThread) {
            CloseHandle(hThread);
        }
        else {
            cout << "Thread not created" << endl;
            return FALSE;
        }

        return TRUE;
    }
    return TRUE;
}
 
Можешь посмотреть мой очень старый код(1,5года~) и взять его для примера.
Как я помню он Получает кол-во игроков, кол-во героев, кол-во иллюзий и хп всех игроков, илюзий

Dotadll:
Expand Collapse Copy
#include "pch.h"
#include <Windows.h>
#include <Psapi.h>
#include <iostream>
#include <cstdint>
#include <set>
#include <thread>

using namespace std;
//Функция нажатия клавиши

void PressKey(WORD virtualKeyCode, DWORD dwDelayAfterPressMs) { // dwDelayAfterPressMs - небольшая задержка после нажатия
    INPUT inputs[2] = {};

    // Событие "клавиша нажата"
    inputs[0].type = INPUT_KEYBOARD;
    inputs[0].ki.wVk = virtualKeyCode;
    inputs[0].ki.dwFlags = 0; // 0 для KEYEVENTF_KEYDOWN

    // Событие "клавиша отпущена"
    inputs[1].type = INPUT_KEYBOARD;
    inputs[1].ki.wVk = virtualKeyCode;
    inputs[1].ki.dwFlags = KEYEVENTF_KEYUP;

    UINT uSent = SendInput(2, inputs, sizeof(INPUT));
    if (uSent != 2) {
        cout << "Failed to send input " << GetLastError() << endl;
    }
    if (dwDelayAfterPressMs > 0) {
        std::this_thread::sleep_for(std::chrono::milliseconds(dwDelayAfterPressMs));
    }
}

bool fuzzy_memcmp(const std::uint8_t* lhs, const std::uint8_t* rhs, std::size_t size, const char* masks) noexcept {
    constexpr auto wildcard = '?';
    const auto end = lhs + size;
    for (; lhs < end; ++lhs, ++rhs, ++masks) {
        if (*masks != wildcard && *lhs != *rhs)
            return false;
    }
    return true;
}

const std::uint8_t* sigscan_naive(const std::uint8_t* base, std::size_t input_size, const uint8_t* pattern,
    std::size_t pattern_size, const char* masks) noexcept {
    if (pattern_size && (input_size >= pattern_size) && base && pattern && masks) {
        const auto alignmentCount = (input_size - pattern_size) + 1;
        const auto end = base + alignmentCount;
        for (auto current = base; current < end; ++current) {
            if (fuzzy_memcmp(current, pattern, pattern_size, masks))
                return current;
        }
    }
    return nullptr;
}

BOOL IsPointer(uintptr_t address) {
    MEMORY_BASIC_INFORMATION mbi;
    if (VirtualQuery((LPCVOID)address, &mbi, sizeof(mbi))) {
        return (mbi.State == MEM_COMMIT && (mbi.Protect & PAGE_READWRITE || mbi.Protect & PAGE_READONLY));
    }
    return false;
}
// ==================================================
// КОНСТАНТЫ ДЛЯ ТИПОВ ПРИКАЗОВ
// ==================================================
const int DOTA_UNIT_ORDER_NONE = 0;
const int DOTA_UNIT_ORDER_MOVE_TO_POSITION = 1;
const int DOTA_UNIT_ORDER_MOVE_TO_TARGET = 2;
const int DOTA_UNIT_ORDER_ATTACK_MOVE = 3;
const int DOTA_UNIT_ORDER_ATTACK_TARGET = 4;
const int DOTA_UNIT_ORDER_CAST_POSITION = 5;
const int DOTA_UNIT_ORDER_CAST_TARGET = 6;
const int DOTA_UNIT_ORDER_CAST_TARGET_TREE = 7;
const int DOTA_UNIT_ORDER_CAST_NO_TARGET = 8;
const int DOTA_UNIT_ORDER_CAST_TOGGLE = 9;
const int DOTA_UNIT_ORDER_HOLD_POSITION = 10;
const int DOTA_UNIT_ORDER_TRAIN_ABILITY = 11;
const int DOTA_UNIT_ORDER_DROP_ITEM = 12;
const int DOTA_UNIT_ORDER_GIVE_ITEM = 13;
const int DOTA_UNIT_ORDER_PICKUP_ITEM = 14;
const int DOTA_UNIT_ORDER_PICKUP_RUNE = 15;
const int DOTA_UNIT_ORDER_PURCHASE_ITEM = 16;
const int DOTA_UNIT_ORDER_SELL_ITEM = 17;
const int DOTA_UNIT_ORDER_DISASSEMBLE_ITEM = 18;
const int DOTA_UNIT_ORDER_MOVE_ITEM = 19;
const int DOTA_UNIT_ORDER_CAST_TOGGLE_AUTO = 20;
const int DOTA_UNIT_ORDER_STOP = 21;
const int DOTA_UNIT_ORDER_TAUNT = 22;
const int DOTA_UNIT_ORDER_BUYBACK = 23;
const int DOTA_UNIT_ORDER_GLYPH = 24;
const int DOTA_UNIT_ORDER_EJECT_ITEM_FROM_STASH = 25;
const int DOTA_UNIT_ORDER_CAST_RUNE = 26;
const int DOTA_UNIT_ORDER_PING_ABILITY = 27;
const int DOTA_UNIT_ORDER_MOVE_TO_DIRECTION = 28;
const int DOTA_UNIT_ORDER_PATROL = 29;
const int DOTA_UNIT_ORDER_VECTOR_TARGET_POSITION = 30;
const int DOTA_UNIT_ORDER_RADAR = 31;
const int DOTA_UNIT_ORDER_SET_ITEM_COMBINE_LOCK = 32;
const int DOTA_UNIT_ORDER_CONTINUE = 33;
const int DOTA_UNIT_ORDER_VECTOR_TARGET_CANCELED = 34;
const int DOTA_UNIT_ORDER_CAST_RIVER_PAINT = 35;
const int DOTA_UNIT_ORDER_PREGAME_ADJUST_ITEM_ASSIGNMENT = 36;

// ==================================================
// КОНСТАНТЫ ДЛЯ ИСТОЧНИКОВ ПРИКАЗА
// ==================================================
const int DOTA_ORDER_ISSUER_SELECTED_UNITS = 0;
const int DOTA_ORDER_ISSUER_CURRENT_UNIT_ONLY = 1;
const int DOTA_ORDER_ISSUER_HERO_ONLY = 2;
const int DOTA_ORDER_ISSUER_PASSED_UNIT_ONLY = 3;

DWORD WINAPI EntityScan(LPVOID lpParam) {
    HMODULE hModule = (HMODULE)lpParam;
    //main func
    AllocConsole();
    FILE* stream;
    freopen_s(&stream, "CONOUT$", "w", stdout);

    HMODULE client = GetModuleHandleA("client.dll");
    if (client == NULL) {
        cout << "client.dll not found" << endl;
        return FALSE;
    }
    HMODULE engine2 = GetModuleHandleA("engine2.dll");
    if (engine2 == NULL) {
        cout << "engine2.dll not found" << endl;
        return FALSE;
    }
  
    cout << "client 0x" << hex << client << endl;
    cout << "engine2 0x" << hex << engine2 << endl;

    MODULEINFO out_modinfo{};
    if (!K32GetModuleInformation(GetCurrentProcess(), client, &out_modinfo, sizeof(out_modinfo))) {
        cout << "K32GetModuleInformation failed: " << GetLastError() << endl;
        return FALSE;
    }

    const char masks[]{ "xxx????xx????xxx????xxx" };
    const auto entitysystem_xref = sigscan_naive((const std::uint8_t*)client, out_modinfo.SizeOfImage,
        (const std::uint8_t*)"\x48\x8d\x0d????\xff\x15????\x48\x8b\x0d????\x33\xd2\xe8",
        std::size(masks) - 1,
        masks);
    if (!entitysystem_xref) {
        cout << "entitysystem_xref not found!" << endl;
        return FALSE;
    }

    const auto mov_insn_ptr = entitysystem_xref + 0xD;
    const auto rel32 = *(std::int32_t*)(mov_insn_ptr + 0x3);
    const auto entity_system_ptr = (void**)(mov_insn_ptr + 0x7 + rel32);
    // EntityScan
    while (1) {
        system("cls");
        const auto entitysystem = *entity_system_ptr;
        if (!entitysystem) {
            cout << "entitysystem not created yet" << endl;
            continue;
        }
        cout << "entitysystem: 0x" << hex << entitysystem << endl;
        int heroCount = 0;
        std::set<uintptr_t> NPC;
        int index = 1;
        int illusion = 0;
        for (int i = 0; i < 64; i++) {
            uintptr_t entitylistAddress = uintptr_t(entitysystem) + 0x10 + (i * 0x8); // размер ентлиста
            void** entitylist = *(void***)(entitylistAddress);

            if (entitylist && IsPointer(uintptr_t(entitylist))) {
                for (int j = 0; j < 512; j++) {
                    uintptr_t entAddr = uintptr_t(entitylist) + (j * 0x78); // 0x78 размер сущности
                    void* entPtr = *(void**)entAddr;

                    if (IsPointer((uintptr_t)entPtr)) {
                        int index = i * 512 + j;
                        unsigned char isnpc = *(unsigned char*)(uintptr_t(entPtr) + 0x4f4); // isnpc
                        if (index >= 1 && index <= 64) {
                            bool islocal = *(bool*)(uintptr_t(entPtr) + 0x690); // Смотрим у каждого контроллера локальный ли он игрок? islocalhero = 0x690
                            if (islocal == 1 && islocal == TRUE) {
                                cout << "11111111111111111111111111111" << endl << endl;
                                cout << "Local player find at 0x" << entPtr << endl << endl;
                                uint32_t rawheroindex = *(uint32_t*)(uintptr_t(entPtr) + 0x80c);
                                uint32_t heroindex = rawheroindex & 0x7FFF;
                                uint32_t listindex = heroindex / 512;
                                uint32_t entindex = heroindex % 512;
                                uintptr_t chunkadr = uintptr_t(entitysystem) + 0x10 + (listindex * 0x8);
                                void** chunk_ptr = *reinterpret_cast<void***>(chunkadr);
                                uintptr_t localheroadr = uintptr_t(chunk_ptr) + (entindex * 0x78);
                                void* localheroptr = *reinterpret_cast<void**>(localheroadr);
                                cout << "Localhero found at 0x" << localheroptr << " him hp is: " << dec << *(int*)(uintptr_t(localheroptr) + 0x34c) << endl;
                                cout << "Adress vecabl 0x" << hex << uintptr_t(localheroptr) + 0xad8 << endl;
                                cout << "11111111111111111111111111111" << endl << endl;

                            }
                        }

                        if (isnpc == 3) {
                            if (NPC.insert(reinterpret_cast<uintptr_t>(entPtr)).second) {

                                uintptr_t unttypeadr = uintptr_t(entPtr) + 0xa44; // 0xa44 = isnpc(bool) npc == 3
                                uint32_t unttype = *(uint32_t*)(unttypeadr); //read

                                if ((unttype & 1) != 0) {
                                    heroCount++;
                                    bool isIllusion(*(uint32_t*)(uintptr_t(entPtr) + 0x1870) != 0xFFFFFFFF);
                                    if (isIllusion == TRUE) {
                                        illusion++;
                                        cout << "Illusion #" << dec << heroCount << " found at address: 0x" << hex << entPtr << "  him hp is: " << dec << *(int*)(uintptr_t(entPtr) + 0x34c) << endl; // hp = 0x34
                                    }
                                    else {
                                        heroCount++;
                                        cout << "Hero #" << dec << illusion << " found at address: 0x" << hex << entPtr << "  him hp is: " << dec << *(int*)(uintptr_t(entPtr) + 0x34c) <<  endl; // hp = 0x34c
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        cout << "Total players:: " << index << endl;
        cout << "Total heroes:: " << heroCount << endl;
        cout << "Total ilussions:: " << illusion << endl;

        std::this_thread::sleep_for(std::chrono::milliseconds(500));
    }
}


BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        HANDLE hThread = CreateThread(
            nullptr,       
            0,             
            EntityScan,     
            hModule,       
            0,             
            nullptr         
        );
        if (hThread) {
            CloseHandle(hThread);
        }
        else {
            cout << "Thread not created" << endl;
            return FALSE;
        }

        return TRUE;
    }
    return TRUE;
}
помоему это куски кода которые лежали в гайдах и прочих тредах по доте которые соеденились с помощью иишечки:pepeb:
 
помоему это куски кода которые лежали в гайдах и прочих тредах по доте которые соеденились с помощью иишечки:pepeb:
Неа, это 24-25 год, бесплатные ии очень тупые. Та и гайдов по доте почти нет, только от либералиста, который уже забросил форум
 
Неа, это 24-25 год, бесплатные ии очень тупые. Та и гайдов по доте почти нет, только от либералиста, который уже забросил форум
коменатрии в коде в целом как ии не шибко умные:roflanBuldiga:
 
коменатрии в коде в целом как ии не шибко умные:roflanBuldiga:
Единственное что ии написало, так это PressKey() и константы для управления героем, которые я так и не реализовал.
 
Назад
Сверху Снизу