Need help :S AutoIT Trainer doesnt work

02/19/2014 15:06 SplitEditing#1
Hey,


[Only registered and activated users can see links. Click Here To Register...]



This is what my trainer looks like. It only has currently 1 adress which is static.


The problem with this is, that it wont work.


I start the game and try to change the value (Its working in CE and CE Debugger.)

But everytime when i start this hack, it wont change the value.
(I can see in CE that its not changing.)


Please help me :S


Thanks!
Split
02/19/2014 15:14 alpines#2
No shit, of course it won't work. You're sleeping over and over again if the process is there. Instead of that you should use
Code:
While Not ProcessExists("MicroVolts.exe")
Sleep(100)
WEnd
02/19/2014 15:15 SplitEditing#3
Quote:
Originally Posted by alpines View Post
No shit, of course it won't work. You're sleeping over and over again if the process is there. Instead of that you should use
Code:
While Not ProcessExists("MicroVolts.exe")
Sleep(100)
WEnd
Oh :D I failed that one :D


I will test in 1 min thanks! ;)

Still not working :S
02/19/2014 15:38 lolkop#4
Quote:
Originally Posted by alpines View Post
No shit, of course it won't work. You're sleeping over and over again if the process is there. Instead of that you should use
Code:
While Not ProcessExists("MicroVolts.exe")
Sleep(100)
WEnd
or use the function which does exactly that:
Code:
ProcessWait("MicroVolts.exe")
02/19/2014 16:23 SplitEditing#5
Quote:
Originally Posted by lolkop View Post
or use the function which does exactly that:
Code:
ProcessWait("MicroVolts.exe")
Thanks, but its still not working :S
02/19/2014 16:57 mlukac89#6
Try this

Code:
#RequireAdmin
#include <NomadMemory.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$Form1 = GUICreate("Form1", 276, 51, 192, 124)
$Input1 = GUICtrlCreateInput("Enter new speed !", 16, 16, 121, 21)
$Button1 = GUICtrlCreateButton("Change speed !", 144, 16, 121, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			; check if process is running
			If ProcessExists("MicroVolts.exe") Then
				_hack()
			Else 
				; if process is not running show error message
				MsgBox(0, "Error", "Process not exists")
			EndIf

	EndSwitch
WEnd

Func _hack()
	$Open = _MemoryOpen(ProcessExists("MicroVolts.exe"))
	$Adresse = 0x00FFEA10
	$Read = _MemoryRead($Adresse, $Open, 'Float')
	$Write = _MemoryWrite($Adresse, $Open, GUICtrlRead($Input1), 'Float') ; GUICtrlRead($Input1) - reads data you enter from input field
EndFunc
02/19/2014 17:27 SplitEditing#7
Quote:
Originally Posted by mlukac89 View Post
Try this

Code:
#RequireAdmin
#include <NomadMemory.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

$Form1 = GUICreate("Form1", 276, 51, 192, 124)
$Input1 = GUICtrlCreateInput("Enter new speed !", 16, 16, 121, 21)
$Button1 = GUICtrlCreateButton("Change speed !", 144, 16, 121, 25)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			; check if process is running
			If ProcessExists("MicroVolts.exe") Then
				_hack()
			Else 
				; if process is not running show error message
				MsgBox(0, "Error", "Process not exists")
			EndIf

	EndSwitch
WEnd

Func _hack()
	$Open = _MemoryOpen(ProcessExists("MicroVolts.exe"))
	$Adresse = 0x00FFEA10
	$Read = _MemoryRead($Adresse, $Open, 'Float')
	$Write = _MemoryWrite($Adresse, $Open, GUICtrlRead($Input1), 'Float') ; GUICtrlRead($Input1) - reads data you enter from input field
EndFunc
Thanks!

But it still doesnt work o.O
02/19/2014 17:33 mlukac89#8
What dont work ? Memory ?

Try to comment this line
Code:
 ; $Read = _MemoryRead($Adresse, $Open, 'Float')
U dont need to read memory just write

Try this code i maded you to read data in label so u can see current speed too but if it dont show then is problem with your base adress

Code:
#RequireAdmin
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <NomadMemory.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 197, 131, 231, 167)
$Label1 = GUICtrlCreateLabel("Current speed : ", 8, 8, 79, 17)
$currentSpeed = GUICtrlCreateLabel("", 88, 8, 68, 17)
$Input1 = GUICtrlCreateInput("", 96, 37, 89, 21)
$Label2 = GUICtrlCreateLabel("Enter new speed", 8, 40, 84, 17)
$Button1 = GUICtrlCreateButton("Start", 8, 72, 179, 49)
GUICtrlSetFont(-1, 11, 800, 0, "Verdana")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $Adresse = 0x00FFEA10 ; base adress

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $Button1
			; check if process is running
			If ProcessExists("MicroVolts.exe") Then
				_hack()
			Else
				; if process is not running show error message
				MsgBox(0, "Error", "Process not exists")
			EndIf

	EndSwitch

	_read() ; read data in GUI

WEnd

Func _hack()
	$Open = _MemoryOpen(ProcessExists("MicroVolts.exe"))
	$Write = _MemoryWrite($Adresse, $Open, GUICtrlRead($Input1), 'Float')
EndFunc

Func _read()
	$Open = _MemoryOpen(ProcessExists("MicroVolts.exe"))
	$Read = _MemoryRead($Adresse, $Open, 'Float')
	GUICtrlSetData($currentSpeed, $Read)
EndFunc
02/19/2014 17:51 YatoDev#9
do you get an error ?
Mayby try 0xFFEA10 and not 0x00FFEA10
02/19/2014 18:06 lolkop#10
you might try to cut out the crap and use a simple errorhandling instead...
Code:
GUICreate("gui", 276, 51, Default, Default, 0x10C80000)
$input = GUICtrlCreateInput("Enter new speed!", 16, 16, 121, 21)
$btn = GUICtrlCreateButton("Change speed!", 144, 16, 121, 25)

While True
	Switch GUIGetMsg()
		Case -3
			Exit
		Case $btn
			$handle = OpenProcess(ProcessExists("MicroVolts.exe"))
			WriteProcessMemory($handle, 0xFFEA10, 400, "float")
			CloseHandle($handle)
	EndSwitch
WEnd

Func OpenProcess($pid)
	Local $x = DllCall('kernel32.dll', 'int', 'OpenProcess', 'int', 0x1F0FFF, 'int', 1, 'int', $pid)
	Local $e = GetLastError()
	If $e<>0 Then MsgBox(16, "Error", "OpenProcess("&$pid&")"&@CRLF&"Error: "&$e)
	Return $x[0]
EndFunc

Func WriteProcessMemory($process_hwnd, $adress, $data, $type = 'binary')
	Local $struct= DllStructCreate($type)
	DllStructSetData($struct, 1, $data)
	DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $process_hwnd, 'int', $adress, 'int', DllStructGetPtr($struct), 'int', DllStructGetSize($struct), 'int', 0)
	Local $e = GetLastError()
	If $e<>0 Then MsgBox(16, "Error", "WriteProcessMemory("&$process_hwnd&', 0x'&Hex($adress)&', '&$data&', '&$type&")"&@CRLF&"Error: "&$e)
EndFunc

Func CloseHandle($hwnd)
	DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $hwnd)
	Local $e = GetLastError()
	If $e<>0 Then MsgBox(16, "Error", "CloseHandle("&$hwnd&")"&@CRLF&"Error: "&$e)
EndFunc

Func GetLastError()
	Local $x = DllCall('kernel32.dll', 'int', 'GetLastError')
	Return $x[0]
EndFunc
Edit:
Error infos are listed here: [Only registered and activated users can see links. Click Here To Register...]
03/02/2014 13:18 Binaric#11
Wow, never seen so much unnecessary code...

it only takes 7 lines of code to make this work
03/02/2014 13:22 TheΚυριαρ#12
While Not ProcessExists("MicroVolts.exe")
WEnd
03/02/2014 13:43 alpines#13
Quote:
Originally Posted by TheΚυριαρ View Post
While Not ProcessExists("MicroVolts.exe")
WEnd
Quote:
Originally Posted by alpines View Post
No shit, of course it won't work. You're sleeping over and over again if the process is there. Instead of that you should use
Code:
While Not ProcessExists("MicroVolts.exe")
Sleep(100)
WEnd
You know that this was posted much earlier? You're just post hunting.
03/02/2014 17:46 lolkop#14
Quote:
Originally Posted by Binaric View Post
Wow, never seen so much unnecessary code...

it only takes 7 lines of code to make this work
so prove your statement by posting an errorhandling code for writing other processes memory, including a simple gui, in 7 lines of code... <.<