Jump to content

pattern using AutoIT


 Share

Recommended Posts

Hi, i have really problem using pattern in autoit and i dont know what is the problem.. my script is:

#RequireAdmin
#include<NomadMemory.au3>
Global Const $Pattern = "\x83\xC2\xFC\x89\x15\x00\x00\x00\x00"
Global Const $Mask = "xxxxx????"

Global $HPID =_MemoryOpen(ProcessExists("NostaleX.dat"))
Global $Basepointer_Player=_MemoryScanEx($HPID,$Pattern,$Mask)
FileWrite("omgh.txt", $Basepointer_Player)
Func _MemoryScanEx($ah_Handle, $pattern, $mask , $after = False, $iv_addrStart = 0x00400000, $iv_addrEnd = 0x00FFFFFF, $step = 51200)
If Not IsArray($ah_Handle) Then
     SetError(1)
     Return -1
EndIf
$pattern = StringRegExpReplace($pattern, "[^0123456789ABCDEFabcdef.]", "")
If StringLen($pattern) = 0 Then
     SetError(2)
     Return -2
EndIf
If Stringlen($pattern)/2 <> Stringlen($mask) Then
     SetError(4)
     Return -4
EndIf
Local $formatedpattern=""
Local $BufferPattern
Local $BufferMask
for $i = 0 to stringlen($mask)-1
     $BufferPattern = StringLeft($pattern,2)
     $pattern = StringRight($pattern,StringLen($pattern)-2)
     $BufferMask = StringLeft($mask,1)
     $mask = StringRight($mask,StringLen($mask)-1)
     if $BufferMask = "?" then $BufferPattern = ".."
     $formatedpattern = $formatedpattern&$BufferPattern
Next
$pattern = $formatedpattern
For $addr = $iv_addrStart To $iv_addrEnd Step $step - (StringLen($pattern) / 2)
     StringRegExp(_MemoryRead($addr, $ah_Handle, "byte[" & $step & "]"), $pattern, 1, 2)
     If Not @error Then
         If $after Then
             Return StringFormat("0x%.8X", $addr + ((@extended - 2) / 2))
         Else
             Return StringFormat("0x%.8X", $addr + ((@extended - StringLen($pattern) - 2) / 2))
         EndIf
     EndIf
Next
Return -3
EndFunc ;==>_MemoryScanEx

I dont know the problem on *.txt file dont appare the addres. I know that some people or all people dont have the game but if you know the function you can help me without it :D

Link to comment
Share on other sites

  • Moderators

Userfull,

Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum Rules on your way in. Please read them now - particularly the bit about not discussing game interaction - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...