Vivi

Anti Memory dump ?

9 posts in this topic

Hey dear community,

i write alot of programs that i sell.

i coded a sucessfull license system but sadly i have no protection against memory dumps.

 

i already tried playing with "memory.au3" but failed at it.

#include <WinAPI.au3>
#include <Memory.au3>
#include <NoMadMemory.au3>
$Mem_Open = _MemoryOpen(@AutoItPID)
$baseAddress = _WinAPI_GetModuleHandle(0)
_MemVirtualAlloc($Mem_Open, BinaryLen($Mem_Open), $MEM_COMMIT, $PAGE_GUARD)

 

anyone has a idea how i can call use page guard ?

 

Thanks

Share this post


Link to post
Share on other sites



Many products have tried but all fail in this regard, particularly in situations where someone knows what they are doing.

Sorry Vivi but that's just the way of it.

Vlad

Share this post


Link to post
Share on other sites

Many products have tried but all fail in this regard, particularly in situations where someone knows what they are doing.

Sorry Vivi but that's just the way of it.

Vlad

i already found a method on how to stop decompilers do there job.

bypassed sniffers and co

 

are you sure there is no way to use page guard's or any other method to prevent memory dumps ?

Share this post


Link to post
Share on other sites

Who's talking about decompilation?

(despite you bold and incorrect assumption regarding this long term)

We (or rather you) are talking about memory, the weakpoint of every application to date.

Am I saying implementing page guard is Impossible? No not really, and hopefully someone will at least help you do this much to put you in a false sense of security mindset short term so you can continue developing your content without worrying where the holy grail has been stashed.

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

No, no you have not.

i have no protection against memory dumps.

There's the evidence.

add "#end region" in the first line.

 

 

Edited by Vivi

Share this post


Link to post
Share on other sites

That is not the only decompiler, and it will not protect a script against decompilation.

If it did, you would not be here looking for a solution.

Plenty get the script from memory at runtime. you cannot stop that.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

@Vivi please remove the name of the decompiler in post 6 and use something like "memory based or focused decompiler".
 
As JohnOne has stated it isn't the only one these days so there is no real need to reference any single one by name.
 
Edited by Mobius

Share this post


Link to post
Share on other sites

Hi,

