分类
无聊代码

SteamRender 绘制Hook

Hook GameOVerlayUi.exe Renader Interface

Steam.cpp

#include "stdafx.h" #include "Steam.h" Steam::Steam() { Begin = 0; } ULONG64 AllocateMem(DWORD Pid, DWORD ProtectType, DWORD Size) { OBFI6(ULONG64) result= _regedit_allocmem((HANDLE)Pid, Size); if (result>100) { _regedit_protectmem((HANDLE)Pid, result, Size, ProtectType); } return result; } DWORD ReadDw(HANDLE Pid, ULONG64 addr) { DWORD data = 0; _regedit_read(Pid, addr, (ULONG64)&data, 4); return data; } void WriteDw(HANDLE Pid, ULONG64 addr, DWORD data) { _regedit_write(Pid, addr, (ULONG64)&data, 4); } VOID Page_WriteCode(HANDLE Pid,ULONG64 addr, ULONG64 target, size_t size) { OBFI6(ULONG32) old = _regedit_protectmem(Pid, addr, 4096, PAGE_EXECUTE_READWRITE); _regedit_write(Pid, addr, (ULONG64)target, size); _regedit_protectmem(Pid, addr, 4096, (ULONG32)old); } VOID Steam::SteamCheckThread(Steam * Context) { VMProtectBeginMutation("SteamCheckThread"); while (true) { if (Context->dwGameOverlayUI != (DWORD)Context->GetProcessIdByNameA("GameOverlayUI.exe")) { Sleep(5000); if (!Context->SteamInit()) { if ((DWORD)GetGamePid() 1) { return TRUE; } else { return FALSE; } } BOOL Steam::SteamInit() { VMProtectBeginMutation("SteamInit"); DWORD old = 0; dwGameOverlayUI= (DWORD)GetProcessIdByNameA("GameOverlayUI.exe"); if (!dwGameOverlayUI) return FALSE; //_regedit_protect((HANDLE)dwGameOverlayUI); ULONG64 hModule=_regedit_getmodule((HANDLE)dwGameOverlayUI, "vgui2_s.DLL"); if ((DWORD)hModule

Steam.h

#pragma once #include "stdafx.h" #include "windows.h" #include #include #include #include using namespace std; typedef struct SteamCache { BYTE Cache[280]; BYTE CacheSize; }; class Steam { public: Steam(); ~Steam(); DWORD GetProcessIdByNameA(const CHAR*name); BOOL SteamInit(); VOID Steam_RenderBegin(); VOID Steam_RenderEnd(); VOID DrawTextA(DWORD t, DWORD x, DWORD y, DWORD color, const char* text); VOID DrawRect(DWORD x, DWORD y, DWORD w, DWORD h, DWORD color); VOID DrawRect2(DWORD x, DWORD y, DWORD x1, DWORD y1, DWORD color); VOID DrawTextW(DWORD t, DWORD x, DWORD y, DWORD color, wchar_t* text); BOOLEAN SteamCheckDrop(); private: static VOID SteamCheckThread(Steam * Context); DWORD Begin; LPVOID p1, p2; LPVOID CacheMem; DWORD dwGameOverlayUI; //list SteamGameOverlayCache; };
0 0 vote
文章评分

由FAKE

Через тернии к звездам,
через радость и слезы
Мы проложим дорогу

Subscribe
提醒
guest
你的昵称 用于分别你是谁
你的电子邮箱 用于被回复时通知
0 评论
Inline Feedbacks
View all comments