Leaderboard
Popular Content
Showing content with the highest reputation on 03/10/2014 in all areas
-
I'm pretty sure that if you are running 64 bit, the GUID in _GDIPlus_EffectCreate is transferred through the stack and not through two registers which is an impact of the current implementation. Try this #include <GDIPlus.au3> _GDIPlus_Startup() Local $hEffect = _GDIPlus_EffectCreateBlurX64(20) MsgBox( 0, "", $hEffect ) Func _GDIPlus_EffectCreateBlurX64($fRadius = 10.0, $bExpandEdge = False) If $gbGDIP_V1_0 Then Return SetError(-1, 0, 0) Local $tEffectParameters = DllStructCreate($tagGDIP_EFFECTPARAMS_Blur) DllStructSetData($tEffectParameters, "Radius", $fRadius) DllStructSetData($tEffectParameters, "ExpandEdge", $bExpandEdge) Local $hEffect = _GDIPlus_EffectCreateX64($GDIP_BlurEffectGuid) If @error Then Return SetError(@error, @extended, 0) _GDIPlus_EffectSetParameters($hEffect, $tEffectParameters) If @error Then Return SetError(@error + 10, @extended, 0) Return $hEffect EndFunc ;==>_GDIPlus_EffectCreateBlurX64 Func _GDIPlus_EffectCreateX64($sEffectGUID) If $gbGDIP_V1_0 Then Return SetError(-1, 0, 0) Local $tGUID = _WinAPI_GUIDFromString($sEffectGUID) Local $tElem = DllStructCreate("uint64[2];", DllStructGetPtr($tGUID)) Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateEffect", "ptr", DllStructGetPtr($tElem), "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[2] EndFunc ;==>_GDIPlus_EffectCreateX64 Returns $hEffect <> 0.2 points
-
BASS Function Library This library is a wrapper for the powerful Bass.DLL and add-ons (which increase the functionality of Bass.DLL). Bass.DLL is ideal for use in your applications and scripts if you want an easy way to play a vast range of music and sound files formats while keeping dependency on just Bass.dll and it's add-ons (which in turn maximizes compatibility and minimizes extra requirements for your software to run.), while retaining a small file size. The UDFs included with the release are: Bass The basic Bass library. Required with all (most) add-on libraries. Provides playback of many sound files (and streams). BassASIO (By eukalyptus) BASSASIO is basically a wrapper for ASIO drivers, with the addition of channel joining, format conversion and resampling. BassCD Allows for digital streaming and ripping of audio CDs along with analog playback support. BassFX (By eukalyptus/BrettF) An extension providing several effects, including tempo & pitch control. BassEnc (By eukalyptus) An extension that allows BASS channels to be encoded using any command-line encoder with STDIN support (LAME/OGGENC/etc), or any ACM codec. Also features Shoutcast and Icecast stream sourcing, and PCM/WAV file writing. BassSFX Provides a complete set of functions to include support for winamp, sonique, bassbox, and Windows Media Player visualization plugins. BassTags Provides a simple way to retrieve ID3 tags from stream handles. BassCB/Bass_EXT (ProgAndy) This is for advanced users. BassCB allows the playback of streams in AutoIt. BassVST Allows use of VST effect plugins. Download The download includes all of the wrapper and constants, the original download, examples for all of the previously mentioned add-ons, sample audio files (6 channel audio files also included), sample visualization plugins for BassSFx and more. Current Version: 9 Size: 7360KB AutoIt Version Required: 3.3.2.0 Changelog: /> Fixed _BassRecordGetInputName (updated production versions) +> Added Memory Examples of Bass (Thanks ProgAndy and UEZ) +> Added BassVST (Not 100% complete) +> Added BassFX Examples showing use of most functions: Pitch.au3 Reverse.au3 Tempo.au3 /> Fixed error with calling _BASS_ErrorGetCode in BASSCD.au3 /> Fixed startup functions return the wrong value (Thanks ProgAndy!) +> Added helper functions _BASS_ChannelSetVolume, _BASS_ChannelGetVolume (Thanks ProgAndy) Download Link: https://www.autoitscript.com/forum/files/file/493-basszip/ Previous versions are not supported. Patches: Patch 1 "BASS_ASIO" Fixes issues with BASS ASIO and examples. Patch 2 "BASS_FX/BASS" Fixes issues with BASS FX and BASS.1 point
-
First, thanks to arcker for his Services UDF for making this possible. It works like this: When launched, the app will install itself as a service, launch the service, then exit. The service runs in the SYSTEM account. To interact with the desktop of the currently logged on user it will get the security information from the winlogon.exe token and the user's environment from the explorer.exe token. The service will relaunch the app with these security settings and environment, then stop. On relaunch, the process will wait for the service to end then uninstall it. The process will now be running in the SYSTEM account in the currently logged on user's session with the user's environment. If you look into the _Svc_Main() function there's a note about how to relaunch the process in Session 0 (same as the service) if you need to do this. In this case it will be running solely in the SYSTEM account in Session 0 with it's own environment. I've included two more functions for when you need to access certain other user specific items, such as using the @UserName macro, or accessing the HKCU branch of the registry (these things are not taken from the environment, but from the security context of the process). You should test any macros you intend to use to make sure the correct information is returned before running your process for real. _ImpersonateUserStart() and _ImpersonateUserEnd() will enable and disable this impersonation. Keep in mind this alters your security access as well, you will have the same security level as the logged on user during this time. NOTE: For retrieval of the user environment and user impersonation it is required that explorer.exe is running. If you're using a 3rd party shell replacement, you can edit the UDF to change the requirements to another process, but I can't guarantee it will work. I've included a stripped down version of arcker's UDF, since not all of it is needed. If I could get some test results from users running XP and Vista/7 with UAC, that would be great too. Sources: Link 1 Link 2 ANY SCRIPT USING THESE FUNCTIONS MUST BE COMPILED TO WORK. IT WILL NOT WORK FROM SCITE. ADMIN RIGHTS REQUIRED AS WELL. UPDATE 1 (2009/10/29) - added a function to launch a process as the user of a currently running process in the specified session (ie, to de-elevate a process back to your user account). UPDATE 2 (2009/10/29) - fixed a wrong function export which caused problems on XP (thanks trancexxx) UPDATE 3 (2009/10/30) - I think I have a stable version now, tested on Win7, XP SP3 VM, and a physical XP SP3 box. As a bonus the service control handler now works in Win7 as well, so we can have a fully functioning service. _Services_Mini.au3 SystemElevate.au31 point
-
Hard death of Autoit x64 with GDIPlus call
this-is-me reacted to LarsJ for a topic
UEZ, I think this is a little bit faster on 64 bit and not slower on 32 bit: Func _GDIPlus_EffectCreate($sEffectGUID) If $gbGDIP_V1_0 Then Return SetError(-1, 0, 0) Local $tGUID = _WinAPI_GUIDFromString($sEffectGUID), $aResult If @AutoItX64 Then $aResult = DllCall($ghGDIPDll, "int", "GdipCreateEffect", "struct*", $tGUID, "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[2] Else Local $tElem = DllStructCreate("uint64[2];", DllStructGetPtr($tGUID)) $aResult = DllCall($ghGDIPDll, "int", "GdipCreateEffect", "uint64", DllStructGetData($tElem, 1, 1), "uint64", DllStructGetData($tElem, 1, 2), "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[3] EndIf EndFunc ;==>_GDIPlus_EffectCreate1 point -
Hard death of Autoit x64 with GDIPlus call
this-is-me reacted to UEZ for a topic
Thx, that was the solution! I suggest this modification: Func _GDIPlus_EffectCreate($sEffectGUID) If $gbGDIP_V1_0 Then Return SetError(-1, 0, 0) Local $tGUID = _WinAPI_GUIDFromString($sEffectGUID) Local $tElem = DllStructCreate("uint64[2];", DllStructGetPtr($tGUID)), $aResult If @AutoItX64 Then $aResult = DllCall($ghGDIPDll, "int", "GdipCreateEffect", "ptr", DllStructGetPtr($tElem), "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[2] EndIf $aResult = DllCall($ghGDIPDll, "int", "GdipCreateEffect", "uint64", DllStructGetData($tElem, 1, 1), "uint64", DllStructGetData($tElem, 1, 2), "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[3] EndFunc ;==>_GDIPlus_EffectCreate Can you test on your systems? Use this instead: Func _GDIPlus_StringFormatCreateTypographic() Local $aResult = DllCall($ghGDIPDll, "uint", "GdipStringFormatGetGenericTypographic", "ptr*", 0) If @error Then Return SetError(@error, @extended, 0) Return $aResult[1] EndFunc ;==>_GDIPlus_StringFormatCreateTypographic Br, UEZ1 point -
Ah! I'm a bit late it seems. I've worked on the first version only. Anyway, look at what I came up with: you can remove your original code included under the If 0 Then branch. The progress bar doesn't make much sense with small files. #RequireAdmin #include <GUIConstantsEx.au3> #include <Constants.au3> #include <Array.au3> #include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> #include <SQLite.au3> #include <SQLite.dll.au3> Global $iMemo _Main() Func _Main() Local $hEventLog, $aEvent Global $SQLite_db ; Create GUI GUICreate("EventLog", 604, 604) $Progress1 = GUICtrlCreateProgress(8, 25, 590, 25) $Label1 = GUICtrlCreateLabel("Reading event log", 8, 8, 430, 17) $iMemo = GUICtrlCreateEdit("", 2, 60, 600, 542) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState() $read_events = 5000 _SQLite_Startup() MemoWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF) $db_name = @ScriptDir & "\SQLite_v2.db" If FileExists($db_name) Then MemoWrite("Opening existing database. "& $db_name) $SQLite_db = _SQLite_Open($db_name) Else MemoWrite("Creating new database at: "& $db_name) $SQLite_db = _SQLite_Open($db_name) MemoWrite("Creating database structure.") _SQLite_Exec($SQLite_db, "CREATE TABLE ip_list (ID INTEGER PRIMARY KEY AUTOINCREMENT, log_id CHAR UNIQUE, date CHAR, ip CHAR, user CHAR)") EndIf GUICtrlSetData($Label1, "Reading event log from windows") MemoWrite("Generating event log from windows") GUICtrlSetData($Progress1, 1) $cmd = 'wevtutil qe Security "/q:*[System[band(Keywords,8010000000000000)]]" /c:'& $read_events &' /rd:true /f:xml>C:\wevtutil.xml' FileDelete ( "c:\wevtutil.xml" ) Local $foo = RunWait(@ComSpec & ' /c '& $cmd, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ;$data = FileRead('C:\wevtutil.xml') ;FileDelete ( "c:\wevtutil.xml" ) ;MemoWrite($data) ;GUICtrlSetData($Label1, "Reading event log: "& $read_events &"/" & $read_events) GUICtrlSetData($Label1, "Reading event log done.") MemoWrite("Generating event log done.") MemoWrite("Reading event log.") If 0 Then ; Define a variable to pass to _FileReadToArray. Local $aArray = 0 ; Read the current script file into an array using the variable defined previously. If Not _FileReadToArray("wevtutil.xml", $aArray, 0) Then MsgBox($MB_SYSTEMMODAL, "", "There was an error reading the file. @error: " & @error) ; An error occurred reading the current script file. EndIf ; Display the array in _ArrayDisplay. ;_ArrayDisplay($aArray) MemoWrite("Reading event log done.") MemoWrite("Phrasing event log.") $total_records = UBound($aArray) Local $IPArray[0][5] Local $sql_qry = "" For $vElement In $aArray $size = UBound($IPArray) + 1 ReDim $IPArray[$size][5] $ix = $size -1 $percent = Round(100 / $total_records * $size) GUICtrlSetData($Progress1, $percent) GUICtrlSetData($Label1, "Phrasing event log: "& $ix &"/" & $total_records) $date = "<TimeCreated SystemTime='(.*?)'/>" $array = StringRegExp($vElement, $date, 1) If IsArray($array) Then $IPArray[$ix][1] = $array[0] Else $IPArray[$ix][1] = "none" EndIf $EventID = "<EventRecordID>(.*?)</EventRecordID>" $array = StringRegExp($vElement, $EventID, 1) If IsArray($array) Then $IPArray[$ix][0] = $array[0] Else $IPArray[$ix][0] = "none" EndIf $network = "<Data Name='IpAddress'>(.*?)</Data>" $array = StringRegExp($vElement, $network, 1) If IsArray($array) Then $IPArray[$ix][2] = $array[0] Else $IPArray[$ix][2] = "none" EndIf $account = "<Data Name='TargetUserName'>(.*?)</Data>" $array = StringRegExp($vElement, $account, 1) If IsArray($array) Then ;_ArrayDisplay($array) $IPArray[$ix][3] = $array[0] Else $IPArray[$ix][3] = "none" EndIf $sql_qry = "INSERT OR IGNORE INTO ip_list VALUES (null, '"& $IPArray[$ix][0] &"', '"& $IPArray[$ix][1] &"', '"& $IPArray[$ix][2] &"', '"& $IPArray[$ix][3] &"');"& @CRLF & $sql_qry ;MemoWrite($sql_qry) ;~ If Not _SQLite_Exec($SQLite_db, $sql_qry) = $SQLITE_OK Then ;~ MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) ;~ EndIf Next MemoWrite("Phrasing event log done.") MemoWrite("Inserting data to SQLite.") If Not _SQLite_Exec($SQLite_db, $sql_qry) = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) EndIf MemoWrite("Inserting data to SQLite done.") Else Local $rawdata = FileRead("wevtutil1.xml") ; ##### reading supplied file directly ! Local $captures = StringRegExp($rawdata, "(?i)<TimeCreated SystemTime='(.*?)'/><EventRecordID>(.*?)</EventRecordID>.*?<Data Name='TargetUserName'>(.*?)</Data>.*?<Data Name='IpAddress'>(.*?)</Data>", 3) MemoWrite("Phrasing event log done.") MemoWrite("Inserting data to SQLite.") ;~ _ArrayDisplay($captures) If IsArray($captures) Then Local $sql If Not _SQLite_Exec($SQLite_db, "begin;") = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) EndIf For $i = 0 To (UBound($captures) / 4) - 1 $sql &= "('" & $captures[4 * $i] & "', '" & $captures[4 * $i + 1] & "', '" & $captures[4 * $i + 2] & "', '" & $captures[4 * $i + 3] & "')," If Mod($i + 1, 500) = 0 Or $i = (UBound($captures) / 4) - 1 Then $sql = "INSERT OR IGNORE INTO ip_list (date, log_id, user, ip) VALUES " & StringTrimRight($sql, 1) If Not _SQLite_Exec($SQLite_db, $sql) = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) EndIf $sql = "" EndIf Next If Not _SQLite_Exec($SQLite_db, "commit;") = $SQLITE_OK Then MsgBox($MB_SYSTEMMODAL, "SQLite Error", _SQLite_ErrMsg()) EndIf EndIf MemoWrite("Inserting data to SQLite done.") EndIf MemoWrite("IP address, failed authentication tires") display_resutls("SELECT ip, count(*) as 'Cnt' FROM ip_list GROUP BY ip;") MemoWrite("Username, failed authentication tires") display_resutls("SELECT user, count(*) as 'Cnt' FROM ip_list GROUP BY user;") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>_Main Func display_resutls($sql) ;MemoWrite("Reading date from SQLite db.") Local $aResult, $iRows, $iColumns, $iRval Global $SQLite_db $iRval = _SQLite_GetTable2d($SQLite_db, $sql, $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then _ArrayDisplay($aResult, "Query Result") $iRows = UBound($aResult)-1 $iCols = UBound($aResult, 2)-1 For $i = 1 To $iRows $string = "" For $x = 0 To $iCols $string = $string & $aResult[$i][$x] & " " Next MemoWrite($string) Next Else MsgBox($MB_SYSTEMMODAL, "SQLite Error: " & $iRval, _SQLite_ErrMsg()) EndIf ;MemoWrite("Reading date from SQLite db done.") EndFunc ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite What I've done is very simple: read the input in one shot, regexp all data at once in a 1D array and group 500 row values per insert, all in one transaction.1 point
-
How to track internet history
onlineth reacted to AdmiralAlkex for a topic
It is when you make a post whose sole purpose is to "bump" your thread to the top of the forum. Bumping more than once in a 24 hour period is considered bad etiquette and will attract posts like the one above typically followed by (if not administered by) a warning from a Moderator.1 point -
Hey folks, I just explored the new helpfile and found a new Keyword (dunno if its that new, but i never saw it before) called Volatile. It was made especally for CallBack and Com event functions, so I wanted to try that out. the advantage of this Keyword is, that you can run the Dll while you can do other things in autoit (AutoIt wont freeze/pause anymore while the dllcall is executed!) I made up a little example i want to share with you, the c source is compiled in MinGW, you need at least AutoIt 3.3.10.2. Hope you like it, would be interested in some comments Greetz, Spider testLibCallback.zip1 point