Вопрос Проблема с получением айди процесса

Новичок
Статус
Оффлайн
Регистрация
12 Янв 2023
Сообщения
1
Реакции[?]
0
Поинты[?]
0
Пробую сделать external esp и вот тут такой проблем вышел(
), пробывал переписать по другому получение айдишки но все ровно не помогало( компилил х64 и х86 )
C++:
#include <iostream>
#include "SharedMemoryStream.h"

int main()
{
    DWORD processId = GetProcessId(L"csgo.exe");

    wchar_t nameFormat[MAX_PATH];

    swprintf(nameFormat, ARRAYSIZE(nameFormat), L"GameOverlayRender_PaintCmdStream_%d_%%s-IPCWrapper", processId);
    SharedMemoryStream renderStream(nameFormat);

    swprintf(nameFormat, ARRAYSIZE(nameFormat), L"GameOverlay_InputEventStream_%d_%%s-IPCWrapper", processId);
    SharedMemoryStream inputStream(nameFormat);

    HANDLE renderMutex = renderStream.GetMutexHandle();
    HANDLE inputMutex = inputStream.GetMutexHandle();

    HANDLE handles[] =
    {
        renderMutex,
        inputMutex,
        inputStream.GetAvailableHandle()
    };

    bool loaded = false;
    DWORD textureVersion = 0;

    while (true)
    {
        WaitForMultipleObjects(ARRAYSIZE(handles), handles, TRUE, INFINITE);

        struct
        {
            DWORD renderCommand;
            int x0;
            int y0;
            int x1;
            int y1;
            float u0;
            float v0;
            float u1;
            float v1;
            float uk4;
            DWORD colorStart;
            DWORD colorEnd;
            DWORD gradientDirection;
            DWORD textureId;
        } drawTexturedRect =
        {
        3,
        0,
        0,
        400,
        400,
        0.0f,
        0.0f,
        1.0f,
        1.0f,
        1.0f,
        0xFFFFFFFF,
        0xFFFFFFFF,
        3,
        1337
        };

        renderStream.PutFront(&drawTexturedRect, sizeof(drawTexturedRect));

        if (!loaded)
        {
            HDC dcHandle = CreateCompatibleDC(NULL);

            BITMAPINFO bmi;
            memset(&bmi, 0, sizeof(bmi));
            bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
            bmi.bmiHeader.biWidth = 400;
            bmi.bmiHeader.biHeight = -400;
            bmi.bmiHeader.biPlanes = 1;
            bmi.bmiHeader.biBitCount = 32;
            bmi.bmiHeader.biCompression = BI_RGB;

            char* buffer;

            HBITMAP dibHandle = CreateDIBSection(dcHandle, (BITMAPINFO*)&bmi, DIB_RGB_COLORS, (void**)&buffer, 0, 0);
            SelectObject(dcHandle, dibHandle);

            SetBkColor(dcHandle, RGB(0, 0, 0));
            SetTextColor(dcHandle, RGB(255, 255, 255));
            SetBkMode(dcHandle, TRANSPARENT);

            HFONT fontHandle = CreateFontW(24, 24, 0, 5, 1, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, 0, L"Lucida Console");
            SelectObject(dcHandle, fontHandle);

            RECT stringRect = { 0, 0, 400, 400 };

            DrawTextW(dcHandle, L"luca", -1, &stringRect, DT_WORDBREAK);

            DWORD size = 400 * 400 * 4;

            
            for (int i = 0; i < size; i += 4)
            {
                char r = buffer[i];
                char g = buffer[i + 1];
                char b = buffer[i + 2];
                buffer[i + 3] = (char)((float)r * 0.34f + (float)g * 0.55f + (float)b * 0.11f);
            }

            
            renderStream.PutFront(buffer, size);

            struct
            {
                DWORD renderCommand;
                DWORD textureId;
                DWORD version;
                BOOL fullUpdate;
                DWORD size;
                DWORD width;
                DWORD height;
                DWORD x;
                DWORD y;
            } loadTexture =
            {
                1,
                1337,
                ++textureVersion,
                1,
                size,
                400,
                400,
                0,
                0
            };

            
            renderStream.PutFront(&loadTexture, sizeof(loadTexture));

            loaded = true;

            DeleteObject(dibHandle);
            DeleteObject(fontHandle);

            DeleteDC(dcHandle);
        }

        ReleaseMutex(renderMutex);
        ReleaseMutex(inputMutex);
    }
}
 
