Leaderboard
Popular Content
Showing content with the highest reputation on 03/16/2017 in all areas
-
[BUGFIX VERSION] - 6 Apr 24 Fixed: UDF failed if header colours were initialised but not specifically set. New UDF in the zip below. -------------------------------------------------------------------------------------- Note: This is a new recoded and expanded version of my earlier UDF of the same name. If you move to this new version there might well be several script-breaking changes, particularly when setting which columns are to be editable. Please read the "Beginner's Guide" and look at the included example scripts to see where things have changed. -------------------------------------------------------------------------------------- This UDF allows you to do much more with ListView controls (either native or UDF created): Edit the content with plain text, combos or date-time pickers - and edit the headers too Move rows within the ListView Drag rows both within the ListView and to other ListViews in the same GUI (or not as required) Insert and delete columns and rows Sort columns by simply clicking the header Colour individual ListView items and headers Only select a single cell rather then the entire row Save and load entire ListViews For the advanced user: If you use certain Windows message handlers (In particular WM_NOTIFY) in your script, please read the function headers for the equivalent handlers within the UDF. Here is the UDF, with 6 examples and the guide, in zip format: GUIListViewEx.zip Credit to: martin (basic drag code), Array.au3 authors (array functions), KaFu and ProgAndy (font function), LarsJ (colouring code) Happy to take compliments or criticism - preferably the former! M231 point
-
Since monoceres has released I searched for a way to map the 2D image of the earth to a 3D sphere with rotation. Here the result (after 9 years of research ^^) as a non realistic physical animation: ==> Due to the fact that AutoIt / GDI+ are not that fast I couldn't add a moon animation additionally. Thanks to one of Eukalyptus' code to pointing me to the right direction. U rock man. Source code extract only - not working because of missing binary data (images): ;coded by UEZ build 2017-03-18 #pragma compile(x64, false) #pragma compile(Icon, "c:\Program Files (x86)\AutoIt3\Icons\au3.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global Const $iW = 800, $iW2 = ($iW - 100) / 2, $iH = 500, $fRad = ACos(-1) / 180, $sTitle = "GDI+ Rotating Earth v1.7 coded by UEZ 2017" AutoItSetOption("GUIOnEventMode", 1) GDIPlus_RotatingEarth() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_RotatingEarth() $bExit = False $hGUI = GUICreate($sTitle, $iW, $iH) GUISetState(@SW_SHOW, $hGUI) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetInterpolationMode($hCanvas, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HALF) Local Const $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xFF000000), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xFFF0F0F0), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 60, 16), _ $hImage_Earth = _GDIPlus_BitmapCreateFromMemory(_Earth()), _ $hImage_Galaxy = _GDIPlus_BitmapCreateFromMemory(_Galaxy()), _ $hImage_Clouds = _GDIPlus_BitmapCreateFromMemory(_Clouds()), _ $hImage_Moon = _GDIPlus_BitmapCreateFromMemory(_Moon()), _ $hImage_USSE = _GDIPlus_BitmapCreateFromMemory(_USSE()), _ $hMatrix = _GDIPlus_MatrixCreate(), $hMatrix2 = _GDIPlus_MatrixCreate(), _ $hPath = _GDIPlus_PathCreate(), $hPath2 = _GDIPlus_PathCreate(), _ $hPen = _GDIPlus_PenCreate(0xC0FFFFFF, 1) _GDIPlus_ImageRotateFlip($hImage_USSE, 4) Local $aDim = _GDIPlus_ImageGetDimension($hImage_Earth) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage_Earth) _GDIPlus_GraphicsDrawStringEx($hGfx, "Coded by UEZ 2017 ^^", $hFont_FPS, _GDIPlus_RectFCreate(0, $aDim[1] / 2 - 4, 120, 12), $hFormat_FPS, $hBrush_FPS) _GDIPlus_ImageDispose($hGfx) Local Const $hTexture_Earth = _GDIPlus_TextureCreate($hImage_Earth), $hTexture_Clouds = _GDIPlus_TextureCreate($hImage_Clouds) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Earth, "float", -200, "float", 0, "long", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Clouds, "float", -100, "float", 0, "long", 0) Local $iDiameter = $aDim[0] < $aDim[1] ? $aDim[0] : $aDim[1], _ $fDiameter2 = $iDiameter / 2, _ $fDX = ($iW - $iDiameter) / 2, $fDY = ($iH - $iDiameter) / 2 _GDIPlus_PathAddEllipse($hPath, $fDX - 1, $fDY - 1, $iDiameter + 2, $iDiameter + 2) Local Const $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) _GDIPlus_PathBrushSetCenterColor($hBrush, 0x02000008) _GDIPlus_PathBrushSetCenterPoint($hBrush, $fDX + $fDiameter2 + 1, $fDY + $fDiameter2 + 1) _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xF8000000) _GDIPlus_PathBrushSetGammaCorrection($hBrush, 1) _GDIPlus_PathBrushSetFocusScales($hBrush, 0.50, 0.50) _GDIPlus_PathAddEllipse($hPath2, -1, -1, 201, 201) Local Const $hBrush2 = _GDIPlus_PathBrushCreateFromPath($hPath2) _GDIPlus_PathBrushSetCenterColor($hBrush2, 0x0800000) _GDIPlus_PathBrushSetCenterPoint($hBrush2, 100, 100) _GDIPlus_PathBrushSetSurroundColor($hBrush2, 0xFF000000) _GDIPlus_PathBrushSetGammaCorrection($hBrush2, 1) _GDIPlus_PathBrushSetFocusScales($hBrush2, 0.50, 0.50) $hGfx = _GDIPlus_ImageGetGraphicsContext($hImage_Moon) _GDIPlus_GraphicsFillEllipse($hGfx, -1, -1, 201, 201, $hBrush2) _GDIPlus_ImageDispose($hGfx) $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") AdlibRegister("CalcFPS", 1000) Local $fTimer1, $fTimer2, $fScale, $fTmp, $fX, $fSin, $fZ, $fS, $zz, $z = 90, $iStep = 4 ;the higher $iStep is the faster the animation but lower the quality. Local $fPosX, $fPosY, $fSize, $fSpeed, $aMeteor[4] = [0, 10 + Random() * ($iH - 20), 5 + Random() * 10, 5 + Random() * 10] $fPosX = $iW + 60 $fPosY = Random() * ($iH - 100) + 50 $fSize = 0.5 + Random() * 2 $fSpeed = Random() * 3 + 1 $fTimer1 = TimerInit() $fTimer2 = TimerInit() Do DllCall($__g_hGDIPDll, "int", "GdipDrawImageRect", "handle", $hCanvas, "handle", $hImage_Galaxy, "float", 0, "float", 0, _ "float", $iW, "float", $iH) DllCall($__g_hGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hCanvas, "int", 4) If TimerDiff($fTimer1) > 10000 Then DllCall($__g_hGDIPDll, "int", "GdipDrawLine", "handle", $hCanvas, "handle", $hPen, "float", $aMeteor[0], "float", $aMeteor[1], _ "float", $aMeteor[0] + $aMeteor[2] * 3, "float", $aMeteor[1] + $aMeteor[3] * 3) $aMeteor[0] += $aMeteor[2] $aMeteor[1] += $aMeteor[3] If BitOR($aMeteor[0] > $iW, $aMeteor[1] > $iH, $aMeteor[0] < 0, $aMeteor[1] < 0) Then $aMeteor[0] = 0 $aMeteor[1] = Random() * ($iH * 0.75) $aMeteor[2] = 8 + Random() * 12 $aMeteor[3] = 7 + Random() * 10 $fTimer1 = TimerInit() EndIf EndIf If TimerDiff($fTimer2) > 30000 Then DllCall($__g_hGDIPDll, "int", "GdipDrawImageRect", "handle", $hCanvas, "handle", $hImage_USSE, "float", $fPosX, "float", $fPosY, _ "float", 50 * $fSize, "float", 12 * $fSize) $fPosX -= $fSpeed If $fPosX < -100 Then $fPosX = $iW + 30 $fPosY = Random() * ($iH - 100) + 50 $fSize = Random() * 2 $fSpeed = Random() * 3 + 1 $fTimer2 = TimerInit() EndIf EndIf $zz = $z * $fRad $fX = $iW2 - Cos($zz) * 345 $z -= 0.5 $fZ = Sin($zz) $fS = 100 - $fZ * 50 DllCall($__g_hGDIPDll, "int", "GdipSetSmoothingMode", "handle", $hCanvas, "int", 1) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Earth, "float", 0.75, "float", 0, "long", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateTextureTransform", "ptr", $hTexture_Clouds, "float", 1.25, "float", 0, "long", 0) If $fZ > 0 Then _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage_Moon, $fX, 110, $fS, $fS) For $i = 1 To $fDiameter2 Step $iStep $fScale = 1 + $i / $fDiameter2 DllCall($__g_hGDIPDll, "int", "GdipSetMatrixElements", "handle", $hMatrix, "float", 1.0, "float", 0.0, "float", 0.0, "float", 1.0, "float", 0.0, "float", 0.0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fDX + $fDiameter2, "float", $fDY + $fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipScaleMatrix", "handle", $hMatrix, "float", $fScale, "float", $fScale, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", -$fDiameter2, "float", -$fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipSetWorldTransform", "handle", $hCanvas, "handle", $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Earth, _ "float", $i, "float", $i, "float", $iDiameter -2 * $i, "float", $iDiameter - 2 * $i) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Clouds, _ "float", $i, "float", $i, "float", $iDiameter -2 * $i, "float", $iDiameter - 2 * $i) Next _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", $fDX, "float", $fDY, "float", $iDiameter, "float", $iDiameter) Else For $i = 1 To $fDiameter2 Step $iStep $fScale = 1 + $i / $fDiameter2 DllCall($__g_hGDIPDll, "int", "GdipSetMatrixElements", "handle", $hMatrix, "float", 1.0, "float", 0.0, "float", 0.0, "float", 1.0, "float", 0.0, "float", 0.0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", $fDX + $fDiameter2, "float", $fDY + $fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipScaleMatrix", "handle", $hMatrix, "float", $fScale, "float", $fScale, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipTranslateMatrix", "handle", $hMatrix, "float", -$fDiameter2, "float", -$fDiameter2, "int", 0) DllCall($__g_hGDIPDll, "int", "GdipSetWorldTransform", "handle", $hCanvas, "handle", $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Earth, _ "float", $i, "float", $i, "float", $iDiameter - 2 * $i, "float", $iDiameter - 2 * $i) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hTexture_Clouds, _ "float", $i, "float", $i, "float", $iDiameter - 2 * $i, "float", $iDiameter - 2 * $i) Next _GDIPlus_MatrixSetElements($hMatrix) _GDIPlus_GraphicsSetTransform($hCanvas, $hMatrix) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush, "float", $fDX, "float", $fDY, "float", $iDiameter, "float", $iDiameter) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hImage_Moon, $fX, 110, $fS, $fS) EndIf _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS, $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) ;draw background message text _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) ;blit drawn bitmap to GUI $iFPS += 1 If $bExit Then ExitLoop Until False ;Not Sleep(10) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hBrush2) _GDIPlus_PathDispose($hPath) _GDIPlus_PathDispose($hPath2) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_MatrixDispose($hMatrix2) _GDIPlus_ImageDispose($hImage_Earth) _GDIPlus_ImageDispose($hImage_Galaxy) _GDIPlus_ImageDispose($hImage_Clouds) _GDIPlus_ImageDispose($hImage_Moon) _GDIPlus_ImageDispose($hImage_USSE) _GDIPlus_BrushDispose($hTexture_Earth) _GDIPlus_BrushDispose($hTexture_Clouds) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) GUIDelete($hGUI) EndFunc ;==>GDIPlus_RotatingEarth Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2016-12-01 ... Download: Rotating Earth v1.7.au3 In line 92 you can modify the $iStep variable -> the higher $iStep is the faster the animation & lower the quality. So long...1 point
-
Hello. I have not time to look into for now. But When I get some free time sure I'll do something. Saludos1 point
-
yes, but i am reading and trying myself now first to run host CLR in Visual C++ application to see what are working examples and what not then transform to VBA and AutoIt1 point
-
Thanks for your Feedback! Feel free to contact me! On my website, there are links to forums, bugtracker and so on. (Under Support) And the next update (1.04) is coming soon!1 point
-
Something like this maybe? While Boucie = 0 $iRandom = Random(1,114,1) If IniRead("Filename.ini", "Shuffle", $iRandom, "") = "" Then Continueloop ShellExecute($path & "\" & $array[$iRandom]) IniWrite("Filename.ini", "Shuffle", $iRandom, $array[$iRandom]) Sleep(30000) WinClose("[CLASS:QWIDGET]", "") WEnd1 point
-
Naming Excel Sheet
pixelsearch reacted to water for a topic
There is no need to save/reopen the workbook before you can work with it. Use the following code to rename a worksheet: $oWorkbook_PRV_HW.Sheets(n).Name = "new name" ; n can be the number of the sheet or the name in quotes like "Old Name"1 point -
Run program in early boot
romulocarlos reacted to JLogan3o13 for a topic
@romulocarlos understood, but the answer is no, you are not going to be able to do what you're after.1 point -
fopetesl, This seems to work: #include <File.au3> ; ################### ; Only for example ; Required file content $bBinary = "0x010101002121484F" ; Create file containing the data $hFile = FileOpen("Test.fil", $FO_OVERWRITE + $FO_BINARY) FileWrite($hFile, $bBinary) FileClose($hFile) Sleep(1000) ; ################## ; Define required search string $sSearch = "2121484F" ; Or create it from ASCII $sSearch = StringTrimLeft(StringToBinary("!!HO"), 2) ; Open file and read contents as binary $hFile = FileOpen("Test.fil", $FO_BINARY) $sContent = FileRead($hFile) FileClose($hFile) ; Check for search string If StringInStr($sContent, $sSearch) Then MsgBox($MB_SYSTEMMODAL, "Head is Home", "!HHO") Else MsgBox($MB_SYSTEMMODAL, "Head not Home!","!HHx") EndIf M231 point
-
Run program in early boot
romulocarlos reacted to JLogan3o13 for a topic
@romulocarlos there are plenty of folks using autoit scripts in a PXE environment, if that is what you mean. But if you are talking outside of Windows in the fashion of an AV tool, they are usually booting to their own Linux-flavor kernel. Chkdsk (at least in the old days, but I believe still today) simply gets the handoff from the MBR to the NTLDR, which scans the file system for continuity during boot. It is doubtful that you'll have any luck running a script in the pre-boot arena. My next question would be, why do you want to?1 point -
Where to start from
Xandy reacted to JLogan3o13 for a topic
@drathod Giving you a definitive answer as to why AutoIt would beat all other tools is a bit of a broad undertaking, especially given the short description you have given. I can give you some of the benefits of AutoIt, which you can compare against other tools you may be considering: Designed to interact with the Windows API, so most anything you would want to do in Windows can be done. A Basic-like syntax that is very easy to pick up, even for those new to the language or non-scripters. Can compile to small, self-contained executables that can run on all modern versions of Windows without need for downloading runtimes or additional libraries. A very large, active community with hundreds of volunteers that devote their time to answering questions that may come up as you begin your scripting experience.1 point -
I *think* this is 2010 version. AutoIt Machine Code Algorithm Collection.zip1 point
-
MD5,SHA1,CRC32,RC4,BASE64,XXTEA machine code version
n3wbie reacted to argumentum for a topic
from 2008, OP is no longer at the forums. Good luck. SHA1_MD5_RC4_BASE64_CRC32_XXTEA.zip1 point -
For those who were trying to display an array with _ArrayDisplay(): $cPrivacy_sum.Details = $aSummaryDetails ; simply do _ArrayDisplay(($cPrivacy_sum.Details))1 point
-
ORfuscate your script. I'm not sure if this exists, but it is intended as a pre-obfuscation tool. It might be a new invention! While it does not guarantee any protection by itself, ORfuscation does offer some benefit in certain situations. It's more useful in cases where knowing the original numbers is essential to fully understand a script. In other cases it's just adds a slight inconvenience to the reverse engineer due to superflous internal routines. You may wish to convert globals to magic numbers before ORfuscation. I believe PreExpand by guinness will do this. Additional features such as creating fake constants may be included in a future release. Please do not post ORfuscated scripts on the forum. You may post them in this thread if it is relevant to the topic or provides an interesting example. Please double check to make sure that your scripts are still functional after ORfuscation. The example at the end of the script (lines 236 onwards) should be removed before testing with your own script. ; ; #FUNCTION# ==================================================================================================================== ; Name...........: ORfuscate ; Description ...: Refactorization of magic numbers, 32-bit integers and hard coded BitOR() arguments. ; Syntax.........: ORfuscate($sScript) ; Parameters ....: $sScript - String input of an AutoIt script. ; Return values .: Success - Returns the orfuscated script. ; Failure - Returns the original script and sets @error to the following values: ; |@error = 1 : Script contains no data. ; |@error = 2 : No suitable separators found (this should not happen). ; Author ........: czardas ; Modified.......: ; Remarks .......: This is an experimental project with very little testing - so use at your own risk. ; Link ..........: ; Example .......: ; =============================================================================================================================== Func ORfuscate($sScript) If $sScript = "" Then Return SetError(1, 0, "") ; Get suitable padding to separate strings, comments and directives from the AutoIt. Local $iCount = 63743 ; BMP Private Range Upper Limit $sScript &= @LF Local $sIgnoreOn = " " & __GetSubstitute($sScript, $iCount) & " " ; Spaces are used for extra padding. If @error Then Return SetError(2, 0, $sScript) Local $sIgnoreOff = " " & __GetSubstitute($sScript, $iCount) & " " If @error Then Return SetError(2, 0, $sScript) Local $bIsAutoIt = True, _ ; The current position is outside strings, comments and directives. $sNotAutoIt = "", _ ; Strings, comments or directives to avoid. $sExpected = "", _ ; Regexp pattern to match the termination of a string, comment or directive. $sNextChar, $sNewAutoIt = "" ; Identify strings, comments and directives. For $i = 1 To StringLen($sScript) $sNextChar = StringMid($sScript, $i, 1) If $bIsAutoIt Then If StringRegExp($sNextChar, '[#''";]') Then $sNewAutoIt &= $sIgnoreOn & $sNextChar $bIsAutoIt = False Switch $sNextChar Case "#" $sExpected = StringRegExp(StringMid($sScript, $i, 4), "(?:)(#cs\b)") ? "(?:)([\r\n]\h*#ce\b.*\v)" : "\v" Case "'" $sExpected = "'" Case """" $sExpected = """" Case ";" $sExpected = "\v" EndSwitch Else $sNewAutoIt &= $sNextChar EndIf Else $sNotAutoIt &= $sNextChar If StringRegExp($sNotAutoIt, $sExpected) Then $sNewAutoIt &= $sNotAutoIt & $sIgnoreOff $bIsAutoIt = True $sExpected = "" $sNotAutoIt = "" EndIf EndIf Next ; Split the script to reveal 32-bit integers, Bitwise-OR'ed integers and also capture the rest of the code. Local $aAutoIt = StringRegExp($sNewAutoIt, "(?i)(?s)(?U)(" & $sIgnoreOn & ".+" & $sIgnoreOff & ")|\b\d*\.\d+\b|\b\d*\.?\d+e[\+\-]?\d+\b|(?<=[\s=,/\Q[(+-*^?:\E])(\d+|0x[A-F0-9]+|BitOR\h*\([x\h0-9,A-F]+\))(?=[\s=,/\Q)]+-*^?:\E])|\$*\b\w+\b|.", 3) ; Search for integers Local $iBound = UBound($aAutoIt), $iInt32, $sIdx = "" For $i = 0 To $iBound -1 $iInt32 = "" If StringIsInt($aAutoIt[$i]) Or StringRegExp($aAutoIt[$i], "(?i)(\A0x[A-F\d]{1,8}\z)") Or StringRegExp($aAutoIt[$i], "(?i)(BitOR\h*\([x\h\d,A-F]+\))") Then $iInt32 = Execute($aAutoIt[$i]) If VarGetType ($iInt32) <> "Int32" Then ContinueLoop $aAutoIt[$i] = $iInt32 $sIdx &= $i & "," Next If Not $sIdx Then Return SetExtended(1, $sScript) ; No changes can be made Local $aIdx = StringSplit(StringTrimRight($sIdx, 1), ",", 2) Local $iBoundIdx = Ubound($aIdx) Local $aSplit, $aMagic[$iBoundIdx][2][3] For $i = 0 to $iBoundIdx -1 $aSplit = MagicSplit($aAutoIt[$aIdx[$i]]) $aMagic[$i][0][0] = $aSplit[0] ; 1st int $aMagic[$i][1][0] = $aSplit[1] ; 2nd int $aSplit = MagicSplit($aMagic[$i][0][0]) $aMagic[$i][0][1] = $aSplit[0] ; 1st int - 1st element $aMagic[$i][0][2] = $aSplit[1] ; 1st int - 2nd element $aSplit = MagicSplit($aMagic[$i][1][0]) $aMagic[$i][1][1] = $aSplit[0] ; 2nd int - 1st element $aMagic[$i][1][2] = $aSplit[1] ; 2nd int - 2nd element Next ;_WalkThrough3D($aMagic, "zx") Local $sCheckDupes For $i = 0 to $iBoundIdx -1 If $aMagic[$i][0][0] = 0 Then If $aMagic[$i][1][1] = 0 Or $aMagic[$i][1][2] = 0 Then $aAutoIt[$aIdx[$i]] = MagicFormat($aAutoIt[$aIdx[$i]]) Else $aAutoIt[$aIdx[$i]] = "BitOR(" & MagicFormat($aMagic[$i][1][1]) & ", " & MagicFormat($aMagic[$i][1][2]) & ")" EndIf ElseIf $aMagic[$i][1][0] = 0 Then If $aMagic[$i][0][1] = 0 Or $aMagic[$i][0][2] = 0 Then $aAutoIt[$aIdx[$i]] = MagicFormat($aAutoIt[$aIdx[$i]]) Else $aAutoIt[$aIdx[$i]] = "BitOR(" & MagicFormat($aMagic[$i][0][1]) & ", " & MagicFormat($aMagic[$i][0][2]) & ")" EndIf ElseIf Random(0, 1, 1) Then $aAutoIt[$aIdx[$i]] = "BitOR(" $sCheckDupes = "|" For $j = 0 To 1 For $k = 1 To 2 If $aMagic[$i][$j][$k] <> 0 And Not StringInStr($sCheckDupes, "|" & $aMagic[$i][$j][$k] & "|") Then $aAutoIt[$aIdx[$i]] &= MagicFormat($aMagic[$i][$j][$k]) & ", " $sCheckDupes &= $aMagic[$i][$j][$k] & "|" EndIf Next Next $aAutoIt[$aIdx[$i]] = StringTrimRight($aAutoIt[$aIdx[$i]], 2) & ")" ElseIf $aMagic[$i][0][0] <> $aMagic[$i][1][0] Then $aAutoIt[$aIdx[$i]] = "BitOR(" & MagicFormat($aMagic[$i][0][0]) & ", " & MagicFormat($aMagic[$i][1][0]) & ")" Else $aAutoIt[$aIdx[$i]] = MagicFormat($aAutoIt[$aIdx[$i]]) EndIf Next $sScript = "" For $i = 0 To $iBound -1 $sScript &= $aAutoIt[$i] Next $sScript = StringReplace($sScript, $sIgnoreOn, "") $sScript = StringReplace($sScript, $sIgnoreOff, "") $sScript = StringTrimRight($sScript, 1) ; Remove LF added at the start Return $sScript EndFunc Func XORSplit($i32Bit) ; Splits an integer into two randomly selected bitwise exclusive integers. If Not IsInt($i32Bit) Or $i32Bit >= 2^32 Or $i32Bit < 0x80000000 Then Return SetError(1, 0, 0) Local $aXOR[2] $aXOR[0] = 0 ; Randomly select which bits to reproduce in the first return value. => $aXOR[0] Local $iBitPos For $i = 0 To 31 $iBitPos = 2^$i If BitAND($i32Bit, $iBitPos) = $iBitPos And Random(0, 1, 1) Then $aXOR[0] = BitOR($aXOR[0], $iBitPos) Next ; Check the sign bit. If BitAND($i32Bit, 0x80000000) = 0x80000000 And Random(0, 1, 1) Then $aXOR[0] = BitOR($aXOR[0], 0x80000000) ; Exclude the bits set to one (in the first return value) from the original input. $aXOR[1] = BitXOR($i32Bit, $aXOR[0]) Return $aXOR ; Array values can be Bitwise-OR'ed together to reproduce the original input. EndFunc ;==> XORSplit Func ORSplit($i32Bit) ; Splits an integer into two randomly selected bitwise non-exclusive integers. If Not IsInt($i32Bit) Or $i32Bit >= 2^32 Or $i32Bit < 0x80000000 Then Return SetError(1, 0, 0) Local $aOR[2] $aOR[0] = 0 $aOR[1] = 0 ; Randomly select which bits to reproduce in either one or both return values. Local $iBitPos, $iSwitch = Random(1,3,1) For $i = 0 To 31 $iBitPos = 2^$i If BitAND($i32Bit, $iBitPos) = $iBitPos Then For $n = 1 To 2 If BitAND($iSwitch, $n) = $n Then $aOR[$n -1] = BitOR($aOR[$n -1], $iBitPos) Next $iSwitch = Random(1,3,1) ; Set the switch for the next run. EndIf Next ; Check the sign bit. If BitAND($i32Bit, 0x80000000) = 0x80000000 Then For $n = 1 To 2 If BitAND($iSwitch, $n) = $n Then $aOR[$n -1] = BitOR($aOR[$n -1], 0x80000000) Next EndIf Return $aOR ; Array values can be Bitwise-OR'ed together to reproduce the original input. EndFunc ;==> ORSplit Func MagicFormat($iInt) Return '0x' & StringRegExpReplace(Hex($iInt), '\A0{0,'& 2*Random(2,3,1) &'}', '') EndFunc Func MagicSplit($iInt) Local $aSplit = ORSplit($iInt) If $aSplit[0] = $iInt Or $aSplit[1] = $iInt Or $aSplit[0] = 1 Or $aSplit[1] = 1 Then $aSplit = XORSplit($iInt) Return $aSplit EndFunc ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name...........: __GetSubstitute ; Description ...: Searches for a character to be used for substitution, ie one not contained within the input string ; Syntax.........: __GetSubstitute($string, ByRef $iCountdown) ; Parameters ....: $string - The string of characters to avoid ; $iCountdown - The first code point to begin checking ; Return values .: Success - Returns a suitable substitution character not found within the first parameter ; Failure - Sets @error to 1 => No substitution character available ; Author ........: czardas ; Comments ......; This function is connected to the function _CSVSplit and was not intended for general use ; $iCountdown is returned ByRef to avoid selecting the same character on subsequent calls to this function ; Initially $iCountown should be passed with a value = 63743 ; =============================================================================================================================== Func __GetSubstitute($string, ByRef $iCountdown) If $iCountdown < 57344 Then Return SetError(1, 0, "") ; Out of options Local $sTestChar For $i = $iCountdown To 57344 Step -1 $sTestChar = ChrW($i) $iCountdown -= 1 If Not StringInStr($string, $sTestChar) Then Return $sTestChar EndIf Next Return SetError(1, 0, "") ; Out of options EndFunc ;==> __GetSubstitute ; ==> Example - ORfuscate this script. ; See what it does to an array of numbers: Local $aArrayOfNumbers[8] = [387, 0xFFFFFFFF, BitOR(1,2,4,8,16,32,64,128), 0.178, 13/167, 0.1e-78, -876, 20] Global $hFile = FileOpen(@ScriptFullPath) Global $sScript = FileRead($hFile) FileClose($hFile) ConsoleWrite(ORfuscate($sScript) & @CRLF) #cs Ignores multiline comments 100, 0xFFFFFFFF, BitOR(23, 57) #ce ; Have fun!1 point
-
Msgbox font size?
AnonymousX reacted to LxP for a topic
You are correct Kaso -- the text size of a Windows message box is entirely dependent on Windows settings and there is no way to adjust this on a per-box basis. Your best bet is to adopt Mikey's suggestion and assemble a GUI made for the purpose. You can then use your own sizes, styles, icons, placements, button labels etc.1 point