Что нового

[Процессы] Ускорение процесса игры

Ganibal95

GreenBytes
Сообщения
877
Репутация
240
Здравствуйте, как можно увеличить скорость(становется быстрее процесс) процесса...
Пример увеличения скорости в программе: "Cheat Engine"(Чит Эненджи)
Возможно можно как то реализовать ускорение!
:IL_AutoIt_1: Зарание СПС)
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
Ganibal95
Я не уверен, но, может быть, поможет функция ProcessSetPriority().
 
Автор
Ganibal95

Ganibal95

GreenBytes
Сообщения
877
Репутация
240
Пробовал, это всего лиш помогает от некоторых глюков при краше сервера! Есть ли что нибудь похожие но только мощнее?
 

rusreg79

Продвинутый
Сообщения
159
Репутация
57
На одном форуме (не по autoitу) обсуждали "Cheat Engine" как он ускоряет процесс игры. Чтобы на любом компьютере, слабом или мощном, анимация проигрывалась с одинаковой скоростью, в играх есть некий таймер, который за этим делом следит, вот этим таймером и надо управлять.
 
Автор
Ganibal95

Ganibal95

GreenBytes
Сообщения
877
Репутация
240
rusreg79:
А как этим таймером управлять через автоит?)
Может кто знает?
 
Автор
Ganibal95

Ganibal95

GreenBytes
Сообщения
877
Репутация
240
Вопрос в силе =)
Если нужны длл'ки от этого самого "Cheat Engine" то Скину :smile:
 

svigelf

Знающий
Сообщения
61
Репутация
17
Cheat Engine с открытым исходным кодом... посмотри код... найди ту функцию...и разбери, как она работает
 

Arei

Скриптер
Сообщения
938
Репутация
115
я думаю что стоит работать с dll?
вот нашёл её и исходник, надо сделать только запрос к ней.
speedhack-i386.dll
исходник на Pas(Паскаль,делфи)
Код:
1 unit speedhackmain;
2	
3	{$MODE Delphi}
4	
5	
6	interface
7	uses windows, classes;
8	
9	procedure InitializeSpeedhack(speed: single); stdcall;
10	
11	type TGetTickCount=function: DWORD; stdcall;
12	type TQueryPerformanceCounter=function(var x: int64): BOOL; stdcall;
13	
14	function speedhackversion_GetTickCount: DWORD; stdcall;
15	function speedhackversion_QueryPerformanceCounter(var x: int64): BOOL; stdcall;
16	
17	//function GetTime:dword; stdcall;
18	//function NewQueryPerformanceCounter(var output: int64):BOOl; stdcall;
19	var CETick: dword;
20	    CETick64: int64;
21	
22	    PerformanceFrequency: int64;
23	    PerformanceFrequencyMS: int64;
24	    acceleration: single;
25	    sleeptime: dword;
26	    slow: boolean;
27	    tickerstopped: boolean;
28	    speedhackenabled: boolean;
29	
30	
31	   { timeGetTimeInfo:TAPiInfo;
32	    getTickcountInfo: TAPIInfo;
33	    QueryPerformanceCounterInfo: TAPIInfo;  }
34	    winmmlib,kernel32lib: thandle;
35	
36	    //5.5:
37	    confighaschanged: integer;
38	    speedmultiplier: single;
39	    realgettime: pointer;
40	    realGetTickCount: pointer;
41	    realQueryPerformanceCounter: pointer;
42	    initialoffset: dword;
43	    initialtime: dword;
44	    initialoffset64: int64;
45	    initialtime64: int64;
46	
47	implementation
48	
49	function speedhackversion_GetTickCount: DWORD; stdcall;
50	var x: dword;
51	begin
52	//also used for timeGetTime
53	  x:=TGetTickCount(realgettickcount);
54	  //time past since activation, mulitplied by speed multiplier
55	  result:=trunc((x-initialtime)*speedmultiplier)+initialoffset;
56	
57	end;
58	
59	function speedhackversion_QueryPerformanceCounter(var x: int64): BOOL; stdcall;
60	var y: int64;
61	begin
62	  x:=0;
63	  y:=0;
64	
65	//also used for timeGetTime
66	  result:=TQueryPerformanceCounter(realQueryPerformanceCounter)(y);
67	
68	  //time past since activation, mulitplied by speed multiplier
69	  x:=trunc((y-initialtime64)*speedmultiplier)+initialoffset64;
70	
71	end;
72	
73	procedure InitializeSpeedhack(speed: single); stdcall;
74	{
75	Called by createremotethread
76	}
77	var x: int64;
78	begin
79	  x:=0;
80	
81	 // messagebox(0,'called','called',mb_ok);
82	  initialoffset:=gettickcount;
83	  initialtime:=TGetTickCount(realgettickcount);
84	
85	  QueryPerformanceCounter(x);
86	  initialoffset64:=x;
87	  TQueryPerformanceCounter(realQueryPerformanceCounter)(x);
88	  initialtime64:=x;
89	
90	  speedmultiplier:=speed;
91	end;
92	
93	end.
Как написать вызов функции в dll правильно?
 

