Userfull Posted October 29, 2012 Share Posted October 29, 2012 Hi, i have really problem using pattern in autoit and i dont know what is the problem.. my script is: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 29, 2012 Moderators Share Posted October 29, 2012 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. See you soon with a legitimate question I hope. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts