Sign in to follow this  
Followers 0
liten

Freeze.Au3

6 posts in this topic

#1 ·  Posted (edited)

Welcome-

hi this is a UDF for people like me who always wanted to freeze value just like in Cheat engine, with an easier method, i present to you Freeze.Au3 a simple function that freezes values just liek cheat engine, this is my first UDF so ANY input would be appreciated, Good or Bad (to be honest bad news helps more, tells me what Im doing wrong so i can improve)

UPDATE: TOOK OUT SV TYPE

-Fixed some Minor Issues

-Included an Exzample

Credits:

Who ever made #Nomad-memory

Jax - reason i made this, he needed it

God - helps me excel and succed in everthing.

Functions:

_Freeze_Value()

Download:

At bottom of page

#include "Nomadmemory.au3"
;===============================================================================
; Function Name:    _Freeze_Value()
; Description:          Freezes a Value just like Cheat Engine
; Syntax:
; Parameter(s):     $Address - Address you want to freesze

;                   $ID
;                   An array containing the Dll handle and the handle
;                   of the open process as returned by _MemoryOpen()

;                   $Value - Value you want to freeze it at

;                   $sv_Type - (optional) The "Type" of value you intend to read.
;                   This is set to 'dword'(32bit(4byte) signed integer)
;                   by default.  See the help file for DllStructCreate
;                   for all types.  An example: If you want to read a
;                   word that is 15 characters in length, you would use
;                   'char[16]' since a 'char' is 8 bits (1 byte) in size.

;                   Your main While 1 loop in the Script duplicated, put into a function 
; Requirement(s):   Need #Nomadmemory, Need 2 Main while 1 one reg while one, the other func() EX.
;
;
;while 1 ---------> Main while in script
;       $nMsg = GUIGetMsg()
;   Switch $nMsg
;   Case $GUI_EVENT_CLOSE
;       SoundPlay (@HomeDrive& "\Windows\System\t1alarm.wav")   
;           Exit
;Endswitch
;WEnd
;
;Func While -------->While 1 loop duplicated, into a function (this is the one that  = $mainloop, without the ()),  (you must have Both)
;       $nMsg = GUIGetMsg()
;   Switch $nMsg
;   Case $GUI_EVENT_CLOSE
;           Exit
;EndSwitch
;EndFunc

; Return Value(s):  Success = Freezes Value
; Author(s):   Liiten \ tri407tiny
; Modification(s):
;===============================================================================
Func _Freeze_Value($ID, $Address, $value, $mainloop)
    SetPrivilege("SeDebugPrivilege", 1)
    $M1 = _Memoryread($Address)
    if $M1 <> $Value then 
        while 1
        _memorywrite($ID, $address, $Value)
        $mainloop ()
        WEnd
    EndIf
EndFunc

Exzample:

;ExZample
;#Include "Freeze.au3"
;Func FreezeRunSpeed()
;$Loop = Loop()
;$ID = _MemoryOpen(ProcessExists("Game.exe"))
;$Runspeed  = 0x000000
;_Freeze_Value( $ID, $Runspeed, 2000, $Loop)
;EndIf


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

;func Loop()
;$nMsg = GUIGetMsg()
;Switch $nMsg
;Case $GUI_EVENT_CLOSE
;Exit
;EndSwitch
;EndFunc

Freeze.au3

Edited by liten

My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

Share this post


Link to post
Share on other sites



Please, Comment, need advice on my wrongs if any


My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Please, Comment, need advice on my wrongs if any

Well, to start it's Example instead of ExZample.

Second: Have you even tested the script?

I don't think this will run:

$mainloop ()

Based on this it's pretty sure you didn't test at all:

$Loop = Loop()
_Freeze_Value( $ID, $Runspeed, 2000, $Loop)

Because $Loop doesn't return anything, and you are trying to call Loop again in the function like this:

$Loop();

....

Edited by Kip

Share this post


Link to post
Share on other sites

$M1 = _Memoryread($Address)

There is a second parameter for Nomad's _MemoryRead function.

Share this post


Link to post
Share on other sites

duid some modifications, tested, and works, will upload soon, off to church


My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

Share this post


Link to post
Share on other sites

how to use with muti pointers?

#include <MemoryConstants.au3>
#include <NomadMemory.au3>
SetPrivilege("SeDebugPrivilege", 1)
HotKeySet('{ESC}', '_TerminateLoop')

$pid = ProcessExists("Tutorial.exe") ;Step 8: Multilevel pointers: (PW=525927)

Global $fLoop = True
Global $Offset1[5]
$Offset1[0] = 0 ; Is ALWAYS 0.
$Offset1[1] = Dec("c")
$Offset1[2] = Dec("14")
$Offset1[3] = Dec("0")
$Offset1[4] = Dec("18")

$StaticOffset = Dec("60c20")

$openmem = _MemoryOpen($pid) ; Open the memory
$baseADDR = _MemoryGetBaseAddress($openmem, 1)
$finalADDR = "0x" & Hex($baseADDR + $StaticOffset) ; Creates the final static address you read from.

$Value = _MemoryPointerRead($finalADDR, $openmem, $Offset1)
ConsoleWrite ( "Address = " & $Value[0] & @CRLF & "Value = " & $Value[1] & @CRLF)

; Click change pointer and press Esc before 3 seconds passes away. :)
While $fLoop
    Sleep(10)
WEnd

$Value = _MemoryPointerRead($finalADDR, $openmem, $Offset1)
ConsoleWrite ( "Address = " & $Value[0] & @CRLF & "Value = " & $Value[1] & @CRLF)
_MemoryWrite($Value[0], $openmem, 5000)
_MemoryClose($openmem)


Func _TerminateLoop()
    $fLoop = False
EndFunc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0