std::X$$V::Z::_Func_impl_no_alloc
Пользователь
Статус
Оффлайн
Регистрация
30 Мар 2019
Сообщения
389
Реакции[?]
103
Поинты[?]
1K
Пробую сделать external esp и вот тут такой проблем вышел(
), пробывал переписать по другому получение айдишки но все ровно не помогало( компилил х64 и х86 )
C++:
#include <iostream>
#include "SharedMemoryStream.h"

int main()
{
    DWORD processId = GetProcessId(L"csgo.exe");

    wchar_t nameFormat[MAX_PATH];

    swprintf(nameFormat, ARRAYSIZE(nameFormat), L"GameOverlayRender_PaintCmdStream_%d_%%s-IPCWrapper", processId);
    SharedMemoryStream renderStream(nameFormat);

    swprintf(nameFormat, ARRAYSIZE(nameFormat), L"GameOverlay_InputEventStream_%d_%%s-IPCWrapper", processId);
    SharedMemoryStream inputStream(nameFormat);

    HANDLE renderMutex = renderStream.GetMutexHandle();
    HANDLE inputMutex = inputStream.GetMutexHandle();

    HANDLE handles[] =
    {
        renderMutex,
        inputMutex,
        inputStream.GetAvailableHandle()
    };

    bool loaded = false;
    DWORD textureVersion = 0;

    while (true)
    {
        WaitForMultipleObjects(ARRAYSIZE(handles), handles, TRUE, INFINITE);

        struct
        {
            DWORD renderCommand;
            int x0;
            int y0;
            int x1;
            int y1;
            float u0;
            float v0;
            float u1;
            float v1;
            float uk4;
            DWORD colorStart;
            DWORD colorEnd;
            DWORD gradientDirection;
            DWORD textureId;
        } drawTexturedRect =
        {
        3,
        0,
        0,
        400,
        400,
        0.0f,
        0.0f,
        1.0f,
        1.0f,
        1.0f,
        0xFFFFFFFF,
        0xFFFFFFFF,
        3,
        1337
        };

        renderStream.PutFront(&drawTexturedRect, sizeof(drawTexturedRect));

        if (!loaded)
        {
            HDC dcHandle = CreateCompatibleDC(NULL);

            BITMAPINFO bmi;
            memset(&bmi, 0, sizeof(bmi));
            bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
            bmi.bmiHeader.biWidth = 400;
            bmi.bmiHeader.biHeight = -400;
            bmi.bmiHeader.biPlanes = 1;
            bmi.bmiHeader.biBitCount = 32;
            bmi.bmiHeader.biCompression = BI_RGB;

            char* buffer;

            HBITMAP dibHandle = CreateDIBSection(dcHandle, (BITMAPINFO*)&bmi, DIB_RGB_COLORS, (void**)&buffer, 0, 0);
            SelectObject(dcHandle, dibHandle);

            SetBkColor(dcHandle, RGB(0, 0, 0));
            SetTextColor(dcHandle, RGB(255, 255, 255));
            SetBkMode(dcHandle, TRANSPARENT);

            HFONT fontHandle = CreateFontW(24, 24, 0, 5, 1, 0, 0, 0, 0, 0, 0, ANTIALIASED_QUALITY, 0, L"Lucida Console");
            SelectObject(dcHandle, fontHandle);

            RECT stringRect = { 0, 0, 400, 400 };

            DrawTextW(dcHandle, L"luca", -1, &stringRect, DT_WORDBREAK);

            DWORD size = 400 * 400 * 4;

           
            for (int i = 0; i < size; i += 4)
            {
                char r = buffer[i];
                char g = buffer[i + 1];
                char b = buffer[i + 2];
                buffer[i + 3] = (char)((float)r * 0.34f + (float)g * 0.55f + (float)b * 0.11f);
            }

           
            renderStream.PutFront(buffer, size);

            struct
            {
                DWORD renderCommand;
                DWORD textureId;
                DWORD version;
                BOOL fullUpdate;
                DWORD size;
                DWORD width;
                DWORD height;
                DWORD x;
                DWORD y;
            } loadTexture =
            {
                1,
                1337,
                ++textureVersion,
                1,
                size,
                400,
                400,
                0,
                0
            };

           
            renderStream.PutFront(&loadTexture, sizeof(loadTexture));

            loaded = true;

            DeleteObject(dibHandle);
            DeleteObject(fontHandle);

            DeleteDC(dcHandle);
        }

        ReleaseMutex(renderMutex);
        ReleaseMutex(inputMutex);
    }
}
функция принимает хендл процесса, а ты передаёшь имя
 
Сверху Снизу