#NoEnv
F10::
t := !t
Data := t
Size = 1
VarSetCapacity(Buf, Size, 0)
NumPut(Data, Buf, "UInt")
PROCESS_VM_WRITE = 0x20
PROCESS_VM_OPERATION = 0x8
Process, Exist, csgo.exe
If(!ErrorLevel) {
MsgBox, Процесс не найден.
ExitApp
}
PID := ErrorLevel
base := GetDllBase("client.dll", ErrorLevel)
pAddress := base + 1878376
;if (pAddress != 1438689640)
;msgbox % New update!
hProcess := DllCall("OpenProcess", "UInt", PROCESS_VM_WRITE | PROCESS_VM_OPERATION
, "Int", False
, "UInt", PID)
If(!hProcess) {
MsgBox, Не удалось открыть процесс.
ExitApp
}
Ret := DllCall("WriteProcessMemory", "Ptr", hProcess
, "Ptr", Address
, "Ptr", &Buf
, "Ptr", Size
, "Ptr", 0)
DllCall("CloseHandle", "Ptr", hProcess)
If(!Ret) {
MsgBox, Не удалось записать.
ExitApp
}
return
GetDllBase(DllName, PID = 0)
{
TH32CS_SNAPMODULE := 0x00000008
INVALID_HANDLE_VALUE = -1
VarSetCapacity(me32, 548, 0)
NumPut(548, me32, "Uint")
snapMod := DllCall("CreateToolhelp32Snapshot", "Uint", TH32CS_SNAPMODULE
, "Uint", PID)
If (snapMod = INVALID_HANDLE_VALUE) {
Return 0
}
If (DllCall("Module32First", "Ptr", snapMod, "Ptr", &me32)){
while(DllCall("Module32Next", "Ptr", snapMod, "Ptr", &me32)) {
If !DllCall("lstrcmpi", "Str", DllName, "Ptr", &me32 + 32) {
DllCall("CloseHandle", "Ptr", snapMod)
Return NumGet(me32, A_PtrSize = 8 ? 40:28, "Ptr")
}
}
}
DllCall("CloseHandle", "Ptr", snapMod)
Return 0
}