Sign in to follow this  
Followers 0
sandor555

simple problem

9 posts in this topic

#RequireAdmin
#include <GUIConstants.au3>
#include <NomadMemory.au3>



#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 235, 114, 193, 125)
$label1 = GUICtrlCreateLabel("DMG Hack", 16, 32, 58, 17)
$dmg = GUICtrlCreateInput("Value", 88, 32, 121, 21)
$setdmg = GUICtrlCreateButton("Set !", 16, 64, 163, 33, 0)
GUISetState(@SW_SHOW)

Global $Pointer = 0x00686D04
Global $Open = _MemoryOpen(ProcessExists("TClient.exe"))
Global $Offset[3] = [0, 0xa08, 0x484]
Global $Bedingung = 0

While 1
   $nMsg = GUIGetMsg()
      Switch $nMsg
         Case $GUI_EVENT_CLOSE
            Exit
         Case $setdmg
            If $Bedingung = 0 Then
               $Bedingung = 1
            ElseIf $Bedingung = 1 Then
               $Bedingung = 0
            EndIf
      EndSwitch

SetDmg()
WEnd

Func SetDmg()
   If $Bedingung = 1 Then _memorypointerwrite ($Pointer, $Open, $Offset, GUICtrlRead($dmg))
EndFunc

error code:

C:\Documents and Settings\myname\Asztal\5.au3(35,91) : ERROR: _memorypointerwrite(): undefined function.

If $Bedingung = 1 Then _memorypointerwrite ($Pointer, $Open, $Offset, GUICtrlRead($xy))

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Tóth Sándor\Asztal\5.au3 - 1 error(s), 0 warning(s)

What's wrong?

Share this post


Link to post
Share on other sites



ERROR: _memorypointerwrite(): undefined function.

You trying to use a function that is not defined, is this _memorypointerwrite() written exactly as it is in the include file.

Have you put the right #include <......> at the top of your script that contains this function.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

I do not understand.Would you write into my code?Maybe I understand it:)

(I'm sorry, I speak a little English)

Share this post


Link to post
Share on other sites

no,i am from hungary :mellow:

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

#RequireAdmin
#include <GUIConstants.au3>
#include <NomadMemory.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 235, 114, 193, 125)
$label1 = GUICtrlCreateLabel("DMG Hack", 16, 32, 58, 17)
$dmg = GUICtrlCreateInput("Value", 88, 32, 121, 21)
$setdmg = GUICtrlCreateButton("Set !", 16, 64, 163, 33, 0)
GUISetState(@SW_SHOW)

Global $Pointer = 0x00686D04
Global $Open = _MemoryOpen(ProcessExists("TClient.exe"))
Global $Offset[3] = [0, 0xa08, 0x484]
Global $Bedingung = 0

While 1
 $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $setdmg
    If $Bedingung = 0 Then
    $Bedingung = 1
    ElseIf $Bedingung = 1 Then
    $Bedingung = 0
    EndIf
    EndSwitch

SetDmg()
WEnd

Func SetDmg()
 If $Bedingung = 1 Then _memorypointerwrite ($Pointer, $Open, $Offset, GUICtrlRead($dmg))
EndFunc

;=================================================================================================
; Function: _MemoryPointerWrite ($iv_Address, $ah_Handle, $av_Offset, $v_Data[, $sv_Type])
; Description:  Reads a chain of pointers and writes the data to the destination address.
; Parameter(s): $iv_Address - The static memory address you want to start at. It must be in
;   hex format (0x00000000).
;   $ah_Handle - An array containing the Dll handle and the handle of the open
;   process as returned by _MemoryOpen().
;   $av_Offset - An array of offsets for the pointers. Each pointer must have an
;   offset. If there is no offset for a pointer, enter 0 for that
;   array dimension.
;   $v_Data - The data to be written.
;   $sv_Type - (optional) The "Type" of data you intend to write at the destination
;   address. This is set to 'dword'(32bit(4byte) signed integer) by
;   default. See the help file for DllStructCreate for all types.
; Requirement(s): The $ah_Handle returned from _MemoryOpen.
; Return Value(s): On Success - Returns the destination address.
;   On Failure - Returns 0.
;   @Error - 0 = No error.
;   1 = $av_Offset is not an array.
;   2 = Invalid $ah_Handle.
;   3 = Failed to read from the specified process.
;   4 = $sv_Type is not a string.
;   5 = $sv_Type is an unknown data type.
;   6 = Failed to allocate the memory needed for the DllStructure.
;   7 = Error allocating memory for $sv_Type.
;   8 = $v_Data is not in the proper format to be used with the
;   "Type" selected for $sv_Type, or it is out of range.
;   9 = Failed to write to the specified process.
; Author(s):    Nomad
; Note(s):  Data written is in Decimal format, unless a 'char' type is selected.
;   Set $av_Offset like this:
;   $av_Offset[0] = NULL (not used, doesn't matter what's entered)
;   $av_Offset[1] = Offset for pointer 1 (all offsets must be in Decimal)
;   $av_Offset[2] = Offset for pointer 2
;   etc...
;   (The number of array dimensions determines the number of pointers)
;=================================================================================================
Func _MemoryPointerWrite ($iv_Address, $ah_Handle, $av_Offset, $v_Data, $sv_Type = 'dword')

    If IsArray($av_Offset) Then
    If IsArray($ah_Handle) Then
    Local $iv_PointerCount = UBound($av_Offset) - 1
    Else
    SetError(2)
    Return 0
    EndIf
    Else
    SetError(1)
    Return 0
    EndIf

    Local $iv_StructData, $i
    Local $v_Buffer = DllStructCreate('dword')

    For $i = 0 to $iv_PointerCount
    If $i = $iv_PointerCount Then
    $v_Buffer = DllStructCreate($sv_Type)
    If @Error Then
    SetError(@Error + 3)
    Return 0
    EndIf

    DllStructSetData($v_Buffer, 1, $v_Data)
    If @Error Then
    SetError(8)
    Return 0
    EndIf

    $iv_Address = '0x' & hex($iv_StructData + $av_Offset[$i])
    DllCall($ah_Handle[0], 'int', 'WriteProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If @Error Then
    SetError(9)
    Return 0
    Else
    Return $iv_Address
    EndIf
    ElseIf $i = 0 Then
    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If @Error Then
    SetError(3)
    Return 0
    EndIf

    $iv_StructData = DllStructGetData($v_Buffer, 1)

    Else
    $iv_Address = '0x' & hex($iv_StructData + $av_Offset[$i])
    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If @Error Then
    SetError(3)
    Return 0
    EndIf

    $iv_StructData = DllStructGetData($v_Buffer, 1)

    EndIf
    Next

EndFunc

Took from here: _MemoryPointerWrite()

BR,

UEZ

PS: Bedingung means condition :mellow:

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

ah okay. Well, it's a pretty straightforward process; you have told your script to do something if a certain thing happens:

Func SetDmg()
 If $Bedingung = 1 Then _memorypointerwrite ($Pointer, $Open, $Offset, GUICtrlRead($dmg))
EndFunc

In this case a function called "_memorypointerwrite"

This function has to be setup just like "Func SetDmg()" is.

or included as a UDF (User Defined Function)

And this is why your script is giving you this error:

C:\Documents and Settings\myname\Asztal\5.au3(35,91) : ERROR: 
_memorypointerwrite(): undefined function.

If $Bedingung = 1 Then _memorypointerwrite ($Pointer, $Open, $Offset, 
GUICtrlRead($xy))

Share this post


Link to post
Share on other sites

Thanks billo,UEZ

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