#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>
$var1='0x0853BB08'
$var2='0x0853BB0C'
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("MyGUI", 368, 137)
$Label1 = GUICtrlCreateLabel("Шаг 1: Введи имя процесса (например, SplitSecond.exe)", 8, 8, 286, 17)
$input_process_name = GUICtrlCreateInput("", 8, 30, 185, 21)
$Label2 = GUICtrlCreateLabel("Шаг 2: Ожидание запуска игры. Запустите приложение.", 8, 56, 289, 17)
GuictrlSetState($Label2,$GUI_HIDE)
$Button_pname_ok = GUICtrlCreateButton("Принять", 200, 30, 75, 21, $WS_GROUP)
$Label3 = GUICtrlCreateLabel("Шаг 3: Получение pid и открытие памяти процесса...", 8, 80, 270, 17)
GuictrlSetState($Label3,$GUI_HIDE)
$Label4 = GUICtrlCreateLabel("Память открыта. Перехожу в режим управления через 3 секунды...", 8, 104, 348, 17)
GuictrlSetState($Label4,$GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button_pname_ok
$pname=GUICtrlRead($input_process_name)
GuictrlSetState($Label2,$GUI_SHOW)
GuictrlSetState($Button_pname_ok,$GUI_DISABLE)
ExitLoop
EndSwitch
WEnd
While 1
$pid=ProcessExists($pname)
if $pid<>0 then ExitLoop
$Msg = GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
GuictrlSetState($Label3,$GUI_SHOW)
$memory_open=_MemoryOpen($pid)
GuictrlSetState($Label4,$GUI_SHOW)
Sleep(3000)
GUIDelete($Form1)
$Form2 = GUICreate("Form1", 305, 161)
$Label1 = GUICtrlCreateLabel("Ячейка " & $var1, 8, 8, 150, 17)
$input_1 = GUICtrlCreateInput("", 8, 28, 137, 21)
$input_2 = GUICtrlCreateInput("", 176, 28, 121, 21)
$Label2 = GUICtrlCreateLabel("Ячейка " & $var2, 176, 8, 150, 17)
$button_getdata = GUICtrlCreateButton("Получить данные из игры", 8, 64, 291, 25, $WS_GROUP)
$button_setdata = GUICtrlCreateButton("Записать свои данные в игру", 8, 96, 291, 25, $WS_GROUP)
$Button_exit = GUICtrlCreateButton("Выход", 8, 128, 291, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $button_getdata
$memory_1=_MemoryRead($var1, $memory_open)
$memory_2=_MemoryRead($var2, $memory_open)
GUICtrlSetData($input_1,$memory_1)
GUICtrlSetData($input_2,$memory_2)
case $button_setdata
$input_1_data=GUICtrlRead($input_1)
$input_2_data=GUICtrlRead($input_2)
if $input_1_data='' or $input_2_data='' then
MsgBox(0,'','Введите оба значения!')
ContinueLoop
EndIf
_MemoryWrite($var1, $memory_open, $input_1_data)
_MemoryWrite($var2, $memory_open, $input_2_data)
case $Button_exit
Exit
EndSwitch
WEnd