This thread has now gone beyond the limits - locked.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • c.haslam
      By c.haslam
      The cDebug script includes 3 debugging UDFs: _MsgDebug(), _ConsDebug() and _ClipDebug(). They all dump the values of scalars, vectors, constants and 2-D arrays, and report variables that are Objects and DLLStructs. As indicated by their names, they dump to a message box, to the SciTE console, and to the Clipboard respectively.
      The UDFs are also able to dump portions of vectors and rectangular portions of arrays.
      The format for calling the UDFs has been designed to make coding a call as convenient as possible, minimizing coding effort and the chances of errors: the $name argument is often the same as the variables arguments, enclosed in quote marks.
      #include-once #include <GuiConstants.au3> #include <GuiListView.au3> #include <StringConstants.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars",1) ; Documentation: _cDebug.pdf ; Version 1.0.0 ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ConsDebug ; Description ...: Dumps the value of variables and expressions to the Console ; Syntax ........: _ConsDebug($location, $names,$val1[[[[[[[[[[[[[[[[[, $val2 = Default], $val3 = Default], _ ; $val4 = Default], $val5 = Default], $val6 = Default], $val7 = Default], $val8 = Default], _ ; $val9 = Default], $val10 = Default], $val11 = Default], $val12 = Default] _ ; [, $val13 = Default], $val14 = Default], $val15 = Default], $val16 = Default], _ ; $val17 = Default], $val18 = Default], $val19 = Default]) ; Parameters ....: $location - a string: title ; If ^ is in the string, the dump is also sent to the Clipboard ; $names - comma-separted names to be shown in the dump, one per value ; If | is the first character, dumped strings start and end with ; Char(166), a broken bar ; '[controls][<title>:]name1,name2, ...' ; $val1 - a variant value. ; $val2 thru $val19 - [optional] a variant value. Default is not used ; Return values .: None ; Author ........: c.haslam at ieee dot org ; Modified ......: ; Remarks .......See _cDebug.pdf for details of functionality ; Related .......: _MsgDebug,_ClipDebug ; Link ..........: ; Example .......: _ConsDebug('Line '&@ScriptLineNumber','$bInt,$ar,StringInStr($str,":")',$bInt,$ar,StringInStr($str,':')) ; =============================================================================================================================== Func _ConsDebug($location,$names,$val1,$val2=Default,$val3=Default,$val4=Default,$val5=Default,$val6=Default,$val7=Default,$val8=Default _ ,$val9=Default,$val10=Default,$val11=Default,$val12=Default,$val13=Default,$val14=Default,$val15=Default,$val16=Default,$val17=Default, _ $val18=Default,$val19=Default) Local $bToClipboard = StringInStr($location,'^')<>'' If $bToClipboard Then $location = StringReplace($location,'^','') ; all EndIf Local $t = '***'&$location&'-------------------------'&@CRLF& _ _FormatValsForDebug($location,$names,$val1,$val2,$val3,$val4,$val5,$val6,$val7,$val8, _ $val9,$val10,$val11,$val12,$val13,$val14,$val15,$val16,$val17,$val18,$val19) ConsoleWrite($t) If $bToClipboard Then _UpdateClipboard($t) EndIf EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _ClipDebug ; Description ...: Dumps the value of variables and expressions to the Clipboard ; Syntax ........: _ClipDebug($location, $names,$val1[[[[[[[[[[[[[[[[[, $val2 = Default], $val3 = Default], _ ; $val4 = Default], $val5 = Default], $val6 = Default], $val7 = Default], $val8 = Default], _ ; $val9 = Default], $val10 = Default], $val11 = Default], $val12 = Default] _ ; [, $val13 = Default], $val14 = Default], $val15 = Default], $val16 = Default], _ ; $val17 = Default], $val18 = Default], $val19 = Default]) ; Parameters ....: $location - a string: title ; If ^ is in the string, it is ignored ; $names - comma-separted names to be shown in the dump, one per value ; If | is the first character, dumped strings start and end with ; Char(166), a broken bar ; '[controls][<title>:]name1,name2, ...' ; $val1 - a variant value. ; $val2 thru $val19 - [optional] a variant value. Default is not used ; Return values .: None ; Author ........: c.haslam at ieee dot org ; Modified ......: ; Remarks .......: See _ConsDebug() ; Related .......: _MsgDebug,_ConsDebug ; Link ..........: ; Example .......: _ClipDebug('Line '&@ScriptLineNumber&','$bInt,$ar,StringLen($str)',$bInt,$ar,StringILen($str)) ; =============================================================================================================================== Func _ClipDebug($location,$names,$val1,$val2=Default,$val3=Default,$val4=Default,$val5=Default,$val6=Default,$val7=Default,$val8=Default _ ,$val9=Default,$val10=Default,$val11=Default,$val12=Default,$val13=Default,$val14=Default,$val15=Default,$val16=Default,$val17=Default, _ $val18=Default,$val19=Default) $location = StringReplace($location,'^','') ; all Local $t = '***'&$location&'-------------------------'&@CRLF& _ _FormatValsForDebug($location,$names,$val1,$val2,$val3,$val4,$val5,$val6,$val7,$val8, _ $val9,$val10,$val11,$val12,$val13,$val14,$val15,$val16,$val17,$val18,$val19) _UpdateClipboard($t) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MsgDebug ; Description ...: Dumps the value of variables and expressions to the Console ; Syntax ........: _MsgDebug($location, $names,$val1[[[[[[[[[[[[[[[[[, $val2 = Default], $val3 = Default], _ ; $val4 = Default], $val5 = Default], $val6 = Default], $val7 = Default], $val8 = Default], _ ; $val9 = Default], $val10 = Default], $val11 = Default], $val12 = Default] _ ; [, $val13 = Default], $val14 = Default], $val15 = Default], $val16 = Default], _ ; $val17 = Default], $val18 = Default], $val19 = Default]) ; Parameters ....: $location - a string: title ; If ^ is in the string, the dump is also sent to the Clipboard ; $names - comma-separted names to be shown in the dump, one per value ; If | is the first character, dumped strings start and end with ; Char(166), a broken bar ; '[controls][<title>:]name1,name2, ...' ; $val1 - a variant value. ; $val2 thru $val19 - [optional] a variant value. Default is not used ; Return values .: None ; Author ........: c.haslam at ieee dot org ; Modified ......: See _ConsDebug() ; Remarks .......: See _ConsDebug() ; Related .......: _MsgDebug, _ClipDebug ; Link ..........: ; Example .......: _MsgDebug('Line '&@ScriptLineNumber&':'$bInt,$ar,StringLen($str)',$bInt,$ar,StringLen($str)) ; =============================================================================================================================== Func _MsgDebug($location,$names,$val1,$val2=Default,$val3=Default,$val4=Default,$val5=Default,$val6=Default,$val7=Default,$val8=Default _ ,$val9=Default,$val10=Default,$val11=Default,$val12=Default,$val13=Default,$val14=Default,$val15=Default,$val16=Default,$val17=Default, _ $val18=Default,$val19=Default) Local $bToClipboard = StringInStr($location,'^')<>'' If $bToClipboard Then $location = StringReplace($location,'^','') ; all EndIf Local $t = _FormatValsForDebug($location,$names,$val1,$val2,$val3,$val4,$val5,$val6,$val7,$val8, _ $val9,$val10,$val11,$val12,$val13,$val14,$val15,$val16,$val17,$val18,$val19) MsgBox($MB_SETFOREGROUND,$location,$t) If $bToClipboard Then _UpdateClipboard('***'&$location&'-------------------------'&@CRLF&$t) EndIf EndFunc Func _FormatValsForDebug($location,$names,$val1,$val2=Default,$val3=Default,$val4=Default,$val5=Default,$val6=Default,$val7=Default,$val8=Default _ ,$val9=Default,$val10=Default,$val11=Default,$val12=Default,$val13=Default,$val14=Default,$val15=Default,$val16=Default,$val17=Default, _ $val18=Default,$val19=Default) Local $idents = $location&':'&$names Local $stringDelim = '"' Local $indent = ' ' If StringLeft($names,1)='|' Then $stringDelim = Chr(166) ; broken bar $names = StringMid($names,2) $indent = '| ' EndIf Local $buf="",$ar,$i,$j,$k,$n,$p,$s Local $nParLvl=0,$bInBrs=False For $i = 1 to StringLen($names) Switch StringMid($names,$i,1) Case '(' $nParlvl += 1 Case ')' $nParLvl -= 1 Case '[' If $bInBrs Then MsgBox($MB_ICONERROR,'cDebug','Level of square bracketing is limited to one' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf $bInBrs = True Case ']' If Not $bInBrs Then MsgBox($MB_ICONERROR,'cDebug','] encountered but there is no square bracked to close' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf $bInBrs = False Case ',' If $nParLvl>0 Or $bInBrs Then $names = StringLeft($names,$i-1)&Chr(164)&StringMid($names,$i+1) EndIf EndSwitch Next If $nParLvl>0 Then MsgBox($MB_ICONERROR,'cDebug','Extra left parenthesis or missing right parenthesis' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit ElseIf $nParlvl<0 Then MsgBox($MB_ICONERROR,'cDebug','Extra right parenthesis or missing left parenthesis' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf If $bInBrs Then MsgBox($MB_ICONERROR,'cDebug','Extra left square bracket or missing right square bracket' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf If StringLeft($names,1)=',' Then $names = StringMid($names,2) ; tolerate leading comma If $names="" Then MsgBox($MB_ICONERROR,'cDebug','Variable names are missing' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf Local $namesVec = StringSplit($names, ",") ; 1-based For $i = 1 to $namesVec[0] $namesVec[$i] = StringReplace($namesVec[$i],Chr(164),',') Next Local $valsVec[@NumParams+2] Local $t,$s $i = 1 While True $valsVec[$i] = Eval('val'&$i) If $valsVec[$i]=Default Then ExitLoop $i += 1 If $i>@NumParams Then ExitLoop WEnd ReDim $valsVec[$i] ; ref 1 If UBound($valsVec)<>UBound($namesVec) Then $s = StringReplace($names,Chr(164),',') If UBound($valsVec)>UBound($namesVec) Then $t = 'There are more value arguments than identifiers, so values of some identifiers will not be reported' $t &= @CRLF&@CRLF&'Identifiers: '&$s MsgBox($MB_ICONWARNING,'cDebug()',$t) ElseIf UBound($valsVec)<UBound($namesVec) Then $t = 'There are more identifiers than value arguments' $t &= @CRLF&@CRLF&'Identifiers: '&$s MsgBox($MB_ICONERROR,'cDebug()',$t) Exit EndIf EndIf For $i = 1 To $namesVec[0] $ar = $valsVec[$i] If IsArray($ar) Then Switch UBound($ar,0) Case 2 Local $brsVec = StringSplit($namesVec[$i],'[]',0+2) ; char,0-based Local $qRows = UBound($ar, 1) Local $qCols = UBound($ar, 2) If UBound($brsVec)=1 Then ; if no [] Local $wid = StringLen('['&($qRows-1)&']['&($qCols-1)&']') ; 2015-06-11 $buf &= $namesVec[$i]&' Array: Ubounds '&$qRows&','&$qCols&@CRLF For $j = 0 To $qRows-1 For $k = 0 To $qCols-1 If IsArray( $ar[$j][$k]) Then $buf &= "["&$j&"]["&$k&"]"&@CRLF&_FormatValsForDebug($location,$indent,$ar[$j][$k]) Else $n = $ar[$j][$k] If IsString($n) Then $n = $stringDelim&$n&$stringDelim $buf &= $namesVec[$i] & StringFormat('%-'&$wid&'s', "["&$j&"]["&$k&"]")&" "&$n & @CRLF EndIf Next Next Else If UBound($ar,1)=0 Or UBound($ar,2)=0 Then $buf &= $brsVec[0]&' Array: Ubounds '&UBound($ar,1)&','&UBound($ar,2)&@CRLF ContinueLoop EndIf Local $qRows = UBound($ar,1)-1 Local $qCols = UBound($ar,2)-1 Local $rowIxsVec[0],$evaledRowIxsVec[0] _DoIndicesDebug($idents,$brsVec[1],$qRows,'row',$namesVec[$i],$namesVec,$valsVec, $rowIxsVec, _ $evaledRowIxsVec) Local $colIxsVec[0],$evaledcolIxsVec[0] _DoIndicesDebug($idents,$brsVec[3],$qCols,'column',$namesVec[$i],$namesVec,$valsVec, $colIxsVec, _ $evaledcolIxsVec) $buf &= $namesVec[$i]&' Array: Ubounds '&($qRows+1)&','&($qCols+1)&@CRLF Local $rowWid,$colWid If $brsVec[1]='..' Then $rowWid = StringLen($qRows) Else $rowWid = 0 For $j = 0 To UBound($rowIxsVec)-1 $n = StringLen($rowIxsVec[$j]) If $n>$rowWid Then $rowWid = $n $n = StringLen($evaledrowIxsVec[$j]) If $n>$rowWid Then $rowWid = $n Next EndIf If $brsVec[3]='..' Then $colWid = StringLen($qcols) Else $colWid = 0 For $j = 0 To UBound($colIxsVec)-1 $n = StringLen($colIxsVec[$j]) If $n>$colWid Then $colWid = $n $n = StringLen($evaledcolIxsVec[$j]) If $n>$colWid Then $colWid = $n Next EndIf Local $wid = $rowWid+$colWid+StringLen('[][]') Local $nRow,$sRow,$nCol,$sCol For $j = 0 To UBound($evaledRowIxsVec)-1 $nRow = $evaledRowIxsVec[$j] $sRow = $rowIxsVec[$j] For $k = 0 To UBound($evaledcolIxsVec)-1 $nCol = $evaledColIxsVec[$k] $sCol = $colIxsVec[$k] If IsArray($ar[$nRow][$nCol]) Then $buf &= "["&$sRow&"]["&$sCol&"]"&@CRLF& _ _FormatValsForDebug($location,$indent,$ar[$nRow][$nCol]) Else $n = $ar[$nRow][$nCol] If IsString($n) Then $n = $stringDelim&$n&$stringDelim $buf &= $brsVec[0] & _ StringFormat('%-'&$wid&'s', "["&$sRow&"]["&$sCol&"]")&" "&$n & @CRLF EndIf Next Next EndIf Case 1 If UBound($ar)=0 Then $buf &= $namesVec[$i]&' Ubound 0'&@CRLF ContinueLoop EndIf Local $brsVec = StringSplit($namesVec[$i],'[]',0+2) ; char,0-based Local $qEls = UBound($ar) Local $ixsVec[0],$evaledixsVec[0] If UBound($brsVec)=1 Then ; no [] Local $wid = StringLen('['&($qEls-1)&']') $buf &= $namesVec[$i]&' Vector: Ubound '&$qEls&@CRLF For $j = 0 To $qEls-1 If IsArray( $ar[$j]) Then $buf &= "["&$j&"]"&@CRLF&_FormatValsForDebug($location,$indent,$ar[$j])&@CRLF Else $n = $ar[$j] If IsString($n) Then $n = $stringDelim&$n&$stringDelim $buf &= $namesVec[$i] & StringFormat('%-'&$wid&'s', "["&$j&"]")&" "&$n & @CRLF EndIf Next Else _DoIndicesDebug($idents,$brsVec[1],$qEls,'element',$namesVec[$i],$namesVec,$valsVec, $ixsVec, _ $evaledIxsVec) EndIf Local $wid = 0 For $j = 0 To UBound($ixsVec)-1 $n = StringLen($ixsVec[$j]) If $n>$wid Then $wid = $n $n = StringLen($evaledIxsVec[$j]) If $n>$wid Then $wid = $n Next $wid += StringLen('[]') For $j In $ixsVec If IsArray($ar[$j]) Then $buf &= $namesVec[$i]&"["&$j&"]"&_FormatValsForDebug($location,$indent,$ar[$j]) Else If IsString($ar[$j]) Then $ar[$j] = $stringDelim&$ar[$j]&$stringDelim $buf &= $brsVec[0] & StringFormat('%-'&$wid&'s', "["&$j&"]")&" " & $ar[$j] & @CRLF EndIf Next EndSwitch ElseIf IsObj($valsVec[$i]) Then $buf &= $namesVec[$i] & ' <Object>' & @CRLF ElseIf IsDllStruct($valsVec[$i]) Then $buf &= $namesVec[$i] & ' <DLLStruct>' & @CRLF Else $s = $valsVec[$i] If IsString($s) Then $buf &= $namesVec[$i] & ' '&$stringDelim & $s & $stringDelim&@CRLF Else $buf &= $namesVec[$i] & " " & $s & @CRLF EndIf EndIf Next Return $buf EndFunc Func _DoIndicesDebug($idents,$expr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, ByRef $allIxsVec, ByRef $evaledAllIxsVec) Local $ixsVec[0],$evaledixsVec[0] If $expr='' Then $expr = '..' EndIf Local $vec = StringSplit($expr,',',0+2) ; char,0-based For $i = 0 To UBound($vec)-1 Local $subExpr = $vec[$i] If $subExpr='..' Then _DoRangeAllDebug($qRorC, $ixsVec, $evaledIxsVec) ElseIf StringRegExp($subExpr,'^(\$[a-zA-Z0-9_]+|\d+)\.\.$') Then _DoNumRangeFromDebug($idents,$subExpr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, $ixsVec, $evaledIxsVec) ElseIf StringRegExp($subExpr,'^\.\.(\$[a-zA-Z0-9_]+|\d+)$') Then _DoNumRangeToDebug($idents,$subExpr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, $ixsVec, $evaledIxsVec) ElseIf StringRegExp($subExpr,'^(\$[a-zA-Z0-9_]+|\d+)\.\.(\$[a-zA-Z0-9_]+|\d+)$') Then _DoNumRangeFromToDebug($idents,$subExpr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, $ixsVec, $evaledIxsVec) ; List of mixed AutoIt variables and positive integers ElseIf StringRegExp($subExpr,'^(\$[a-zA-Z0-9_])+|\d+(,\$[a-zA-Z0-9_]+|\d+)*$') Then _DoVarOrNumListDebug($idents,$subExpr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, $ixsVec, $evaledIxsVec) Else MsgBox($MB_ICONERROR,'cDebug()','Invalid '&$rOrC&' expression '&$subExpr&' in '&$arName _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf ; append Local $ubOld = UBound($allIxsVec) Local $ubNew = $ubOld + UBound($ixsVec) ReDim $allIxsVec[$ubNew] For $j = $ubOld To $ubNew-1 $allIxsVec[$j] = $ixsVec[$j-$ubOld] Next ReDim $evaledAllIxsVec[$ubNew] For $j = $ubOld To $ubNew-1 $evaledAllIxsVec[$j] = $evaledixsVec[$j-$ubold] Next Next EndFunc Func _DoRangeAllDebug($qRorC, ByRef $ixsVec, ByRef $evaledIxsVec) ReDim $ixsVec[$qRorC+1] For $j = 0 To $qRorC $ixsVec[$j] = $j Next $evaledixsVec = $ixsVec EndFunc Func _DoNumRangeFromDebug($idents,$expr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, ByRef $strsVec, ByRef $nbrsVec) Local $t Local $vec = StringSplit($expr,'..',1+2) ; str,0-based Local $nst If StringLeft($vec[0],1)='$' Then $nSt = _GetEvaledIxDebug($idents,$namesVec,$vec[0],$valsVec,$arName) Else $nst = $vec[0] EndIf If $nst<=$qRorC Then ReDim $nbrsVec[$qRorC+1-$nst] For $j = 0 To $qRorC-$nSt $nbrsVec[$j] = $j+$nst Next $strsVec = $nbrsVec If $nst<>$vec[0] Then $strsVec[0] = $vec[0] EndIf Else $t = $nst<>$vec[0] ? ' ('&$nst&')' : '' MsgBox($MB_ICONERROR,'cDebug()', _ $vec[0]&$t&' exceeds the maximum '&$rOrC&' number in '&$arName&', which is '&$qRorC _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf EndFunc Func _DoNumRangeToDebug($idents,$expr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, ByRef $strsVec, ByRef $nbrsVec) Local $t Local $vec = StringSplit($expr,'..',1+2) ; str,0-based Local $nEnd If StringLeft($vec[0],1)='$' Then $nEnd = _GetEvaledIxDebug($idents,$namesVec,$vec[1],$valsVec,$arName) Else $nEnd = $vec[1] EndIf If $nEnd<=$qRorC Then ReDim $nbrsVec[$nEnd+1] For $j = 0 To $nEnd $nbrsVec[$j] = $j Next $strsVec = $nbrsVec If $nEnd<>$vec[0] Then $strsVec[$qRorC] = $vec[0] EndIf Else $t = $nEnd<>$vec[0] ? ' ('&$nEnd&')' : '' MsgBox($MB_ICONERROR,'cDebug()', _ $vec[0]&$t&' exceeds the maximum '&$rOrC&' number in '&$arName&', which is '&$qRorC _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf EndFunc Func _DoNumRangeFromToDebug($idents,$expr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, ByRef $strsVec, ByRef $nbrsVec) Local $t,$s Local $svec = StringSplit($expr,'..',1+2) ; str,0-based Local $nvec[2] For $i = 0 To 1 $nVec[$i] = _GetEvaledIxDebug($idents,$namesVec,$sVec[$i],$valsVec,$arName) Next If $nVec[0]<=$qRorC And $nVec[1]<=$qRorC And $nVec[1]>=$nVec[0] Then ReDim $nbrsVec[$nVec[1]-$nVec[0]+1] For $j = $nVec[0] To $nVec[1] $nbrsVec[$j-$nvec[0]] = $j Next $strsVec = $nbrsVec If StringLeft($sVec[0],1)='$' Then $strsVec[0] = $svec[0] EndIf If StringLeft($svec[1],1)='$' Then $strsVec[UBound($strsVec)-1] = $svec[1] EndIf Else For $i = 0 To 1 If $nVec>$qRorC Then $t = $svec[$i]<>$nvec[$i] ? ' ('&$nVec[$i]&')' : '' MsgBox($MB_ICONERROR,'cDebug()', _ $sVec[$i]&$t&' exceeds the maximum row number in '&$arName&', which is '&$qRorC _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf Next If $nvec[1]<$nvec[0] Then $t = $svec[1]<>$nvec[1] ? ' ('&$nVec[1]&')' : '' $s = $svec[0]<>$nvec[0] ? ' ('&$nVec[0]&')' : '' MsgBox($MB_ICONERROR,'cDebug()',$sVec[1]&$t&' is less than '&$sVec[0]&$s&'in '&$arName _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf EndIf EndFunc Func _DoVarOrNumListDebug($idents,$expr,$qRorC,$rOrC,$arName,$namesVec,$valsVec, ByRef $strsVec, ByRef $nbrsVec) Local $t $strsVec = StringSplit($expr,',',0+2) ReDim $nbrsVec[UBound($strsVec)] For $i = 0 To UBound($strsVec)-1 $nbrsVec[$i] = _GetEvaledIxDebug($idents,$namesVec,$strsVec[$i],$valsVec,$arName) If $nbrsVec[$i]>$qRorC Then $t = $strsVec[$i]<>$nbrsVec[$i] ? ' ('&$nbrsVec[$i]&')' : '' MsgBox($MB_ICONERROR,'cDebug()', _ $strsVec[$i]&$t&' exceeds the maximum '&$rOrC&' number in '&$arName&', which is '&$qRorC _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf Next EndFunc Func _GetEvaledIxDebug($idents,$namesVec,$strIx,$valsVec,$arName) Local $ret,$t,$n If StringRegExp($strIx,'^\d+$',0) Then ; >=1 digits $ret = $strIx ElseIf StringRegExp($strIx,'^\$[A-Za-z0-9_]+$') Then ; an AutoIt variable name $t = _EvaluateDebug($strIx) If @error Then ; a local variable $n=-1 For $j = 1 To UBound($namesVec)-1 If $namesVec[$j]=$strIx Then $n = $j ExitLoop EndIf Next If $n>=0 Then $ret = $valsVec[$n] Else MsgBox($MB_ICONERROR,'cDebug()',$strIx&' occuring in '&$arName&' is not defined' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf ElseIf Not StringRegExp($t,'^\d+$') Then MsgBox($MB_ICONERROR,'cDebug()', _ $strIx&' in '&$arName&' neither is, nor evaluates to, zero or a positive integer' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit Else $ret = $t EndIf Else MsgBox($MB_ICONERROR,'cDebug()',$strIx&' in '&$arName&' is illegal' _ &@CRLF&@CRLF&'Identifiers: '&$idents) Exit EndIf Return $ret EndFunc Func _EvaluateDebug($__paramDebug) If StringLeft($__paramDebug,1)='$' Then $__paramDebug = StringTrimLeft($__paramDebug,1) EndIf $__paramDebug = Eval($__paramDebug) Return SetError(@error,0,$__paramDebug) EndFunc Func _UpdateClipboard($t) Static Local $bInited If (Not $bInited) And ClipGet()<>'' Then Local $ans = MsgBox(35+$MB_SETFOREGROUND,"cDebug","Clear the Clipboard initially?") ; yes,no,cancel Switch $ans Case 6 ;Yes ClipPut('') Case 7 ;No ; do nothing Case 2 ;Cancel Exit EndSwitch $bInited = True EndIf ClipPut(ClipGet()&$t) EndFunc The documentation is attached.
      These UDFs have been in regular use for some years.
       
      cDebug.pdf
    • RTFC
      By RTFC
      Please answer me these questions three, ere the other side you see:
      Are you running a 64-bit machine with a 64-bit Windows operating system? Can your AutoIt scripts cope with having directive #AutoIt3Wrapper_UseX64=Y, and thus @AutoItX64=True? Are you sick and tired of seeing this error message?
      If you (like me) answered "YES" to all three questions, then the _HighMem library may ease your pain (the name commemorates a useful utility from the days when CPUs were still steam-powered). Forget about pathetic boot switches /3GB and /userva; in a full-fledged 64-bit environment, _HighMem can pre-allocate all available physical/virtual RAM you've got (or any smaller size you need), and manage individual allocations therein with four simple functions:
      _HighMem_StartUp( $nSize, $sUnit="GB" ) ; parse size of total region to pre-allocate, e.g. (10,"GB") _HighMem_Allocate( $nSize, $sUnit="B" ) ; returns $pOffset (new allocation's base address) _HighMem_Release( $pOffset ) ; existing allocations are identified by their offset (base address) _HighMem_CleanUp() ; close handles, release all pre-allocated memory Of course, existing AutoIt limitations remain in force (e.g., DllstructCreate() is still limited to 2 GB per call), but the maximum of 2-4 GB of virtual memory per Windows process can (under the right circumstances, in the proper environment) be circumvented. However, this is the first beta release, so glitches are likely, and performance may vary. In fact, it may not work at all for you (if you're running 32-bit, for example). And since this involves your own hardware, it's unlikely I would be able to reproduce your issues in my own work environment. Nevertheless, if you find obvious bugs or mistakes in the code, please do post. And if it works for you, that's also good to hear. My own motivation for developing it was to supercharge my matrix computing environment (Eigen4AutoIt), so it can handle matrices of any size that fit in machine RAM.
      The attached zip contains the library itself (HighMem.au3) and two test examples. HighMem_Test1 performs a dry run stress test of the allocation management system; it does not actually do any memory I/O. By contrast, HighMem_Test2 pre-allocates a 6 GB space, stores 3 x 2GB structs there, performs some basic I/O, and releases the allocations one by one. Obviously, for this to work you'll need at least that much free RAM to begin with (check with Task Manager -> Performance -> Memory if you're unsure). My own test environment has 16 GB of physical RAM, and runs W10Pro/64.
      EDIT: minor edits added to improve user experience (many more status messages if $_HighMem_Verbose=True)
      HighMem.v0.85.7z
      EDIT: from beta version 0.9, HighMem supports shared memory, including mutex negotiation.
       
      HighMem.v0.91.7z
    • nacerbaaziz
      By nacerbaaziz
      Hello
      I have some problems with compiled autoit files
      So that some viruses intercept them and prevent them from working
      Often, the .exe file is automatically deleted
      These are anti - viruses such as
      Avast + avira
      Please help me with a solution or suggestion
    • Meobdg
      By Meobdg
      Hi, I have a problem, my functions do not work with each other. Separately, each works very well. Features that do not work together it's loot() and  pos1(). It looks that after spreadsheet function loot() script stops working even though everything is in the While 1-Wend loop.  Can someone help me please?
       
         
    • Dequality
      By Dequality
      Since my last topic were closed because bot scripting aren't allowed to be discussed anymore on here.
      Could anyone possibly give me a good example to learn memory read/write? , i can't figure out anything else which would be a good level of difficulty to practice than "tetris bot" but since it aint legal, i wont be asking for that let me know ur ideas and i would highly appreciate if examples could be posted (My last project was a imgsrch/pxlsrch) so thought i woud move on to memory read/write, if this somehow came out wrong lmk.
       
      AND NO I'M NOT ASKING FOR A FULL CODE I WANNA CODE/SCRIPT IT MY SELF, Just show me some simple examples of Memory read/write if u can/will TYVM.
       
      Dequality.