svigelf

Знающий
Сообщения
61
Репутация
17
а вот и ссылка : http://cheatengine.org/download/CheatEngine561src.rar
 

Arei

Скриптер
Сообщения
938
Репутация
115
Спасибо, разобраться бы с ними.
 

radikoactive

Новичок
Сообщения
1
Репутация
0
Получилось, что ни будь? если да скиньте пример на AutoIt
 

teges

Знающий
Сообщения
18
Репутация
16
делаем иньекцию этим dll и приходит к нам счастье :smile:, только сомнительно что это будет работать в онлайн играх
чтобы не быть голословным, так делаем иньекцию(код не мой):
Код:
;=================================================================================================
; Function:            _InjectDll($ProcessId, $DllPath)
; Description:        Injects a .dll into a running program.
; Return Value(s):    On Success - Returns true
;                    On Failure - Returns false
;                    @Error - 0 = No error.
;                             1 = Invalid ProcessId.
;                             2 = File does not exist.
;                             3 = File is not a .dll (invalid file).
;                             4 = Failed to open 'Advapi32.dll'.
;                             5 = Failed to get the full path.
;                             6 = Failed to open the process.
;                             7 = Failed to call 'GetModuleHandle'.
;                             8 = Failed to call 'GetProcAddress'.
;                             9 = Failed to call 'VirtualAllocEx'.
;                             10 = Failed to write the memory.
;                             11 = Failed to create the 'RemoteThread'.
; Author(s):        KillerDeluxe
;=================================================================================================

Func _InjectDll($ProcessId, $DllPath)
    If $ProcessId == 0 Then Return SetError(1, "", False)
    If Not(FileExists($DllPath)) Then Return SetError(2, "", False)
    If Not(StringRight($DllPath, 4) == ".dll") Then Return SetError(3, "", False)

    $Kernel32 = DllOpen("kernel32.dll")
    If @error Then Return SetError(4, "", False)

    $DLL_Path = DllStructCreate("char[255]")
    DllCall($Kernel32, "DWORD", "GetFullPathNameA", "str", $DllPath, "DWORD", 255, "ptr", DllStructGetPtr($DLL_Path), "int", 0)
    If @error Then Return SetError(5, "", False)

    $hProcess = DllCall($Kernel32, "DWORD", "OpenProcess", "DWORD", 0x1F0FFF, "int", 0, "DWORD", $ProcessId)
    If @error Then Return SetError(6, "", False)

    $hModule = DllCall($Kernel32, "DWORD", "GetModuleHandleA", "str", "kernel32.dll")
    If @error Then Return SetError(7, "", False)

    $lpStartAddress = DllCall($Kernel32, "DWORD", "GetProcAddress", "DWORD", $hModule[0], "str", "LoadLibraryA")
    If @error Then Return SetError(8, "", False)

    $lpParameter = DllCall($Kernel32, "DWORD", "VirtualAllocEx", "int", $hProcess[0], "int", 0, "ULONG_PTR", DllStructGetSize($DLL_Path), "DWORD", 0x3000, "int", 4)
    If @error Then Return SetError(9, "", False)

    DllCall("kernel32.dll", "BOOL", "WriteProcessMemory", "int", $hProcess[0], "DWORD", $lpParameter[0], "str", DllStructGetData($DLL_Path, 1), "ULONG_PTR", DllStructGetSize($DLL_Path), "int", 0)
    If @error Then Return SetError(10, "", False)

    $hThread = DllCall($Kernel32, "int", "CreateRemoteThread", "DWORD", $hProcess[0], "int", 0, "int", 0, "DWORD", $lpStartAddress[0], "DWORD", $lpParameter[0], "int", 0, "int", 0)
    If @error Then Return SetError(11, "", False)

    DllCall($Kernel32, "BOOL", "CloseHandle", "DWORD", $hProcess[0])
    DllClose($Kernel32)

    Return SetError(0, "", True)
EndFunc

осталось только откомпилировать спидхак на заданное ускорение
 

Laxe

Новичок
Сообщения
21
Репутация
1
Можно подробней, как допустим вызвать эту функцию для браузера?
 
Верх