Automation
63 files
-
ImageSearchUDF
By Trong
ImageSearch UDF v3.5 - AutoIt Wrapper for ImageSearchDLL
Advanced image search library for AutoIt with cache system and SIMD optimization.
Overview
ImageSearchDLL UDF is a high-performance image search library for AutoIt that enables you to find images on screen or within other images. Built with C++14 and optimized with SIMD instructions (AVX512/AVX2/SSE2), it provides fast and accurate image matching capabilities.
Features
High Performance: SIMD optimization (AVX512/AVX2/SSE2) for fast searching Multi-Monitor Support: Full support for multi-monitor setups with negative coordinates DPI Awareness: Thread-local DPI awareness without affecting AutoIt GUI Cache System: Persistent cache for 30-50% speed boost on repeated searches Image Scaling: Search for images at different scales (0.1x to 5.0x) Screen Capture: Direct screen capture with DPI-aware coordinates Mouse Automation: Precise mouse movement and clicking with multi-monitor support Requirements
AutoIt: Version 3.3.16.1 or higher Windows: XP SP3 to Windows 11 Architecture: x86 or x64 (automatic detection) DLL: ImageSearchDLL v3.5 (included) Installation
Download the UDF package
Place ImageSearchDLL_UDF.au3 in your script directory
Ensure the appropriate DLL is in the same directory:
ImageSearchDLL_x64.dll for 64-bit AutoIt ImageSearchDLL_x86.dll for 32-bit AutoIt Not required in embedded version! (But need to install Visual C++ Redistributable 2015-2022) Include the UDF in your script:
#include "ImageSearchDLL_UDF.au3" Quick Start
Basic Image Search
#include "ImageSearchDLL_UDF.au3" ; Search for a button on screen Local $aResult = _ImageSearch("button.png") If $aResult[0] > 0 Then ConsoleWrite("Found at: " & $aResult[1][0] & ", " & $aResult[1][1] & @CRLF) MouseClick("left", $aResult[1][0], $aResult[1][1]) Else ConsoleWrite("Image not found" & @CRLF) EndIf Wait for Image and Click
; Wait up to 5 seconds for button to appear, then click it If _ImageSearch_WaitClick(5000, "button.png") Then MsgBox(0, "Success", "Button clicked!") Else MsgBox(0, "Failed", "Button not found within 5 seconds") EndIf Screen Capture
; Capture a region and save as PNG _ImageSearch_ScreenCapture_SaveImage(@ScriptDir & "\screenshot.png", 100, 100, 600, 400) ; Capture full screen _ImageSearch_ScreenCapture_SaveImage(@ScriptDir & "\fullscreen.png") API Reference
Startup & Configuration
_ImageSearch_Startup()
Initializes the ImageSearch library by loading the appropriate DLL.
Returns:
Success: 1 (DLL loaded successfully) Failure: 0 and sets @error Remarks:
Must be called before using any search functions Automatically called on script start DLL v3.5+ uses thread-local DPI awareness and won't affect AutoIt GUI
_ImageSearch_Shutdown()
Closes the DLL and cleans up resources.
_ImageSearch_SetDllPath($sPath)
Sets a custom DLL path (must be called before _ImageSearch_Startup).
Parameters:
$sPath - Full path to the DLL file Returns:
Success: 1 Failure: 0 (file not found)
Core Search Functions
_ImageSearch($sImagePath [, $iLeft, $iTop, $iRight, $iBottom [, $iScreen [, $iTolerance [, $iResults [, $iCenterPOS [, $fMinScale [, $fMaxScale [, $fScaleStep [, $iReturnDebug [, $iUseCache]]]]]]]])
Searches for an image within a specified screen area.
Parameters:
$sImagePath - Image file path(s), multiple separated by "|" $iLeft, $iTop, $iRight, $iBottom - Search region (0 = entire screen) $iScreen - Monitor index (-1 = virtual screen, 0 = primary, 1+ = specific monitor) $iTolerance - Color tolerance 0-255 (default: 10) $iResults - Max results 1-1024 (default: 1) $iCenterPOS - Return center (1) or top-left (0) coordinates (default: 1) $fMinScale, $fMaxScale - Scale range 0.1-5.0 (default: 1.0) $fScaleStep - Scale step (default: 0.1) $iReturnDebug - Debug mode (default: 0) $iUseCache - Enable cache (default: 1) Returns:
Success: Array of found positions [count][X, Y, Width, Height] Failure: Empty array with @error set Example:
; Search for multiple images with scaling Local $aResult = _ImageSearch("icon1.png|icon2.png", 0, 0, 800, 600, -1, 10, 5, 1, 0.8, 1.2, 0.1) If $aResult[0] > 0 Then For $i = 1 To $aResult[0] ConsoleWrite("Match " & $i & " at: " & $aResult[$i][0] & ", " & $aResult[$i][1] & @CRLF) Next EndIf
_ImageSearch_InImage($sSourceImage, $sTargetImage [, $iTolerance [, $iResults [, $iCenterPOS [, $fMinScale [, $fMaxScale [, $fScaleStep [, $iReturnDebug [, $iUseCache]]]]]]]])
Searches for a target image within a source image (file-to-file search).
Parameters:
$sSourceImage - Path to source image file $sTargetImage - Path to target image file(s), multiple separated by "|" Other parameters same as _ImageSearch Returns: Same as _ImageSearch
Remarks: Useful for pre-processing images or testing without screen capture
Example:
$aResult = _ImageSearch_InImage("screenshot.png", "button.png", 20)
_ImageSearch_hBitmap($hBitmapSource, $hBitmapTarget [, $iTolerance [, $iLeft [, $iTop [, $iRight [, $iBottom [, $iResults [, $iCenterPOS [, $fMinScale [, $fMaxScale [, $fScaleStep [, $iReturnDebug [, $iUseCache]]]]]]]]]]]])
Searches for a target bitmap within a source bitmap (memory-to-memory search).
Parameters:
$hBitmapSource - Handle to source bitmap (HBITMAP) $hBitmapTarget - Handle to target bitmap (HBITMAP) Other parameters same as _ImageSearch Returns: Same as _ImageSearch
Remarks:
Fastest method for repeated searches (no disk I/O) Bitmaps must be created with GDI/GDI+ functions
Screen Capture Functions
_ImageSearch_CaptureScreen([$iLeft, $iTop, $iRight, $iBottom [, $iScreen]])
Capture screen region and return as HBITMAP handle.
Parameters:
$iLeft, $iTop, $iRight, $iBottom - Capture region (default: 0 = full screen) $iScreen - Monitor index (default: -1 = virtual screen) Returns:
Success: HBITMAP handle (must DeleteObject when done) Failure: 0 and sets @error Example:
$hBitmap = _ImageSearch_CaptureScreen(0, 0, 800, 600) ; ... use $hBitmap ... _WinAPI_DeleteObject($hBitmap)
_ImageSearch_ScreenCapture_SaveImage($sImageFile [, $iLeft [, $iTop [, $iRight [, $iBottom [, $iScreen]]]]])
Captures a screen region and saves it directly to an image file in one call.
Parameters:
$sImageFile - Output file path (extension determines format: .bmp, .png, .jpg/.jpeg) $iLeft, $iTop, $iRight, $iBottom - Capture region (default: 0 = full screen) $iScreen - Monitor index (default: 0 = primary screen) Returns:
Success: True (1) Failure: False (0) and sets @error Remarks:
Automatically detects format from file extension ~2x faster than separate capture + save operations JPEG quality is fixed at 100% (highest quality) Uses DPI-aware capture (accurate on all DPI scales) Example:
; Capture full primary screen to PNG _ImageSearch_ScreenCapture_SaveImage(@ScriptDir & "\screenshot.png") ; Capture region on monitor 2 to JPEG _ImageSearch_ScreenCapture_SaveImage(@ScriptDir & "\region.jpg", 100, 100, 600, 400, 2)
_ImageSearch_hBitmapLoad($sImageFile [, $iAlpha [, $iRed [, $iGreen [, $iBlue]]]])
Load image file and convert to HBITMAP handle.
Parameters:
$sImageFile - Path to image file $iAlpha, $iRed, $iGreen, $iBlue - Background color components 0-255 (default: 0 = transparent) Returns:
Success: HBITMAP handle (must DeleteObject when done) Failure: 0 and sets @error Example:
$hBitmap = _ImageSearch_hBitmapLoad("image.png", 255, 255, 255, 255) ; White background ; ... use $hBitmap ... _WinAPI_DeleteObject($hBitmap)
Mouse Functions
_ImageSearch_MouseMove($iX, $iY [, $iSpeed [, $iScreen]])
Moves mouse cursor to coordinates (supports negative coordinates on multi-monitor).
Parameters:
$iX, $iY - Target coordinates (-1 = keep current position) $iSpeed - Speed 0-100 (0=instant, default: 0) $iScreen - Monitor index (default: -1 = virtual screen) Returns: 1 on success, 0 on failure
_ImageSearch_MouseClick([$sButton [, $iX [, $iY [, $iClicks [, $iSpeed [, $iScreen]]]]]])
Clicks mouse at coordinates (screen or current position).
Parameters:
$sButton - Button: "left", "right", "middle" (default: "left") $iX, $iY - Coordinates (-1 = current position) $iClicks - Number of clicks (default: 1) $iSpeed - Speed 0-100 (0=instant, default: 0) $iScreen - Monitor index (default: -1 = virtual screen) Returns: 1 on success, 0 on failure
_ImageSearch_MouseClickWin($sTitle, $sText, $iX, $iY [, $sButton [, $iClicks [, $iSpeed]]])
Clicks mouse in a window.
Parameters:
$sTitle - Window title/class/handle $sText - Window text $iX, $iY - Relative coordinates in window $sButton - Button (default: "left") $iClicks - Number of clicks (default: 1) $iSpeed - Speed 0-100 (default: 0) Returns: 1 on success, 0 on failure
Wait & Click Functions
_ImageSearch_Wait($iTimeout, $sImagePath [, $iLeft [, $iTop [, $iRight [, $iBottom [, $iScreen [, $iTolerance [, $iResults [, $iCenterPOS [, $fMinScale [, $fMaxScale [, $fScaleStep [, $iReturnDebug [, $iUseCache [, $iMaxAttempts]]]]]]]]]]]]])
Waits for an image to appear on screen with timeout and optional max attempts limit.
Parameters:
$iTimeout - Timeout in milliseconds (0 = wait forever) $sImagePath - Image file path(s), multiple separated by "|" $iMaxAttempts - Max number of search attempts (0 = unlimited, default: 0) Other parameters same as _ImageSearch Returns:
Success: 2D Array (same as _ImageSearch) Timeout: Empty array with [0][0] = 0 Example:
; Wait 5 seconds for button (unlimited attempts) $aResult = _ImageSearch_Wait(5000, "button.png") If $aResult[0] > 0 Then MouseClick("left", $aResult[1][0], $aResult[1][1]) Else MsgBox(0, "Timeout", "Button not found") EndIf
_ImageSearch_WaitClick($iTimeout, $sImagePath [, $sButton [, $iClicks [, $iLeft [, $iTop [, $iRight [, $iBottom [, $iScreen [, $iTolerance [, $iResults [, $iCenterPOS [, $fMinScale [, $fMaxScale [, $fScaleStep [, $iReturnDebug [, $iUseCache]]]]]]]]]]]]])
Waits for an image and clicks it when found.
Parameters:
$iTimeout - Timeout in milliseconds (0 = wait forever) $sImagePath - Image file path(s) $sButton - Mouse button: "left", "right", "middle" (default: "left") $iClicks - Number of clicks (default: 1) Other parameters same as _ImageSearch Returns:
Success: 1 (image found and clicked) Timeout: 0 (image not found)
Monitor Functions
_ImageSearch_Monitor_GetList()
Gets a list of all connected display monitors and their properties.
Returns:
Success: The number of monitors found. @extended contains a detailed log. Failure: 0 and sets @error Remarks:
Populates the global $g_aMonitorList Called automatically by _ImageSearch_Startup
_ImageSearch_Monitor_ToVirtual($iMonitor, $iX, $iY)
Converts local monitor coordinates to virtual screen coordinates.
Parameters:
$iMonitor - The 1-based index of the monitor $iX, $iY - Coordinates relative to the monitor's top-left corner Returns:
Success: A 2-element array [$vX, $vY] containing virtual screen coordinates Failure: 0 and sets @error
_ImageSearch_Monitor_FromVirtual($iMonitor, $iX, $iY)
Converts virtual screen coordinates to local monitor coordinates.
Parameters:
$iMonitor - The 1-based index of the monitor $iX, $iY - Virtual screen coordinates Returns:
Success: A 2-element array [$lX, $lY] containing local monitor coordinates Failure: 0 and sets @error
_ImageSearch_Monitor_Current()
Detects which monitor contains the current mouse cursor position.
Returns:
Success: Monitor index (1-based) where the cursor is located Failure: 0 and sets @error
_ImageSearch_Monitor_GetAtPosition([$iX [, $iY]])
Returns detailed information string about the monitor at specified position.
Parameters:
$iX, $iY - Coordinates (default: -1 = use mouse cursor position) Returns:
Success: String describing the monitor (e.g., "Monitor 2: 1920x1080 (Primary)") Failure: Error message string
Window Coordinate Functions
_ImageSearch_Window_ToScreen($hWnd, $iX, $iY [, $bClientArea])
Converts window-relative coordinates to screen (virtual desktop) coordinates.
Parameters:
$hWnd - Window handle or title $iX, $iY - Coordinates relative to window $bClientArea - True = relative to client area, False = relative to window (default: True) Returns:
Success: A 2-element array [$screenX, $screenY] containing screen coordinates Failure: 0 and sets @error
_ImageSearch_Window_FromScreen($hWnd, $iScreenX, $iScreenY [, $bClientArea])
Converts screen (virtual desktop) coordinates to window-relative coordinates.
Parameters:
$hWnd - Window handle or title $iScreenX, $iScreenY - Screen coordinates $bClientArea - True = relative to client area, False = relative to window (default: True) Returns:
Success: A 2-element array [$winX, $winY] containing window-relative coordinates Failure: 0 and sets @error
Cache & Info Functions
_ImageSearch_WarmUpCache($sImagePaths [, $bEnableCache])
Pre-loads images into cache for faster subsequent searches.
Parameters:
$sImagePaths - Pipe-separated list of images to preload $bEnableCache - Enable persistent cache (default: True) Returns:
Success: Number of images cached Failure: 0 Example:
_ImageSearch_WarmUpCache("btn1.png|btn2.png|icon.png")
_ImageSearch_ClearCache()
Clears the internal bitmap and location cache.
Remarks:
Useful for freeing memory or forcing re-scan after image updates Clears both in-memory cache and persistent disk cache
_ImageSearch_GetDllInfo([$bForceRefresh])
Gets comprehensive DLL information in INI format.
Parameters:
$bForceRefresh - Force refresh of cached info (default: True) Returns: Multi-line string in INI format with sections:
[DLL] - DLL name, version, architecture, author [OS] - OS name, version, build, platform [CPU] - Threads, SSE2, AVX2, AVX512 support [SCREEN] - Virtual screen, scale, monitors with individual resolutions [CACHE] - Location cache, bitmap cache, pool size
_ImageSearch_GetInfo()
Gets formatted DLL and system information for display.
Returns: Formatted string with DLL info, cache status, and screen information
_ImageSearch_GetDllValue($sSection, $sKey)
Quick accessor to read any value from cached DLL Info.
Parameters:
$sSection - Section name (DLL, OS, CPU, SCREEN, CACHE) $sKey - Key name Returns: Value string or "" if not found
Example:
$sVersion = _ImageSearch_GetDllValue("DLL", "Version") $sOSName = _ImageSearch_GetDllValue("OS", "Name") $iThreads = _ImageSearch_GetDllValue("CPU", "Threads")
_ImageSearch_GetLastResult()
Gets the raw DLL return string from the last search.
Returns: Raw result string (e.g., "{2}[100|200|32|32,150|250|32|32]")
Remarks: Useful for debugging or custom parsing
_ImageSearch_GetScale([$iScreen])
Gets the DPI scale factor for a specific monitor as a decimal number.
Parameters:
$iScreen - Monitor index (0 = Primary, 1+ = specific monitor number) Returns: Scale factor as number (e.g., 1.0, 1.25, 1.5) or 0 if not found
Example:
$fScale = _ImageSearch_GetScale(0) ; Get primary monitor scale (e.g., 1.25) $fScale = _ImageSearch_GetScale(2) ; Get monitor 2 scale
Examples
Advanced Search with Multiple Images and Scaling
#include "ImageSearchDLL_UDF.au3" ; Search for multiple UI elements with different scales Local $sImages = "button_ok.png|button_cancel.png|icon_settings.png" Local $aResult = _ImageSearch($sImages, 0, 0, 1920, 1080, -1, 15, 10, 1, 0.8, 1.3, 0.1, 0, 1) If $aResult[0] > 0 Then ConsoleWrite("Found " & $aResult[0] & " matches:" & @CRLF) For $i = 1 To $aResult[0] ConsoleWrite(" Match " & $i & ": X=" & $aResult[$i][0] & ", Y=" & $aResult[$i][1] & ", W=" & $aResult[$i][2] & ", H=" & $aResult[$i][3] & @CRLF) Next Else ConsoleWrite("No matches found" & @CRLF) EndIf Multi-Monitor Screen Capture
#include "ImageSearchDLL_UDF.au3" ; Get monitor information _ImageSearch_Monitor_GetList() ConsoleWrite("Detected " & $g_aMonitorList[0][0] & " monitors" & @CRLF) ; Capture each monitor separately For $i = 1 To $g_aMonitorList[0][0] Local $sFile = @ScriptDir & "\monitor_" & $i & ".png" _ImageSearch_ScreenCapture_SaveImage($sFile, 0, 0, 0, 0, $i) ConsoleWrite("Captured monitor " & $i & " to: " & $sFile & @CRLF) Next ; Capture entire virtual desktop _ImageSearch_ScreenCapture_SaveImage(@ScriptDir & "\virtual_desktop.png", 0, 0, 0, 0, -1) Automated UI Testing
#include "ImageSearchDLL_UDF.au3" ; Pre-load images for better performance _ImageSearch_WarmUpCache("login_button.png|username_field.png|password_field.png") ; Wait for login screen and interact If _ImageSearch_WaitClick(10000, "login_button.png") Then ConsoleWrite("Login button clicked" & @CRLF) ; Find username field and click Local $aUsername = _ImageSearch_Wait(5000, "username_field.png") If $aUsername[0] > 0 Then MouseClick("left", $aUsername[1][0], $aUsername[1][1]) Send("myusername") ; Find password field and click Local $aPassword = _ImageSearch_Wait(5000, "password_field.png") If $aPassword[0] > 0 Then MouseClick("left", $aPassword[1][0], $aPassword[1][1]) Send("mypassword") Send("{ENTER}") EndIf EndIf Else MsgBox(0, "Error", "Login screen not found within 10 seconds") EndIf Error Codes
Code Constant Description -1 $IMGSE_INVALID_PATH Invalid file path -2 $IMGSE_FAILED_TO_LOAD_IMAGE Failed to load image -3 $IMGSE_FAILED_TO_GET_SCREEN_DC Failed to get screen device context -4 $IMGSE_INVALID_SEARCH_REGION Invalid search region -5 $IMGSE_INVALID_PARAMETERS Invalid parameters -6 $IMGSE_INVALID_SOURCE_BITMAP Invalid source bitmap -7 $IMGSE_INVALID_TARGET_BITMAP Invalid target bitmap -9 $IMGSE_RESULT_TOO_LARGE Result too large -10 $IMGSE_INVALID_MONITOR Invalid monitor Performance Tips
Use Cache: Enable cache for repeated searches to get 30-50% speed boost Pre-load Images: Use _ImageSearch_WarmUpCache() during initialization Limit Search Area: Specify search regions instead of full screen when possible Optimize Tolerance: Use appropriate tolerance values (5-15 for most cases) Use Appropriate Scale Range: Limit scale range to what you actually need Monitor Selection: Use specific monitor index for faster searches on multi-monitor setups Image Format: BMP files load faster than PNG/JPG but are larger Memory Management: Always call _WinAPI_DeleteObject() for HBITMAP handles Changelog
Version 3.5
Added thread-local DPI awareness (no GUI resize issues) Enhanced multi-monitor support with individual monitor scales Improved cache system with persistent disk cache Added _ImageSearch_ScreenCapture_SaveImage() for direct file saving Performance optimizations with SIMD instructions Better error handling and debugging information License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Dao Van Trong - TRONG.PRO
Thank you for using ImageSearch UDF! 🚀
☕ Support My Work
Enjoy my work? Buy me a 🍻 or tip via ❤️ PayPal
Happy Automating! 🚀
___________________________
11,665 downloads
- imagesearch
- image search udf
- (and 2 more)
-
MemoryUDF
By Trong
MemoryUDF - AutoIt Memory Management & Assembly Library
A comprehensive AutoIt User Defined Function (UDF) library for advanced memory manipulation and inline assembly execution. This library provides powerful tools for reading/writing process memory, pointer chain traversal, pattern scanning, and assembly code injection.
Features
Memory Operations
Process Memory Access: Read/write memory from external processes Pointer Chain Support: Navigate complex pointer structures with x86/x64 compatibility Module Management: Get base addresses and sizes of loaded modules Memory Protection: Change memory protection flags Memory Utilities: Copy, fill, compare, and dump memory regions Assembly & Code Injection
Inline Assembly: Compile and execute machine code directly Code Injection: Inject assembly code into remote processes Function Hooking: Hook and unhook functions with jump patches Code Cave Creation: Create NOP sleds for code modification Assembly Helpers: Generate common x86 instructions programmatically Pattern Scanning & Search
Pattern Scanning: Search for byte patterns with wildcard support String Search: Find ASCII/Unicode strings in memory (case-sensitive/insensitive) Value Search: Search for integers, floats, and hex sequences AOB Scanning: Array of Bytes scanning with wildcard support Region Scanning: Scan entire module memory regions Advanced Features
Memory Snapshots: Compare memory states to detect changes Array Operations: Read/write arrays of values efficiently String Operations: Handle null-terminated strings (ASCII/Unicode) Memory Freezing: Continuously write values to addresses Page Information: Query memory page properties Requirements
AutoIt Version: 3.3.14+ Operating System: Windows (x86/x64) Required DLLs: Kernel32.dll, Psapi.dll, User32.dll Privileges: SeDebugPrivilege recommended for external process access Installation
Download MemoryUDF.au3 Include in your AutoIt script: #include "MemoryUDF.au3" Quick Start
Basic Memory Reading
; Enable debug privilege for external process access _Memory_SetPrivilege("SeDebugPrivilege", True) ; Open process handle Local $ahHandle = _Memory_Open("notepad.exe") If Not @error Then ; Read a 4-byte integer from memory Local $iValue = _Memory_Read($ahHandle, 0x12345678, "int") ConsoleWrite("Value: " & $iValue & @CRLF) ; Close handle when done _Memory_Close($ahHandle) EndIf Pointer Chain Navigation
Local $ahHandle = _Memory_Open("AppX.exe") If Not @error Then ; Get module base address Local $iModuleBase = _Memory_GetModuleBaseAddress($ahHandle, "AppX.dll") ; Define pointer chain offsets Local $aOffsets[3] = [0x28, 0x1D8, 0x6C0] ; Read value through pointer chain Local $iValue = _Memory_ReadPointer($ahHandle, $iModuleBase + 0x123456, $aOffsets, "int") ConsoleWrite("Battery: " & $iValue & @CRLF) _Memory_Close($ahHandle) EndIf Assembly Code Execution
; Execute inline assembly (MOV EAX, 42; RET) Local $iResult = _ASM_QuickExecute("B82A000000C3") ConsoleWrite("Assembly result: " & $iResult & @CRLF) ; Output: 42 Pattern Scanning
Local $ahHandle = _Memory_Open("AppX.exe") If Not @error Then Local $iModuleBase = _Memory_GetModuleBaseAddress($ahHandle, "AppX.exe") ; Search for byte pattern with wildcards Local $iAddress = _Memory_PatternScan($ahHandle, $iModuleBase, 0x100000, "8B 0D ?? ?? ?? ?? 85 C9") If Not @error Then ConsoleWrite("Pattern found at: 0x" & Hex($iAddress) & @CRLF) EndIf _Memory_Close($ahHandle) EndIf Core Functions
Memory Management
_Memory_Open($vProcess, $iAccess, $bInherit) - Open process handle _Memory_Close($ahHandle) - Close process handle _Memory_Read($ahHandle, $iAddress, $sType) - Read memory value _Memory_Write($ahHandle, $iAddress, $vData, $sType) - Write memory value _Memory_ReadPointer($ahHandle, $iBaseAddress, $aOffsets, $sType) - Read through pointer chain _Memory_WritePointer($ahHandle, $iBaseAddress, $aOffsets, $vData, $sType) - Write through pointer chain Module Operations
_Memory_GetModuleBaseAddress($ahHandle, $sModule) - Get module base address _Memory_GetProcessBaseAddress($ahHandle) - Get main executable base address _Memory_GetProcessModules($ahHandle) - List all process modules _Memory_GetModuleSize($ahHandle, $sModule) - Get module size Assembly Functions
_ASM_Compile($sHexCode) - Compile hex machine code to executable memory _ASM_Execute($pCode, $iParam1, $iParam2, $iParam3, $iParam4) - Execute compiled code _ASM_Free($pCode) - Free compiled code memory _ASM_QuickExecute($sHexCode) - Compile and execute in one call _ASM_Inject($ahHandle, $sHexCode, $bAutoFree) - Inject code into remote process Pattern Scanning
_Memory_PatternScan($ahHandle, $iStartAddress, $iSize, $sPattern) - Find first pattern match _Memory_PatternScanAll($ahHandle, $iStartAddress, $iSize, $sPattern, $iMaxResults) - Find all matches _Memory_StringSearch($ahHandle, $iStartAddress, $iSize, $sString, $bUnicode, $bCaseSensitive) - Search for strings _Memory_IntegerSearch($ahHandle, $iStartAddress, $iSize, $iValue, $sType) - Search for integer values _Memory_FloatSearch($ahHandle, $iStartAddress, $iSize, $fValue, $bDouble) - Search for float values Assembly Helpers
_ASM_CreateJump($iFrom, $iTo, $bShort) - Generate JMP instruction _ASM_CreateCall($iFrom, $iTo) - Generate CALL instruction _ASM_CreatePush($iValue) - Generate PUSH instruction _ASM_CreateMov($iRegister, $iValue) - Generate MOV instruction _ASM_CreateNOP($iCount) - Generate NOP sled _ASM_CreateRet($iPopBytes) - Generate RET instruction Function Hooking
_ASM_HookFunction($ahHandle, $iTargetAddress, $iHookAddress, $iNOPCount) - Hook function _ASM_UnhookFunction($ahHandle, $iTargetAddress, $sOriginalBytes) - Restore original function Utility Functions
_Memory_Protect($ahHandle, $iAddress, $iSize, $iProtection) - Change memory protection _Memory_ReadString($ahHandle, $iAddress, $iMaxLength, $bUnicode) - Read null-terminated string _Memory_WriteString($ahHandle, $iAddress, $sString, $bUnicode, $bNullTerminate) - Write string _Memory_ReadArray($ahHandle, $iAddress, $iCount, $sType) - Read array of values _Memory_WriteArray($ahHandle, $iAddress, $aArray, $sType) - Write array of values _Memory_Copy($ahHandle, $iSourceAddress, $iDestAddress, $iSize) - Copy memory region _Memory_Fill($ahHandle, $iAddress, $iSize, $iByte) - Fill memory with byte value _Memory_Compare($ahHandle, $iAddress1, $iAddress2, $iSize) - Compare memory regions _Memory_DumpRegion($ahHandle, $iAddress, $iSize) - Dump memory to hex string Data Types
Supported data types for memory operations:
"byte" - 1 byte (0-255) "word", "short" - 2 bytes "int", "dword" - 4 bytes (default) "int64", "uint64" - 8 bytes "float" - 4-byte floating point "double" - 8-byte floating point "ptr" - Pointer size (4 bytes on x86, 8 bytes on x64) Constants
Process Access Rights
$PROCESS_ALL_ACCESS - Full access rights $PROCESS_VM_READ - Read memory access $PROCESS_VM_WRITE - Write memory access $PROCESS_VM_OPERATION - Memory operation access Memory Protection
$PAGE_EXECUTE_READWRITE - Execute, read, and write access $MEM_COMMIT - Commit memory pages $MEM_RESERVE - Reserve memory pages $MEM_RELEASE - Release memory pages Assembly Registers
8-bit: $AL, $CL, $DL, $BL, $AH, $CH, $DH, $BH 16-bit: $AX, $CX, $DX, $BX, $SP, $BP, $SI, $DI 32-bit: $EAX, $ECX, $EDX, $EBX, $ESP, $EBP, $ESI, $EDI 64-bit: $RAX, $RCX, $RDX, $RBX, $RSP, $RBP, $RSI, $RDI, $R8-$R15 Error Handling
All functions use AutoIt's @error system for error reporting:
@error = 0 - Success @error > 0 - Error occurred (check function documentation for specific error codes) Always check @error after function calls:
Local $iValue = _Memory_Read($ahHandle, $iAddress, "int") If @error Then ConsoleWrite("Error reading memory: " & @error & @CRLF) Else ConsoleWrite("Value: " & $iValue & @CRLF) EndIf Best Practices
Enable Debug Privilege: Call _Memory_SetPrivilege("SeDebugPrivilege", True) before accessing external processes Handle Cleanup: Always call _Memory_Close() to free resources Check Errors: Verify @error after each function call Use Appropriate Types: Choose the correct data type for your memory operations Validate Addresses: Ensure memory addresses are valid before access Test Patterns: Verify pattern strings are correctly formatted with spaces Security Considerations
This library requires elevated privileges for external process access Memory manipulation can cause application crashes or system instability Always validate input parameters and memory addresses Use appropriate error handling to prevent unexpected behavior Be cautious when injecting code into critical system processes Compatibility
Architecture: Supports both x86 and x64 processes AutoIt: Compatible with AutoIt 3.3.14 and later versions Windows: Works on Windows Vista and later versions Processes: Can access both 32-bit and 64-bit processes (with appropriate AutoIt version) Author
Dao Van Trong - TRONG.PRO
License
This UDF is provided as-is for educational and development purposes. Use responsibly and in accordance with applicable laws and regulations.
256 downloads
-
ImageSearch Automation Suite
By Trong
An ultimate, professional GUI tool for complex, configurable image search tasks, built upon the high-performance ImageSearch UDF.
Include ImageSearch UDF Embedded dll
169 downloads
(0 reviews)0 comments
Updated
-
AutoIt Embedded File Generator
By Trong
A professional tool to convert binary files into self-contained AutoIt hex functions.
Features architecture detection, GUI and CLI modes, and robust code generation.
82 downloads
(0 reviews)0 comments
Updated
-
syncthing --no-browser --no-console.exe
By argumentum
Running "syncthing --no-browser --no-console" used to run syncthing with "no-console" but for some reason it doesn't in Win11.
Therefore a hider is needed and after trying the solutions I found online and failing me, I coded one given that is very simple to do in AutoIt.
The file password is 123
Read more about it at
51 downloads
(0 reviews)0 comments
Updated
-
open-webui-ToTray
By argumentum
open-webui is a nice toy but leaves the command prompt where it runs visible and I wanted to hide it, or move it to the tray. Solution ?, code it.
So here is the open-webui-ToTray I wanted.
Tested just on my PC with Win11. If you need something fixed, go to the help area and we'll chat.
113 downloads
(0 reviews)0 comments
Updated
-
ADAudit - Active Directory Report
By water
On one/multiple big sheet(s) you get users (columns) and groups (rows). The list is sorted descending by number of members so you get the users with most groups and the groups with most members on top of the page. You can filter by (multiple) samaccountname(s), department or you can create your own LDAP query filter. You can filter the resulting list of groups using a Regular Expression.
Version 2.0 uses maps so at the moment it requires the latest beta version of AutoIt!
BTW: If you like this tool please click the "I like this" button. This tells me where to next put my development effort
1,253 downloads
(0 reviews)0 comments
Updated
-
OutlookEX
By water
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API.
There are other UDFs available to automate Outlook:
OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
KNOWN BUGS (last changed: 2020-02-09)
None10,997 downloads
-
Task Scheduler
By water
Extensive library to control and manipulate Microsoft Task Scheduler Service.
Please check this site for the implementation status! Please check the History.txt file in the archive for the changelog. Please check the WIKI for details about how to use the UDF.
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
KNOWN BUGS (last changed: 2021-02-03)
None Things to come (last changed: 2021-02-03)
None3,082 downloads
-
AD - Active Directory UDF
By water
Extensive library to control and manipulate Microsoft Active Directory.
Threads: Development - General Help & Support - Example Scripts - Wiki
Previous downloads: 30467
Known Bugs: (last changed: 2020-10-05)
None Things to come: (last changed: 2020-07-21)
None
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
18,773 downloads
-
SetMicForPlayback
By argumentum
The reason for this you can read at https://www.autoitscript.com/forum/topic/196727-set-microphone-for-playback-device/
Runs on it's own without user interaction needed.
When you "Select a playback device", it will select the
corresponding microphone, or leave it as is, if one is not matched.
It was coded on my PC ( a Windows 10 ), I have no more PCs to test if
it will work on other configurations but by right-click the tray icon,
a context menu will give you the option to see the list array of
devices found and that may serve to aid in case this program need
to be tweaked to better fit other setups.
It did not run on a VM of WinXP, so if your OS is old, it may very
well not have support for the COM calls this program uses to operate.
I should also advise to run and/or compile with v3.3.14.5. "OnEvent" is too slow in newer versions for this code.
11,463 downloads
(0 reviews)0 comments
Updated
-
String Trigger
By careca
This is my take on string triggers, triggers on specific strings.
Able to simple text pasting,
opening links (as long as there's a www. http:\\ or https:\\ at the beggining)
and is able to open applications, if there is a parameter in the parameter field, it uses it.
Shows your lan, and gateway ip's, and opens them on a browser uppon click.
Able to change system volume by a set percentage, reading from the inputbox the number the user sets, if 0 or empty uses system default.
I made this because the existing string trigger applications didn't do it for me.
1,223 downloads
- string trigger
- string
- (and 1 more)
-
OutlookTools
By water
Built on top of the OutlookEX UDF it offers some often needed extended functionality (import/export ics/vcf/csv files etc.) (former name: iCal UDF).
Note: This is a beta version - script breaking changes may occur at any time!
Prerequisite: OutlookEX UDF.
Details about all functions can be found in the Wiki.
ICS (iCalendar) import - Import iCal events from an ICS file to an Outlook calendar
VCF (vCard) import - Import vCard contacts to an Outlook contacts folder
CSV import - Import data from a CSV file and create Outlook items in a specified folder
Export - Export Outlook items (contacts, appointments) in VCF, ICS, CSV or Excel format
Links:
https://tools.ietf.org/html/rfc5545 (ICS - iCalendar)
https://tools.ietf.org/html/rfc6350 (VCF - vCard)
Threads:
General Help & Support
Known Bugs: (last changed: 2019-01-22)
None
Things to come: (last changed: 2022-01-25)
Support for EML mails (email contents as plain text in MIME format) will be added
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
1,777 downloads
(0 reviews)0 comments
Updated
-
Simple Library Docs Generator
By water
ATTENTION! THIS IS STILL WORK IN PROGRESS!
This is the modified version of MrCreatoR's "Simple Library Docs Generator".
It allows to create CHM help files that look like the AutoIt help file.
In additon this CHM files can then be used with Advanced.Help.
This a very early alpha version - so it is miles away from being perfect. It's just something for you to play with.
The documentation is in the making and will be published as soon as possible.
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
1,067 downloads
- simple library docs generator
- chm
- (and 1 more)
(0 reviews)0 comments
Updated
-
MirrorDir
By careca
This is a folder backup tool, after i got tired of using tools made by others, that had either lack of functionality,
or were overly complex, i decided to make my own, and this is it.
MirrorDir mirrors dirs as the name says, simply select source and destination hit scan, review in the list if that's what you want it to do and press start copy.
As this is a mirror sync tool, this means files that exist in destination but dont exist in source are marked for deletion.
Other tools have other modes like the incrementing copy which does not delete anything, but i made this for me,
only if there is a request i may think about adding features just for fun.
Whats more? There's a save/load of profile and the profile is what contains the list of source and destination folders, these are kept in prefs.ini in folder MDir in local appdata.
There are context menu's that allow for the removal of items from the profile list, either just for the list (in case you dont want to sync a specific folder, just this time)
or delete from the list and the .ini .
Best regards.
1,104 downloads
(0 reviews)0 comments
Updated
-
Regedit Control
By careca
Hello, this is a tool made to be used with regedit, it starts regedit when run, then saves a list of the paths in registry the user browsed, on double click in the "history" list, it jumps to that key, it has 2 methods of jump, one is through favorites, the other through "lastkey".
In certain cases you can use the context menu "follow" in keys like
HKEY_CLASSES_ROOT\.abc
to jump to
HKEY_CLASSES_ROOT\abcfile
As an example.
The other context menu is "Clear", and its obvious it clears the listview.
Best regards.
719 downloads
(1 review)0 comments
Updated
-
PowerPoint UDF
By water
Extensive library to control and manipulate Microsoft PowerPoint.
Threads: Help & Support, Wiki
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
1,942 downloads
-
OutlookEX_GUI
By water
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate the Outlook GUI.
There are other UDFs available to automate Outlook:
OutlookEX: Automates the processing of items (folders, mails, contacts ...) in the background. Can be seen like an API. OutlookTools: Allows to import/export contacts and events to VCF/ICS files.
Theads: Development - General Help & Support - Example Scripts - Wiki
Known Bugs: (last changed: 2020-03-27)
None Things to come: (last changed: 2020-03-27)
None
BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
1,955 downloads
- outlookexgui
- outlook gui
- (and 1 more)
(0 reviews)0 comments
Updated
-
Acro.au3
By seadoggie01
A collection of functions for accessing and manipulating PDFs though Adobe Acrobat Pro
553 downloads
(0 reviews)0 comments
Updated
-
Renamer
By careca
Hi, this is a tool to change folders or files names, very simple, drag or choose folder, write what you want the application to search for,
write what you want it to be replaced with, select folders or files, case-sensitive or not, recursive or not and Go.
Example: change all files that have 123 in their name to nothing (aka remove "123")
so we write 123 in the "search", and leave the "replacement" field blank.
file "123abc.exe" will become abc.exe
file "456trt123.txt" Becomes "456trt.txt"
As i said, simple.
723 downloads
(0 reviews)0 comments
Updated
-
Personal Function Documentation
By seadoggie01
A SciTE integrate-able script for easily accessing UDF Headers in your personal scripts.
401 downloads
(0 reviews)0 comments
Updated
-
GUICtrlTuner_Limitless.au3
By Deye
Macro Usage :
2 ways for selecting more than one control
Holding the X while selecting or drawing a temp rectangle over desired controls
Mouse wheel to cycle through previous selections of checks
Mouse wheel+ CTRL = As an alternative to using Undo\Redo (buttons)
key combo's :
+ SHIFT When needing to Perform actions while keeping the checked controls in check, for instance, when dragging a group of checked controls @ keeping them checked (See Aligning options for the other use)
+ Space-Bar For applying actions to all controls Specified in a preset where only one of the controls belonging to the same preset is actually checked
+ CTRL Makes an action continues
+ ALT Resize actions
+ CTRL Click a control that belongs to a configured preset, makes all the other controls in that preset to get Checked (or Unchecked - with another CTRL + click)
Tabs :
In order to move controls into tabs you will need to drag the control\s on to a tab label other then the one selected
so if you want a control\s to go into a tab labeled :"one" first select some other tab then you can drag drop the control\s on to the tab labeled "one"
Aligning options:
Checked items are parameterized by right clicking any odd control which is checked or unchecked (in the group or out of the group \ anywhere), using its size or position as a parameter for the chosen sizing action on whatever controls that are shown as checked in the control pannel Gui
In cases where more than one control are checked. The aligning will aim to size the group of controls relatively to each other, if you will need the sizing to be absolute when using the "equal in" :"Top", "Bottom", "Left", "Right" "Size", Width", "Height" than hold down the SHIFT key while clicking or choosing an action
How to have Equal spacing between groups (Shift+SpaceBar_Combo_Demo.flv).7z
591 downloads
-
_ClipFileToVar
By Deye
This is for reading a file and converting it to a paste-able $Var
Double clicking the executable sends a copy of the executable to the windows explorer SendTo directory
Usage: right click any text file (needed for your script) bringing explorer's context menu and and selecting ( Send To > _ClipFileToVar. Exe )
Whatever option you get selected from the GUI's options will fill the output to the clipboard where you then can paste the result straight into your main script
the options are
converting text files:
considering line breaks and shortening empty lines + breaking lines that exceed 100 notes
all so that the output remains readable as with plain reading the file
The other option is for converting the file's read data to _Base64Encoded data
the last option fills the clipboard with the functions and an example that shows how to convert the _Base64encoded $Var back to a readable form that your script can then use
So far with what I put here, plus the example is for working with text files only
Deye
378 downloads
-
au3 (X) shell extension
By Deye
Manage UDF's and file includes as backup\restore or import\export method To register the extension: Double click the executable from inside any folder of your choosing, For instance "My Documents\UDF-Store\au3_X.exe"
To change the location of what is to be the "UDF-Store", move au3_X.exe to the new path and just repeat the above.
Starting it up :
Right click any *.au3, In the explorer context menu showing up choose the option "au3 (X)", The GUI will show up with an overview of all the action buttons + available options
471 downloads
(0 reviews)0 comments
Updated
-
RdpRunner
By argumentum
I use RDP a lot, and is not uncommon to run another session again, closing the prior connection, when minimized.
The solution?, see if the window exists. If it does, restore it, else, run it.
970 downloads