
Siao
Active Members-
Posts
914 -
Joined
-
Last visited
Everything posted by Siao
-
In that While loop, check the State (and possibly Type) member of each MEMORY_BASIC_INFORMATION structure to filter out unallocated pages. At the very least, state should read MEM_COMMIT. Also, if you only looking for code caves and not interested in memory allocated after PE is loaded, you could loop though PE section header, and get start address, raw/virtual size and flags of each section.
-
Search is good. WM_DROPFILES
-
As if it's something new to AutoIt... Scite, Search > Find in files..., point to AutoIt include folder, and search for tRect. Or actually, search for the same in helpfile.
-
Not necessarily. And zero padding each number string is the worst way to go, unless maybe you are dealing with huge numbers that can't be expressed with numeric types properly.
-
Get rid of those @SW_LOCK/@SW_UNLOCK, update only if $NewText <> $OldText, use ControlSetText instead of GUICtrlSetData.
-
Set Icon On Specific Line In List View
Siao replied to Gillboss's topic in AutoIt General Help and Support
That's not funny, that just proves my point. Anyway, since I want to be done with you ASAP and put you back on my ignore list where you rightfully belong, see this for example: #470173 -
Set Icon On Specific Line In List View
Siao replied to Gillboss's topic in AutoIt General Help and Support
Take time to learn how to search, it will pay off many times over. -
_GUICtrlListView_HitTest() wrong return?
Siao replied to smashly's topic in AutoIt GUI Help and Support
Use _GUICtrlListView_SubItemHitTest -
DllCall a LoadKeyboardLayout+ActivateKeyboardLayout
-
Because in theory, quicksort is not a stable sorting algo (see http://en.wikipedia.org/wiki/Stable_sort#Stability). That's just the way it is.
-
[Resolved] EnumResourceNames and EnumResNameProc ?
Siao replied to smashly's topic in AutoIt General Help and Support
In its most basic form: #include <WinAPI.au3> ConsoleWrite('Enumerating - user32.dll, type=3 (RT_ICON):' & @CRLF) _ResourceEnumNames(_WinAPI_GetModuleHandle('user32.dll'), 3) ConsoleWrite('Enumerating - ntbackup.exe, type=10 (RT_RCDATA):' & @CRLF) _ResourceEnumNames('ntbackup.exe', 10) Func _ResourceEnumNames($vModule, $iType) Local $hModule = $vModule, $aRet, $fLoad = IsString($vModule), $xCB = DllCallbackRegister('___EnumResNameProc','int','int_ptr;int_ptr;int_ptr;int_ptr') If $fLoad Then $hModule = _WinAPI_LoadLibrary($vModule) $aRet = DllCall('kernel32.dll','int','EnumResourceNamesW', 'ptr',$hModule, 'int',$iType, 'ptr',DllCallbackGetPtr($xCB), 'ptr',0) DllCallbackFree($xCB) If $fLoad Then _WinAPI_FreeLibrary($hModule) EndFunc Func ___EnumResNameProc($vModule, $pType, $pName, $lParam) Local $aSize = DllCall('kernel32.dll','int','GlobalSize','ptr',$pName), $tBuf If $aSize[0] Then $tBuf = DllStructCreate('wchar[' & $aSize[0] & ']', $pName) ConsoleWrite(DllStructGetData($tBuf, 1) & @CRLF) ;string ID Else ConsoleWrite($pName & @CRLF) ;integer ID EndIf Return 1 ;continue enumeration EndFunc -
MsgBox(0,'','Test = ' & _Crypt_HashData("Test")) ;=============================================================================== ; Function Name: _Crypt_HashData() ; Description: Calculate hash from data ; Syntax: ; Parameter(s): $vData - data to hash, can be binary or a string ; $iAlgID - hash algorithm identifier, can be one of the following: ; 0x8001 = MD2 ; 0x8002 = MD4 ; 0x8003 = MD5 (default) ; 0x8004 = SHA1 ; also see http://msdn.microsoft.com/en-us/library/aa375549(VS.85).aspx ; Requirement(s): ; Return Value(s): Success = Returns hash string ; Failure = Returns empty string and sets error: ; @error -1 = error opening advapi32.dll ; @error 1 = failed CryptAcquireContext ; @error 2 = failed CryptCreateHash ; @error 3 = failed CryptHashData ; Author(s): Siao ; Modification(s): ;=============================================================================== Func _Crypt_HashData($vData, $iAlgID = 0x8003) Local $hDll = DllOpen('advapi32.dll'), $iLen = BinaryLen($vData), $hContext, $hHash, $aRet, $sRet = "", $iErr = 0, $tDat = DllStructCreate("byte[" & $iLen+1 & "]"), $tBuf DllStructSetData($tDat, 1, $vData) If $hDll = -1 Then Return SetError($hDll,0,$sRet) $aRet = DllCall($hDll,'int','CryptAcquireContext', 'ptr*',0, 'ptr',0, 'ptr',0, 'dword',1, 'dword',0xF0000000) ;PROV_RSA_FULL = 1; CRYPT_VERIFYCONTEXT = 0xF0000000 If Not @error And $aRet[0] Then $hContext = $aRet[1] $aRet = DllCall($hDll,'int','CryptCreateHash', 'ptr',$hContext, 'dword',$iAlgID, 'ptr',0, 'dword',0, 'ptr*',0) If $aRet[0] Then $hHash = $aRet[5] $aRet = DllCall($hDll,'int','CryptHashData', 'ptr',$hHash, 'ptr',DllStructGetPtr($tDat), 'dword',$iLen, 'dword',0) If $aRet[0] Then $aRet = DllCall($hDll,'int','CryptGetHashParam', 'ptr',$hHash, 'dword',2, 'ptr',0, 'int*',0, 'dword',0) ;HP_HASHVAL = 2 $tBuf = DllStructCreate("byte[" & $aRet[4] & "]") DllCall($hDll,'int','CryptGetHashParam', 'ptr',$hHash, 'dword',2, 'ptr',DllStructGetPtr($tBuf), 'int*',$aRet[4], 'dword',0) $sRet = Hex(DllStructGetData($tBuf, 1)) Else $iErr = 3 EndIf DllCall($hDll,'int','CryptDestroyHash', 'ptr',$hHash) Else $iErr = 2 EndIf DllCall($hDll,'int','CryptReleaseContext', 'ptr',$hContext, 'dword',0) Else $iErr = 1 EndIf DllClose($hDll) Return SetError($iErr,0,$sRet) EndFunc
-
You don't get it. It's not AutoIt problem at all. It's how you build your DLL in Delphi. Just digest this: http://en.wikipedia.org/wiki/Dynamic-link_library#Delphi
-
I'm not familiar with Delphi, but it could be something like... function GetCurrentHP(wnd:HWND):DWORD stdcall; export; Geez, just read some delphi help on how to make proper usable DLLs.
-
And that doesn't tell you anything? GetCurrentHP isn't exported. What language is this, Delphi? There should be some "export" keyword to be used in func declaration...
-
PeekMessage from user32.dll
Siao replied to evilertoaster's topic in AutoIt General Help and Support
PeekMessage isn't intended to hook into the message queue of another process, if that's what you're trying to do. -
Calling my own dll causes crash.
Siao replied to monoceres's topic in AutoIt General Help and Support
See the Remarks of DllCall reference in helpfile. Particularly the paragraph about calling conventions. -
listview x3 in same gui with onclick action
Siao replied to nikink's topic in AutoIt GUI Help and Support
You are using old version of AutoIt. This issue was fixed way back. I don't understand why quite a lot of ppl miss the obvious fact that before posting any questions about bugs (or any issues actually), they should make sure to have the latest version installed. Seems like common sense to me... -
Need Help: Free/Unload Dll of Remote Process
Siao replied to badzox's topic in AutoIt General Help and Support
You have found that dll injection example in AutoIt. So what exactly have you tried to make it do the opposite? It's only a matter of changing 4 letters in API function name and one parameter... -
ReDim is very expensive, and doing it for each change to the array in a loop is bad practice (same as _ArrayAdd).
-
Do you see that "Bug Reports and Feature Requests" forum? Wonder what happens when you click on it?
-
You are confused, and so your post is confusing as well. Assuming that you have $a = "0110001111000111110001111100000000100100" then to get your answer all you need is $b = StringMid($a, 7, 30)
-
how to read HIWORD from DWORD type
Siao replied to Uriziel01's topic in AutoIt General Help and Support
If only you bother to do a search for "hiword" in AutoIt helpfile, you'd even find functions _WinAPI_HiWord/_WinAPI_LoWord among the search results. Not that such simple bit manipulation requires any user defined functions... -
How to create a static image control with user32.dll
Siao replied to Kip's topic in AutoIt General Help and Support
No it's not. Unless you are talking about controls made with native GuiCtrlCreate... functions, but topic starter is way too smart to use these. -
How to create a static image control with user32.dll
Siao replied to Kip's topic in AutoIt General Help and Support
GuiCtrlCreatePic